Name
run_bg_estirun_bg_estiRunBgEstiRunBgEsti — Estimate the background and return the foreground region.
run_bg_estirun_bg_estiRunBgEstiRunBgEstiRunBgEsti 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 (PresentImagePresentImagePresentImagePresentImagepresentImage). By comparison to the
threshold (fixed or adaptive, see create_bg_esticreate_bg_estiCreateBgEstiCreateBgEstiCreateBgEsti) 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_factorZoomImageFactorZoomImageFactorZoomImageFactor. 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_estiCreateBgEstiCreateBgEstiCreateBgEsti) can be
lowered. The foreground region returned by run_bg_estirun_bg_estiRunBgEstiRunBgEstiRunBgEsti
then has to be enlarged again for further processing.
The passed image (PresentImagePresentImagePresentImagePresentImagepresentImage) must have the same
type and size as the background image of the current data set
(initialized with create_bg_esticreate_bg_estiCreateBgEstiCreateBgEstiCreateBgEsti).
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Region of the detected foreground.
ID of the BgEsti data set.
* Read image for initialization:
read_image(InitImage,'xing/init')
* Initialize BgEsti dataset with
* fixed gains and threshold adaption:
create_bg_esti(InitImage,0.7,0.7,'fixed',0.002,0.02, \
'on',7.0,10,3.25,15.0,BgEstiHandle)
* Read the next image in sequence:
read_image(Image0,'xing/xing000')
* Estimate the background:
run_bg_esti(Image0,ForegroundRegion1,BgEstiHandle)
* Display the foreground region:
dev_display (ForegroundRegion1)
* Read the next image in sequence:
read_image(Image1,'xing/xing001')
* Estimate the background:
run_bg_esti(Image1,ForegroundRegion2,BgEstiHandle)
* Display the foreground region:
dev_display (ForegroundRegion2)
* etc.
/* Read image for initialization: */
read_image(&InitImage,"xing/init") ;
/* 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(&Image0,"xing/xing000") ;
/* Estimate the Background: */
run_bg_esti(Image0,&Region1,BgEstiHandle) ;
/* Display the foreground region: */
disp_region(Region1,WindowHandle) ;
/* Read the next image in sequence: */
read_image(&Image1,"xing/xing001") ;
/* Estimate the Background: */
run_bg_esti(Image1,&Region2,BgEstiHandle) ;
/* Display the foreground region: */
disp_region(Region2,WindowHandle) ;
/* etc. */
* Read image for initialization:
read_image(InitImage,'xing/init')
* Initialize BgEsti dataset with
* fixed gains and threshold adaption:
create_bg_esti(InitImage,0.7,0.7,'fixed',0.002,0.02, \
'on',7.0,10,3.25,15.0,BgEstiHandle)
* Read the next image in sequence:
read_image(Image0,'xing/xing000')
* Estimate the background:
run_bg_esti(Image0,ForegroundRegion1,BgEstiHandle)
* Display the foreground region:
dev_display (ForegroundRegion1)
* Read the next image in sequence:
read_image(Image1,'xing/xing001')
* Estimate the background:
run_bg_esti(Image1,ForegroundRegion2,BgEstiHandle)
* Display the foreground region:
dev_display (ForegroundRegion2)
* etc.
* Read image for initialization:
read_image(InitImage,'xing/init')
* Initialize BgEsti dataset with
* fixed gains and threshold adaption:
create_bg_esti(InitImage,0.7,0.7,'fixed',0.002,0.02, \
'on',7.0,10,3.25,15.0,BgEstiHandle)
* Read the next image in sequence:
read_image(Image0,'xing/xing000')
* Estimate the background:
run_bg_esti(Image0,ForegroundRegion1,BgEstiHandle)
* Display the foreground region:
dev_display (ForegroundRegion1)
* Read the next image in sequence:
read_image(Image1,'xing/xing001')
* Estimate the background:
run_bg_esti(Image1,ForegroundRegion2,BgEstiHandle)
* Display the foreground region:
dev_display (ForegroundRegion2)
* etc.
* Read image for initialization:
read_image(InitImage,'xing/init')
* Initialize BgEsti dataset with
* fixed gains and threshold adaption:
create_bg_esti(InitImage,0.7,0.7,'fixed',0.002,0.02, \
'on',7.0,10,3.25,15.0,BgEstiHandle)
* Read the next image in sequence:
read_image(Image0,'xing/xing000')
* Estimate the background:
run_bg_esti(Image0,ForegroundRegion1,BgEstiHandle)
* Display the foreground region:
dev_display (ForegroundRegion1)
* Read the next image in sequence:
read_image(Image1,'xing/xing001')
* Estimate the background:
run_bg_esti(Image1,ForegroundRegion2,BgEstiHandle)
* Display the foreground region:
dev_display (ForegroundRegion2)
* etc.
run_bg_estirun_bg_estiRunBgEstiRunBgEstiRunBgEsti returns 2 (H_MSG_TRUE) if all parameters are
correct.
create_bg_esticreate_bg_estiCreateBgEstiCreateBgEstiCreateBgEsti,
update_bg_estiupdate_bg_estiUpdateBgEstiUpdateBgEstiUpdateBgEsti
give_bg_estigive_bg_estiGiveBgEstiGiveBgEstiGiveBgEsti,
update_bg_estiupdate_bg_estiUpdateBgEstiUpdateBgEstiUpdateBgEsti
set_bg_esti_paramsset_bg_esti_paramsSetBgEstiParamsSetBgEstiParamsSetBgEstiParams,
create_bg_esticreate_bg_estiCreateBgEstiCreateBgEstiCreateBgEsti,
update_bg_estiupdate_bg_estiUpdateBgEstiUpdateBgEstiUpdateBgEsti,
give_bg_estigive_bg_estiGiveBgEstiGiveBgEstiGiveBgEsti
Foundation