ForegroundGaussianInitAlloc

Allocates memory and initializes a state structure for foreground/background segmentation using Gaussian mixtures.

Syntax

IppStatus ippiForegroundGaussianInitAlloc_8u_C1R(const Ipp8u* pSrc, int srcStep, IppiSize roiSize, IppFGGaussianModel* pModel, IppFGGaussianState_8u_C1R** ppState);

IppStatus ippiForegroundGaussianInitAlloc_8u_C3R(const Ipp8u* pSrc, int srcStep, IppiSize roiSize, IppFGGaussianModel* pModel, IppFGGaussianState_8u_C3R** ppState);

Parameters

pSrc
Pointer to the source image ROI.
srcStep
Distance in bytes between starts of consecutive lines in the source image.
roiSize
Size of the source and destination image ROI in pixels.
pModel
Pointer to the structure of the Gaussian statistical model.
ppState
Pointer to the pointer to the segmentation state structure.

Description

The function ippiForegroundGaussianInitAlloc is declared in the ippcv.h It operates with ROI (see Regions of Interest in Intel IPP).

This function allocates memory, initializes the state structure for the foreground and background modeling by Gaussian mixtures and returns the pointer ppState to it. This structure is used by the function ippiForegroundGaussian that detects foreground pixels and updates the statistical model for the segmentation.

The Gaussian mixture statistical model is defined by following fields of pModel structure:

numGauss

Number of components in the Gaussian mixture for each frame (usually, 3-5).

priorBack

Minimum prior probability of the background.

updBGProb

Speed of updating of parameters of selected mixture component (0.5 > updBGProb > 0).

winSize

Number of last frames affecting model parameter update (100-200).

numFrame

Number of background frames for adjustment of shadows searching. Only for 3-channels images.

detectionRate

Speed of shadows searching. Only for 3-channels images (0 > detectionRate > 1).

brightnessDistortion

Lower bound of the normalized brightness distortion for shadows. Only for 3-channels images (0 > brightnessDistortion > 1).

shadowBG

Flag of shadows searching. If shadowBG is 1, then pixels belonging to colored shadows are marked as background, otherwise they may be included in foreground areas. Only for 3-channels images (0,1).

The Gaussian mixture statistical model models each background pixel by a Gaussian mixture with a small number of components numGauss [Kadew01]. Most important components with sum of weights greater than priorBack are used to model the background. Mixture components are updated while processing each new frame. The learning speed of the component that matches a background pixel is defined by updBGChange. All mixture parameters are then updated using statistics from last winSize frames. If shadowBG is set to 1, then the search of colored shadows is performed for three-channel images. In this case foreground pixels, that are detected as shadow, are marked as background pixels.

The structure can be used to process image whose width and height are equal to or less than corresponding fields of roiSize.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error condition if one of the specified pointers is NULL.

ippStsSizeErr

Indicates an error condition if roiSize has a field with zero or negative value.

ippStsStepErr

Indicates an error condition if one of the srcStep is less than roiSize.width * < pixelSize>.

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.