Skip to content

set_bg_esti_paramsSetBgEstiParamsSetBgEstiParamsset_bg_esti_paramsT_set_bg_esti_paramsπŸ”—

Short descriptionπŸ”—

set_bg_esti_paramsSetBgEstiParamsSetBgEstiParamsset_bg_esti_paramsT_set_bg_esti_params β€” Change the parameters of the data set.

SignatureπŸ”—

set_bg_esti_params( bg_estimation BgEstiHandle, real Syspar1, real Syspar2, string GainMode, real Gain1, real Gain2, string AdaptMode, real MinDiff, integer StatNum, real ConfidenceC, real TimeC )void SetBgEstiParams( const HTuple& BgEstiHandle, const HTuple& Syspar1, const HTuple& Syspar2, const HTuple& GainMode, const HTuple& Gain1, const HTuple& Gain2, const HTuple& AdaptMode, const HTuple& MinDiff, const HTuple& StatNum, const HTuple& ConfidenceC, const HTuple& TimeC )static void HOperatorSet.SetBgEstiParams( HTuple bgEstiHandle, HTuple syspar1, HTuple syspar2, HTuple gainMode, HTuple gain1, HTuple gain2, HTuple adaptMode, HTuple minDiff, HTuple statNum, HTuple confidenceC, HTuple timeC )def set_bg_esti_params( bg_esti_handle: HHandle, syspar_1: float, syspar_2: float, gain_mode: str, gain_1: float, gain_2: float, adapt_mode: str, min_diff: float, stat_num: int, confidence_c: float, time_c: float ) -> None

Herror T_set_bg_esti_params( const Htuple BgEstiHandle, const Htuple Syspar1, const Htuple Syspar2, const Htuple GainMode, const Htuple Gain1, const Htuple Gain2, const Htuple AdaptMode, const Htuple MinDiff, const Htuple StatNum, const Htuple ConfidenceC, const Htuple TimeC )

void HBgEsti::SetBgEstiParams( double Syspar1, double Syspar2, const HString& GainMode, double Gain1, double Gain2, const HString& AdaptMode, double MinDiff, Hlong StatNum, double ConfidenceC, double TimeC ) const

void HBgEsti::SetBgEstiParams( double Syspar1, double Syspar2, const char* GainMode, double Gain1, double Gain2, const char* AdaptMode, double MinDiff, Hlong StatNum, double ConfidenceC, double TimeC ) const

void HBgEsti::SetBgEstiParams( double Syspar1, double Syspar2, const wchar_t* GainMode, double Gain1, double Gain2, const wchar_t* AdaptMode, double MinDiff, Hlong StatNum, double ConfidenceC, double TimeC ) const (Windows only)

void HBgEsti.SetBgEstiParams( double syspar1, double syspar2, string gainMode, double gain1, double gain2, string adaptMode, double minDiff, int statNum, double confidenceC, double timeC )

DescriptionπŸ”—

set_bg_esti_paramsSetBgEstiParams is used to change the parameters of the data set. The parameters passed by set_bg_esti_paramsSetBgEstiParams are the same as in create_bg_estiCreateBgEsti (see there for an explanation).

The image format cannot be changed! To do this, a new data set with an initialization image of the appropriate format has to be created.

To exchange the background image completely, use update_bg_estiUpdateBgEsti. The current image then has to be passed for both the input image and the update region.

AttentionπŸ”—

If GainModegainModegain_mode was set to 'frame'"frame", the run-time can be extremely long for large values of Gain1gain1gain_1 or Gain2gain2gain_2, because the values for the gains’ table are determined by a simple binary search.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

BgEstiHandlebgEstiHandlebg_esti_handle (input_control) bg_estimation β†’ (handle)HTuple (HHandle)HBgEsti, HTuple (IntPtr)HHandleHtuple (handle)

ID of the BgEsti data set.

Syspar1syspar1syspar_1 (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

1. system matrix parameter.

Default: 0.70.7
Suggested values: 0.65, 0.7, 0.750.65, 0.7, 0.75
Value range: 0.05 ≀ Syspar1 ≀ 1.0
Recommended increment: 0.05

Syspar2syspar2syspar_2 (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

2. system matrix parameter.

Default: 0.70.7
Suggested values: 0.65, 0.7, 0.750.65, 0.7, 0.75
Value range: 0.05 ≀ Syspar2 ≀ 1.0
Recommended increment: 0.05

GainModegainModegain_mode (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Gain type.

Default: 'fixed'"fixed"
List of values: 'fixed', 'frame'"fixed", "frame"

Gain1gain1gain_1 (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Kalman gain / foreground adaptation time.

Default: 0.0020.002
Suggested values: 10.0, 20.0, 50.0, 0.1, 0.05, 0.01, 0.005, 0.00110.0, 20.0, 50.0, 0.1, 0.05, 0.01, 0.005, 0.001
Restriction: 0.0 <= Gain1

Gain2gain2gain_2 (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Kalman gain / background adaptation time.

Default: 0.020.02
Suggested values: 2.0, 4.0, 8.0, 0.5, 0.1, 0.05, 0.012.0, 4.0, 8.0, 0.5, 0.1, 0.05, 0.01
Restriction: 0.0 <= Gain2

AdaptModeadaptModeadapt_mode (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Threshold adaptation.

Default: 'on'"on"
List of values: 'off', 'on'"off", "on"

MinDiffminDiffmin_diff (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Foreground/background threshold.

Default: 7.07.0
Suggested values: 3.0, 5.0, 7.0, 9.0, 11.03.0, 5.0, 7.0, 9.0, 11.0
Recommended increment: 0.2

StatNumstatNumstat_num (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of statistic data sets.

Default: 1010
Suggested values: 5, 10, 20, 305, 10, 20, 30
Value range: 1 ≀ StatNum
Recommended increment: 5

ConfidenceCconfidenceCconfidence_c (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Confidence constant.

Default: 3.253.25
Suggested values: 4.30, 3.25, 2.82, 2.624.30, 3.25, 2.82, 2.62
Recommended increment: 0.01
Restriction: 0.0 < ConfidenceC

TimeCtimeCtime_c (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Constant for decay time.

Default: 15.015.0
Suggested values: 10.0, 15.0, 20.010.0, 15.0, 20.0
Recommended increment: 5.0
Restriction: 0.0 < TimeC

ExampleπŸ”—

(HDevelop)


* 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.
* Change parameter in dataset:
set_bg_esti_params(BgEstiHandle,0.7,0.7,'fixed', \
                    0.004,0.08,'on',9.0,10,3.25,20.0)
* Read the next image in sequence:
read_image(Image2,'xing/xing002')
* Estimate the background:
run_bg_esti(Image2,ForegroundRegion3,BgEstiHandle)
* Display the foreground region:
dev_display(ForegroundRegion3)
* etc.

ResultπŸ”—

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

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

create_bg_estiCreateBgEsti

Possible successors

run_bg_estiRunBgEsti

See also

update_bg_estiUpdateBgEsti

ModuleπŸ”—

Foundation