ForegroundHistogramInitAlloc

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

Syntax

IppStatus ippiForegroundHistogramInitAlloc_8u_C1R(const Ipp8u* pSrc, int srcStep, IppiSize roiSize, IppFGHistogramModel* pModel, IppFGHistogramState_8u_C1R** ppState)

IppStatus ippiForegroundHistogramInitAlloc_8u_C3R(const Ipp8u* pSrc, int srcStep, IppiSize roiSize, IppFGHistogramModel* pModel, IppFGHistogramState_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
Pinter to the structure of the histogram statistical model.
ppState
Pointer to the pointer to the segmentation state structure.

Description

The function ippiForegroundHistogramInitAlloc 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 histogram modeling of foreground and background and returns the pointer ppState to it. It is used by the functions ippiForegroundHistogram and ippiForegroundHistogramUpdate that detect foreground pixels and update the statistical model for the segmentation.

The histogram statistical model implements detecting both stationary and moving background objects [Li03]. The model keeps histograms of quantized pixel values and quantized velocities of pixel value changes.

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

valueQuant

Number of quantization levels for pixel values (degree of 2, valueQuant 2).

changeQuant

Number of quantization levels for the speed of pixel value change (degree of 2, valueQuant 2).

valueUse

Number of most frequent pixel value levels used for classification ( valueUse valueAll).

valueAll

Number of all pixel value levels monitored by the model (valueAll > 0).

changeUse

Number of most frequent speed levels used for classification ( changeUse changeAll).

changeAll

Number of all speed levels monitored by the model (changeAll > 0).

updBGProb

Speed of updating of the background probability (0.5 > updBGProb > 0).

updBGRef

Speed of updating of the reference background image (0.5 > updBGRef > 0).

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).

valueAll ( changeAll) are the most frequent levels; they are monitored by the model. First of them valueUse (changeUse) are used for foreground/background classification. The probabilities to classify pixels as background and pixel values of the reference background image are updated using one pole IIR filters with parameters updBGProb and updBGRef respectively. 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>.

ippStsBadArgErr

Indicates an error condition if pModel has an illegal value.

Submit feedback on this help topic

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