ClassesClassesClassesClasses | | | | Operators

run_bg_estirun_bg_estiRunBgEstirun_bg_estiRunBgEstiRunBgEsti (Operator)

Name

run_bg_estirun_bg_estiRunBgEstirun_bg_estiRunBgEstiRunBgEsti — Estimate the background and return the foreground region.

Signature

run_bg_esti(PresentImage : ForegroundRegion : BgEstiHandle : )

Herror run_bg_esti(const Hobject PresentImage, Hobject* ForegroundRegion, const Hlong BgEstiHandle)

Herror T_run_bg_esti(const Hobject PresentImage, Hobject* ForegroundRegion, const Htuple BgEstiHandle)

Herror run_bg_esti(Hobject PresentImage, Hobject* ForegroundRegion, const HTuple& BgEstiHandle)

HRegion HImage::RunBgEsti(const HBgEsti& BgEstiHandle) const

HRegion HBgEsti::RunBgEsti(const HImage& PresentImage) const

void RunBgEsti(const HObject& PresentImage, HObject* ForegroundRegion, const HTuple& BgEstiHandle)

HRegion HImage::RunBgEsti(const HBgEsti& BgEstiHandle) const

HRegion HBgEsti::RunBgEsti(const HImage& PresentImage) const

void HOperatorSetX.RunBgEsti(
[in] IHUntypedObjectX* PresentImage, [out] IHUntypedObjectX*ForegroundRegion, [in] VARIANT BgEstiHandle)

IHRegionX* HImageX.RunBgEsti([in] IHBgEstiX* BgEstiHandle)

IHRegionX* HBgEstiX.RunBgEsti([in] IHImageX* PresentImage)

static void HOperatorSet.RunBgEsti(HObject presentImage, out HObject foregroundRegion, HTuple bgEstiHandle)

HRegion HImage.RunBgEsti(HBgEsti bgEstiHandle)

HRegion HBgEsti.RunBgEsti(HImage presentImage)

Description

run_bg_estirun_bg_estiRunBgEstirun_bg_estiRunBgEstiRunBgEsti adapts the background image stored in the BgEsti data set using a Kalman filter on each pixel and returns a region of the foreground (detected moving objects).

For every pixel an estimation of its grayvalue is computed using the values of the current data set and its stored background image and the current image (PresentImagePresentImagePresentImagePresentImagePresentImagepresentImage). By comparison to the threshold (fixed or adaptive, see create_bg_esticreate_bg_estiCreateBgEsticreate_bg_estiCreateBgEstiCreateBgEsti) the pixels are classified as either foreground or background.

The background estimation processes only single-channel images. Therefore the background has to be adapted separately for every channel.

The background estimation should be used on half- or even quarter-sized images. For this, the input images (and the initialization image!) has to be reduced using zoom_image_factorzoom_image_factorZoomImageFactorzoom_image_factorZoomImageFactorZoomImageFactor. The advantage is a shorter run-time on one hand and a low-band filtering on the other. The filtering eliminates high frequency noise and results in a more reliable estimation. As a result the threshold (see create_bg_esticreate_bg_estiCreateBgEsticreate_bg_estiCreateBgEstiCreateBgEsti) can be lowered. The foreground region returned by run_bg_estirun_bg_estiRunBgEstirun_bg_estiRunBgEstiRunBgEsti then has to be enlarged again for further processing.

Attention

The passed image (PresentImagePresentImagePresentImagePresentImagePresentImagepresentImage) must have the same type and size as the background image of the current data set (initialized with create_bg_esticreate_bg_estiCreateBgEsticreate_bg_estiCreateBgEstiCreateBgEsti).

Parallelization

Parameters

PresentImagePresentImagePresentImagePresentImagePresentImagepresentImage (input_object)  singlechannelimage objectHImageHImageHImageHImageXHobject (byte / real)

Current image.

ForegroundRegionForegroundRegionForegroundRegionForegroundRegionForegroundRegionforegroundRegion (output_object)  region objectHRegionHRegionHRegionHRegionXHobject *

Region of the detected foreground.

BgEstiHandleBgEstiHandleBgEstiHandleBgEstiHandleBgEstiHandlebgEstiHandle (input_control)  bg_estimation HBgEsti, HTupleHTupleHBgEsti, HTupleHBgEstiX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

ID of the BgEsti data set.

Example (HDevelop)

* read Init-Image:
read_image(InitImage,'Init_Image')
* initialize BgEsti-Dataset with
* fixed gains and threshold adaption
create_bg_esti(InitImage,0.7,0.7,'fixed',0.002,0.02, \
               'on',7,10,3.25,15.0,BgEstiHandle)
* read the next image in sequence:
read_image(Image1,'Image_1')
* estimate the Background:
run_bg_esti(Image1,Region1,BgEstiHandle)
* display the foreground region:
disp_region(Region1,WindowHandle)
* read the next image in sequence:
read_image(Image2,'Image_2')
* estimate the Background:
run_bg_esti(Image2,Region2,BgEstiHandle)
* display the foreground region:
disp_region(Region2,WindowHandle)
* etc.

Example (C)

/* read Init-Image: */
read_image(&InitImage,"Init_Image") ;
/* initialize BgEsti-Dataset with
   fixed gains and threshold adaption */
create_bg_esti(InitImage,0.7,0.7,"fixed",0.002,0.02,
               "on",7,10,3.25,15.0,&BgEstiHandle) ;
/* read the next image in sequence: */
read_image(&Image1,"Image_1") ;
/* estimate the Background: */
run_bg_esti(Image1,&Region1,BgEstiHandle) ;
/* display the foreground region: */
disp_region(Region1,WindowHandle) ;
/* read the next image in sequence: */
read_image(&Image2,"Image_2") ;
/* estimate the Background: */
run_bg_esti(Image2,&Region2,BgEstiHandle) ;
/* display the foreground region: */
disp_region(Region2,WindowHandle) ;
/* etc. */

Example (HDevelop)

* read Init-Image:
read_image(InitImage,'Init_Image')
* initialize BgEsti-Dataset with
* fixed gains and threshold adaption
create_bg_esti(InitImage,0.7,0.7,'fixed',0.002,0.02, \
               'on',7,10,3.25,15.0,BgEstiHandle)
* read the next image in sequence:
read_image(Image1,'Image_1')
* estimate the Background:
run_bg_esti(Image1,Region1,BgEstiHandle)
* display the foreground region:
disp_region(Region1,WindowHandle)
* read the next image in sequence:
read_image(Image2,'Image_2')
* estimate the Background:
run_bg_esti(Image2,Region2,BgEstiHandle)
* display the foreground region:
disp_region(Region2,WindowHandle)
* etc.

Example (HDevelop)

* read Init-Image:
read_image(InitImage,'Init_Image')
* initialize BgEsti-Dataset with
* fixed gains and threshold adaption
create_bg_esti(InitImage,0.7,0.7,'fixed',0.002,0.02, \
               'on',7,10,3.25,15.0,BgEstiHandle)
* read the next image in sequence:
read_image(Image1,'Image_1')
* estimate the Background:
run_bg_esti(Image1,Region1,BgEstiHandle)
* display the foreground region:
disp_region(Region1,WindowHandle)
* read the next image in sequence:
read_image(Image2,'Image_2')
* estimate the Background:
run_bg_esti(Image2,Region2,BgEstiHandle)
* display the foreground region:
disp_region(Region2,WindowHandle)
* etc.

Example (HDevelop)

* read Init-Image:
read_image(InitImage,'Init_Image')
* initialize BgEsti-Dataset with
* fixed gains and threshold adaption
create_bg_esti(InitImage,0.7,0.7,'fixed',0.002,0.02, \
               'on',7,10,3.25,15.0,BgEstiHandle)
* read the next image in sequence:
read_image(Image1,'Image_1')
* estimate the Background:
run_bg_esti(Image1,Region1,BgEstiHandle)
* display the foreground region:
disp_region(Region1,WindowHandle)
* read the next image in sequence:
read_image(Image2,'Image_2')
* estimate the Background:
run_bg_esti(Image2,Region2,BgEstiHandle)
* display the foreground region:
disp_region(Region2,WindowHandle)
* etc.

Example (HDevelop)

* read Init-Image:
read_image(InitImage,'Init_Image')
* initialize BgEsti-Dataset with
* fixed gains and threshold adaption
create_bg_esti(InitImage,0.7,0.7,'fixed',0.002,0.02, \
               'on',7,10,3.25,15.0,BgEstiHandle)
* read the next image in sequence:
read_image(Image1,'Image_1')
* estimate the Background:
run_bg_esti(Image1,Region1,BgEstiHandle)
* display the foreground region:
disp_region(Region1,WindowHandle)
* read the next image in sequence:
read_image(Image2,'Image_2')
* estimate the Background:
run_bg_esti(Image2,Region2,BgEstiHandle)
* display the foreground region:
disp_region(Region2,WindowHandle)
* etc.

Result

run_bg_estirun_bg_estiRunBgEstirun_bg_estiRunBgEstiRunBgEsti returns 2 (H_MSG_TRUE) if all parameters are correct.

Possible Predecessors

create_bg_esticreate_bg_estiCreateBgEsticreate_bg_estiCreateBgEstiCreateBgEsti, update_bg_estiupdate_bg_estiUpdateBgEstiupdate_bg_estiUpdateBgEstiUpdateBgEsti

Possible Successors

give_bg_estigive_bg_estiGiveBgEstigive_bg_estiGiveBgEstiGiveBgEsti, update_bg_estiupdate_bg_estiUpdateBgEstiupdate_bg_estiUpdateBgEstiUpdateBgEsti

See also

set_bg_esti_paramsset_bg_esti_paramsSetBgEstiParamsset_bg_esti_paramsSetBgEstiParamsSetBgEstiParams, create_bg_esticreate_bg_estiCreateBgEsticreate_bg_estiCreateBgEstiCreateBgEsti, update_bg_estiupdate_bg_estiUpdateBgEstiupdate_bg_estiUpdateBgEstiUpdateBgEsti, give_bg_estigive_bg_estiGiveBgEstigive_bg_estiGiveBgEstiGiveBgEsti

Module

Foundation


ClassesClassesClassesClasses | | | | Operators