determine_shape_model_params — Determine the parameters of a shape model. 模版匹配参数确定
determine_shape_model_params determines certain parameters of a shape model automatically from the model image Template. The parameters to be determined can be specified with Parameters. determine_shape_model_params can be used to determine the same parameters that are determined automatically when the respective parameter in create_shape_model, create_scaled_shape_model, or create_aniso_shape_model is set to 'auto': the number of pyramid levels (Parameters = 'num_levels'), the angle step length (Parameters = 'angle_step'), the scale step length (Parameters = 'scale_step' for isotropic scaling and 'scale_r_step' and/or 'scale_c_step' for anisotropic scaling), the kind of optimization (Parameters = 'optimization'), the threshold (Parameters = 'contrast') or the hysteresis thresholds (Parameters = 'contrast_hyst') for the contrast, the minimum size of the object parts (Parameters = 'min_size'), and the minimum contrast (Parameters = 'min_contrast'). By passing a tuple of the above values in Parameters, an arbitrary combination of these parameters can be determined. If all of the above parameters should be determined, the value 'all' can be passed. In this case both hysteresis thresholds are determined, i.e., the operator behaves like passing 'contrast_hyst' instead of 'contrast'.
determine_shape_model_params从模型图像模板自动确定形状模型的某些参数。要确定的参数可以使用参数指定。determine_shape_model_params可用于确定create_shape_model、create_scaled_shape_model或create_aniso_shape_model中的相应参数设置为“自动”时自动确定的相同参数:金字塔级别数(参数 = “num_levels”)、角度步长(参数 = “angle_step”)、刻度步长(参数 = “scale_step”用于各向同性缩放,“scale_r_step”和/或“scale_c_step”用于各向异性缩放), 对比度的优化类型 (Parameters = 'optimization')、阈值 (Parameters = 'contrast') 或滞后阈值 (Parameters = 'contrast_hyst')、对象部分的最小尺寸 (Parameters = 'min_size') 和最小对比度 (Parameters = 'min_contrast')。通过在参数中传递上述值的元组,可以确定这些参数的任意组合。如果应确定上述所有参数,则可以传递值“all”。在这种情况下,两个滞后阈值都是确定的,即算子的行为类似于传递“contrast_hyst”而不是“对比度”。
determine_shape_model_params is mainly useful to determine the above parameters before creating the model, e.g., in an interactive system, which makes suggestions for these parameters to the user, but enables the user to modify the suggested values.
determine_shape_model_params主要用于在创建模型之前确定上述参数,例如,在交互式系统中,它向用户提出这些参数的建议,但允许用户修改建议的值。
The automatically determined parameters are returned as a name-value pair in ParameterName and ParameterValue. The parameter names in ParameterName are identical to the names in Parameters, where, of course, the value 'all' is replaced by the actual parameter names. An exception is the parameter 'contrast_hyst', for which the two values 'contrast_low' and 'contrast_high' are returned.
自动确定的参数在 ParameterName 和 ParameterValue 中以名称-值对的形式返回。ParameterName 中的参数名称与 Parameters 中的名称相同,当然,其中值“all”将替换为实际的参数名称。参数“contrast_hyst”是一个例外,该参数返回两个值“contrast_low”和“contrast_high”。
The remaining parameters (NumLevels, AngleStart, AngleExtent, ScaleMin, ScaleMax, Optimization, Metric, Contrast, and MinContrast) have the same meaning as in create_shape_model, create_scaled_shape_model, and create_aniso_shape_model. The description of these parameters can be looked up with these operators. These parameters are used by determine_shape_model_params to calculate the parameters to be determined in the same manner as in create_shape_model, create_scaled_shape_model, and create_aniso_shape_model. It should be noted that if the parameters of a shape model with isotropic scaling should be determined, i.e., if Parameters contains 'scale_step' either explicitly or implicitly via 'all', the parameters ScaleMin and ScaleMax must contain one value each. If the parameters of a shape model with anisotropic scaling should be determined, i.e., if Parameters contains 'scale_r_step' or 'scale_c_step' either explicitly or implicitly, the parameters ScaleMin and ScaleMax must contain two values each. In this case, the first value of the respective parameter refers to the scaling in the row direction, while the second value refers to the scaling in the column direction.
其余参数(NumLevels、AngleStart、AngleExtent、ScaleMin、ScaleMax、Optimization、Metric、Contrast 和 MinContrast)的含义与 create_shape_model、create_scaled_shape_model 和 create_aniso_shape_model 中的含义相同。可以使用这些运算符查找这些参数的描述。determine_shape_model_params使用这些参数来计算要确定的参数,其方式与create_shape_model、create_scaled_shape_model和create_aniso_shape_model中的方式相同。应该注意的是,如果应确定具有各向同性缩放的形状模型的参数,即,如果参数通过“all”显式或隐式地包含“scale_step”,则参数 ScaleMin 和 ScaleMax 必须各包含一个值。如果应确定具有各向异性缩放的形状模型的参数,即,如果 Parameters 显式或隐式包含“scale_r_step”或“scale_c_step”,则参数 ScaleMin 和 ScaleMax 必须分别包含两个值。在这种情况下,相应参数的第一个值是指行方向上的缩放,而第二个值是指列方向上的缩放。
Note that in determine_shape_model_params some parameters appear that can also be determined automatically (NumLevels, Optimization, Contrast, MinContrast). If these parameters should not be determined automatically, i.e., their name is not passed in Parameters, the corresponding parameters must contain valid values and must not be set to 'auto'. In contrast, if these parameters are to be determined automatically, their values are treated in the following way: If the optimization or the (hysteresis) contrast is to be determined automatically, i.e., Parameters contains the value 'optimization' or 'contrast' ('contrast_hyst'), the values passed in Optimization and Contrast are ignored. In contrast, if the maximum number of pyramid levels or the minimum contrast is to be determined automatically, i.e., Parameters contains the value 'num_levels' or 'min_contrast', you can let HALCON determine suitable values and at the same time specify an upper or lower boundary, respectively:
请注意,在determine_shape_model_params中会出现一些也可以自动确定的参数(NumLevels、Optimization、Contrast、MinContrast)。如果这些参数不应自动确定,即未在参数中传递其名称,则相应的参数必须包含有效值,并且不得设置为“auto”。相反,如果要自动确定这些参数,则按以下方式处理其值:如果要自动确定优化或(滞后)对比度,即参数包含值“优化”或“对比度”(“contrast_hyst”),则忽略在优化和对比度中传递的值。相反,如果要自动确定金字塔级别的最大数量或最小对比度,即参数包含值“num_levels”或“min_contrast”,则可以让 HALCON 确定合适的值,同时分别指定上限或下限:
If the maximum number of pyramid levels should be specified in advance, NumLevels can be set to the particular value. If in this case Parameters contains the value 'num_levels', the computed number of pyramid levels is at most NumLevels. If NumLevels is set to 'auto' (or 0 for backwards compatibility), the number of pyramid levels is determined without restrictions as large as possible.
如果应提前指定金字塔级别的最大数量,则可以将 NumLevels 设置为特定值。如果在本例中 Parameters 包含值“num_levels”,则计算出的金字塔级别数最多为 NumLevels。如果 NumLevels 设置为“auto”(或 0 表示向后兼容),则确定金字塔级别的数量,而不受尽可能大的限制。
If the minimum contrast should be specified in advance, MinContrast can be set to the particular value. If in this case Parameters contains the value 'min_contrast', the computed minimum contrast is at least MinContrast. If MinContrast is set to 'auto', the minimum contrast is determined without restrictions.
如果应提前指定最小对比度,则可以将 MinContrast 设置为特定值。如果在本例中 Parameters 包含值“min_contrast”,则计算出的最小对比度至少为 MinContrast。如果 MinContrast 设置为“auto”,则无限制地确定最小对比度。
::determine_shape_model_params (ImageReduced, 'auto', -0.39, 0.79, 0.9, 1.1, 'auto', 'use_polarity', 'auto', 'auto', 'all', ParameterName, ParameterValue)
标签:parameters,Parameters,shape,params,determine,参数,model,contrast From: https://www.cnblogs.com/echo-efun/p/18072680