set_bg_esti_paramsT_set_bg_esti_paramsSetBgEstiParamsSetBgEstiParamsset_bg_esti_params (算子)
名称
set_bg_esti_paramsT_set_bg_esti_paramsSetBgEstiParamsSetBgEstiParamsset_bg_esti_params — 更改数据集的参数。
签名
set_bg_esti_params( : : BgEstiHandle, Syspar1, Syspar2, GainMode, Gain1, Gain2, AdaptMode, MinDiff, StatNum, ConfidenceC, TimeC : )
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 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)
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)
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)
void HBgEsti.SetBgEstiParams(double syspar1, double syspar2, string gainMode, double gain1, double gain2, string adaptMode, double minDiff, int statNum, double confidenceC, double 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
描述
set_bg_esti_paramsset_bg_esti_paramsSetBgEstiParamsSetBgEstiParamsSetBgEstiParamsset_bg_esti_params is used to change the parameters
of the data set. The parameters passed by
set_bg_esti_paramsset_bg_esti_paramsSetBgEstiParamsSetBgEstiParamsSetBgEstiParamsset_bg_esti_params are the same as in
create_bg_esticreate_bg_estiCreateBgEstiCreateBgEstiCreateBgEsticreate_bg_esti (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_estiupdate_bg_estiUpdateBgEstiUpdateBgEstiUpdateBgEstiupdate_bg_esti。The current image then has to be passed
for both the input image and the update region.
注意
If GainModeGainModeGainModeGainModegainModegain_mode was set to 'frame'"frame""frame""frame""frame""frame", the run-time
can be extremely long for large values of Gain1Gain1Gain1Gain1gain1gain_1 or
Gain2Gain2Gain2Gain2gain2gain_2, because the values for the gains' table are
determined by a simple binary search.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
BgEstiHandleBgEstiHandleBgEstiHandleBgEstiHandlebgEstiHandlebg_esti_handle (输入控制) bg_estimation → HBgEsti, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
ID of the BgEsti data set.
Syspar1Syspar1Syspar1Syspar1syspar1syspar_1 (输入控制) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
1. system matrix parameter.
默认值:
0.7
建议值:
0.65, 0.7, 0.75
值范围:
0.05
≤
Syspar1
Syspar1
Syspar1
Syspar1
syspar1
syspar_1
≤
1.0
建议增量:
0.05
Syspar2Syspar2Syspar2Syspar2syspar2syspar_2 (输入控制) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
2. system matrix parameter.
默认值:
0.7
建议值:
0.65, 0.7, 0.75
值范围:
0.05
≤
Syspar2
Syspar2
Syspar2
Syspar2
syspar2
syspar_2
≤
1.0
建议增量:
0.05
GainModeGainModeGainModeGainModegainModegain_mode (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Gain type.
默认值:
'fixed'
"fixed"
"fixed"
"fixed"
"fixed"
"fixed"
值列表:
'fixed'"fixed""fixed""fixed""fixed""fixed", 'frame'"frame""frame""frame""frame""frame"
Gain1Gain1Gain1Gain1gain1gain_1 (输入控制) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
Kalman gain / foreground adaptation time.
默认值:
0.002
建议值:
10.0, 20.0, 50.0, 0.1, 0.05, 0.01, 0.005, 0.001
限制:
0.0 <= Gain1
Gain2Gain2Gain2Gain2gain2gain_2 (输入控制) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
Kalman gain / background adaptation time.
默认值:
0.02
建议值:
2.0, 4.0, 8.0, 0.5, 0.1, 0.05, 0.01
限制:
0.0 <= Gain2
AdaptModeAdaptModeAdaptModeAdaptModeadaptModeadapt_mode (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Threshold adaptation.
默认值:
'on'
"on"
"on"
"on"
"on"
"on"
值列表:
'off'"off""off""off""off""off", 'on'"on""on""on""on""on"
MinDiffMinDiffMinDiffMinDiffminDiffmin_diff (输入控制) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
Foreground/background threshold.
默认值:
7.0
建议值:
3.0, 5.0, 7.0, 9.0, 11.0
建议增量:
0.2
StatNumStatNumStatNumStatNumstatNumstat_num (输入控制) integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of statistic data sets.
默认值:
10
建议值:
5, 10, 20, 30
值范围:
1
≤
StatNum
StatNum
StatNum
StatNum
statNum
stat_num
建议增量:
5
ConfidenceCConfidenceCConfidenceCConfidenceCconfidenceCconfidence_c (输入控制) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
Confidence constant.
默认值:
3.25
建议值:
4.30, 3.25, 2.82, 2.62
建议增量:
0.01
限制:
0.0 < ConfidenceC
TimeCTimeCTimeCTimeCtimeCtime_c (输入控制) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
Constant for decay time.
默认值:
15.0
建议值:
10.0, 15.0, 20.0
建议增量:
5.0
限制:
0.0 < TimeC
示例(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.
结果
set_bg_esti_paramsset_bg_esti_paramsSetBgEstiParamsSetBgEstiParamsSetBgEstiParamsset_bg_esti_params 在所有参数正确时返回 2 ( H_MSG_TRUE )。
可能的前趋
create_bg_esticreate_bg_estiCreateBgEstiCreateBgEstiCreateBgEsticreate_bg_esti
可能的后继
run_bg_estirun_bg_estiRunBgEstiRunBgEstiRunBgEstirun_bg_esti
另见
update_bg_estiupdate_bg_estiUpdateBgEstiUpdateBgEstiUpdateBgEstiupdate_bg_esti
模块
基础