create_local_deformable_modelT_create_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModelcreate_local_deformable_model创建局部可变形模型(算子)
名称
create_local_deformable_modelT_create_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModelcreate_local_deformable_model — 创建可变形模型以进行局部可变形匹配。
签名
create_local_deformable_model(Template : : NumLevels, AngleStart, AngleExtent, AngleStep, ScaleRMin, ScaleRMax, ScaleRStep, ScaleCMin, ScaleCMax, ScaleCStep, Optimization, Metric, Contrast, MinContrast, GenParamName, GenParamValue : ModelID)
Herror T_create_local_deformable_model(const Hobject Template, const Htuple NumLevels, const Htuple AngleStart, const Htuple AngleExtent, const Htuple AngleStep, const Htuple ScaleRMin, const Htuple ScaleRMax, const Htuple ScaleRStep, const Htuple ScaleCMin, const Htuple ScaleCMax, const Htuple ScaleCStep, const Htuple Optimization, const Htuple Metric, const Htuple Contrast, const Htuple MinContrast, const Htuple GenParamName, const Htuple GenParamValue, Htuple* ModelID)
void CreateLocalDeformableModel(const HObject& Template, const HTuple& NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AngleStep, const HTuple& ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleRStep, const HTuple& ScaleCMin, const HTuple& ScaleCMax, const HTuple& ScaleCStep, const HTuple& Optimization, const HTuple& Metric, const HTuple& Contrast, const HTuple& MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* ModelID)
void HDeformableModel::CreateLocalDeformableModel(const HImage& Template, const HTuple& NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AngleStep, double ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, const HTuple& ScaleCStep, const HTuple& Optimization, const HString& Metric, const HTuple& Contrast, const HTuple& MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
void HDeformableModel::CreateLocalDeformableModel(const HImage& Template, Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const HString& Optimization, const HString& Metric, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
void HDeformableModel::CreateLocalDeformableModel(const HImage& Template, Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const char* Optimization, const char* Metric, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
void HDeformableModel::CreateLocalDeformableModel(const HImage& Template, Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const wchar_t* Optimization, const wchar_t* Metric, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
(
Windows only)
HDeformableModel HImage::CreateLocalDeformableModel(const HTuple& NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AngleStep, double ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, const HTuple& ScaleCStep, const HTuple& Optimization, const HString& Metric, const HTuple& Contrast, const HTuple& MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const
HDeformableModel HImage::CreateLocalDeformableModel(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const HString& Optimization, const HString& Metric, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const
HDeformableModel HImage::CreateLocalDeformableModel(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const char* Optimization, const char* Metric, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const
HDeformableModel HImage::CreateLocalDeformableModel(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const wchar_t* Optimization, const wchar_t* Metric, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const
(
Windows only)
static void HOperatorSet.CreateLocalDeformableModel(HObject template, HTuple numLevels, HTuple angleStart, HTuple angleExtent, HTuple angleStep, HTuple scaleRMin, HTuple scaleRMax, HTuple scaleRStep, HTuple scaleCMin, HTuple scaleCMax, HTuple scaleCStep, HTuple optimization, HTuple metric, HTuple contrast, HTuple minContrast, HTuple genParamName, HTuple genParamValue, out HTuple modelID)
void HDeformableModel.CreateLocalDeformableModel(HImage template, HTuple numLevels, HTuple angleStart, HTuple angleExtent, HTuple angleStep, double scaleRMin, HTuple scaleRMax, HTuple scaleRStep, double scaleCMin, HTuple scaleCMax, HTuple scaleCStep, HTuple optimization, string metric, HTuple contrast, HTuple minContrast, HTuple genParamName, HTuple genParamValue)
void HDeformableModel.CreateLocalDeformableModel(HImage template, int numLevels, HTuple angleStart, HTuple angleExtent, double angleStep, double scaleRMin, HTuple scaleRMax, double scaleRStep, double scaleCMin, HTuple scaleCMax, double scaleCStep, string optimization, string metric, HTuple contrast, int minContrast, HTuple genParamName, HTuple genParamValue)
HDeformableModel HImage.CreateLocalDeformableModel(HTuple numLevels, HTuple angleStart, HTuple angleExtent, HTuple angleStep, double scaleRMin, HTuple scaleRMax, HTuple scaleRStep, double scaleCMin, HTuple scaleCMax, HTuple scaleCStep, HTuple optimization, string metric, HTuple contrast, HTuple minContrast, HTuple genParamName, HTuple genParamValue)
HDeformableModel HImage.CreateLocalDeformableModel(int numLevels, HTuple angleStart, HTuple angleExtent, double angleStep, double scaleRMin, HTuple scaleRMax, double scaleRStep, double scaleCMin, HTuple scaleCMax, double scaleCStep, string optimization, string metric, HTuple contrast, int minContrast, HTuple genParamName, HTuple genParamValue)
def create_local_deformable_model(template: HObject, num_levels: Union[int, str], angle_start: Sequence[float], angle_extent: Sequence[float], angle_step: Union[float, str], scale_rmin: float, scale_rmax: Sequence[float], scale_rstep: Union[float, str], scale_cmin: float, scale_cmax: Sequence[float], scale_cstep: Union[float, str], optimization: MaybeSequence[str], metric: str, contrast: Sequence[Union[int, str]], min_contrast: Union[int, str], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[int, float, str]]) -> HHandle
描述
算子 create_local_deformable_modelcreate_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModelCreateLocalDeformableModelcreate_local_deformable_model 准备一个模板,该模板通过图像 TemplateTemplateTemplateTemplatetemplatetemplate 传递,作为用于局部可变形匹配的可变形模型。模型的 ROI 作为 TemplateTemplateTemplateTemplatetemplatetemplate 的域传递。
局部可变形匹配可用于检测因局部变形而扭曲的对象,估计变形量,并校正对象所在的图像区域。为区别于后续匹配方法,请参阅
“解决方案指南I” 中 “二维匹配” 一章。
如 create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model 所述,模型的原点(参考点)定义为模型图像 TemplateTemplateTemplateTemplatetemplatetemplate 域(区域)的重心。此外, TemplateTemplateTemplateTemplatetemplatetemplate 域的轴对齐包围矩形用于确定在
find_local_deformable_modelfind_local_deformable_modelFindLocalDeformableModelFindLocalDeformableModelFindLocalDeformableModelfind_local_deformable_model 调用中进行校正的搜索图像区域。
关于创建局部可变形模型所用参数的详细说明,请参阅
create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model 的描述。需注意,实际变形的参数需通过调用
find_local_deformable_modelfind_local_deformable_modelFindLocalDeformableModelFindLocalDeformableModelFindLocalDeformableModelfind_local_deformable_model 进行设置。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。
参数
TemplateTemplateTemplateTemplatetemplatetemplate (输入对象) (multichannel-)image → objectHImageHObjectHImageHobject (byte / uint2)
输入图像,其域将用于创建模型。
NumLevelsNumLevelsNumLevelsNumLevelsnumLevelsnum_levels (输入控制) integer → HTupleUnion[int, str]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)
金字塔层数的最大值。
默认值:
'auto'
"auto"
"auto"
"auto"
"auto"
"auto"
值列表:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 'auto'"auto""auto""auto""auto""auto"
AngleStartAngleStartAngleStartAngleStartangleStartangle_start (输入控制) angle.rad-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
此参数未使用。
默认值:
[]
AngleExtentAngleExtentAngleExtentAngleExtentangleExtentangle_extent (输入控制) angle.rad-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
此参数未使用。
默认值:
[]
AngleStepAngleStepAngleStepAngleStepangleStepangle_step (输入控制) angle.rad → HTupleUnion[float, str]HTupleHtuple (real / string) (double / string) (double / HString) (double / char*)
角度的步长(分辨率)。
默认值:
'auto'
"auto"
"auto"
"auto"
"auto"
"auto"
建议值:
'auto'"auto""auto""auto""auto""auto", 0.0175, 0.0349, 0.0524, 0.0698, 0.0873
限制:
AngleStep > 0 && AngleStep <= pi / 16
ScaleRMinScaleRMinScaleRMinScaleRMinscaleRMinscale_rmin (输入控制) number → HTuplefloatHTupleHtuple (real) (double) (double) (double)
模式在行方向上的最小缩放。
默认值:
1.0
建议值:
0.5, 0.6, 0.7, 0.8, 0.9, 1.0
限制:
ScaleRMin > 0
ScaleRMaxScaleRMaxScaleRMaxScaleRMaxscaleRMaxscale_rmax (输入控制) number-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
此参数未使用。
默认值:
[]
ScaleRStepScaleRStepScaleRStepScaleRStepscaleRStepscale_rstep (输入控制) number → HTupleUnion[float, str]HTupleHtuple (real / string) (double / string) (double / HString) (double / char*)
行方向的缩放步长(分辨率)。
默认值:
'auto'
"auto"
"auto"
"auto"
"auto"
"auto"
建议值:
'auto'"auto""auto""auto""auto""auto", 0.01, 0.02, 0.05, 0.1, 0.15, 0.2
限制:
ScaleRStep >= 0
ScaleCMinScaleCMinScaleCMinScaleCMinscaleCMinscale_cmin (输入控制) number → HTuplefloatHTupleHtuple (real) (double) (double) (double)
模式在列向的最小缩放。
默认值:
1.0
建议值:
0.5, 0.6, 0.7, 0.8, 0.9, 1.0
限制:
ScaleCMin > 0
ScaleCMaxScaleCMaxScaleCMaxScaleCMaxscaleCMaxscale_cmax (输入控制) number-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
此参数未使用。
默认值:
[]
ScaleCStepScaleCStepScaleCStepScaleCStepscaleCStepscale_cstep (输入控制) number → HTupleUnion[float, str]HTupleHtuple (real / string) (double / string) (double / HString) (double / char*)
列方向的缩放步长(分辨率)。
默认值:
'auto'
"auto"
"auto"
"auto"
"auto"
"auto"
建议值:
'auto'"auto""auto""auto""auto""auto", 0.01, 0.02, 0.05, 0.1, 0.15, 0.2
限制:
ScaleCStep >= 0
OptimizationOptimizationOptimizationOptimizationoptimizationoptimization (输入控制) string(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
用于生成模型的优化类型。
默认值:
'none'
"none"
"none"
"none"
"none"
"none"
值列表:
'auto'"auto""auto""auto""auto""auto", 'none'"none""none""none""none""none", 'point_reduction_high'"point_reduction_high""point_reduction_high""point_reduction_high""point_reduction_high""point_reduction_high", 'point_reduction_low'"point_reduction_low""point_reduction_low""point_reduction_low""point_reduction_low""point_reduction_low", 'point_reduction_medium'"point_reduction_medium""point_reduction_medium""point_reduction_medium""point_reduction_medium""point_reduction_medium"
MetricMetricMetricMetricmetricmetric (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
匹配指标。
默认值:
'use_polarity'
"use_polarity"
"use_polarity"
"use_polarity"
"use_polarity"
"use_polarity"
值列表:
'ignore_color_polarity'"ignore_color_polarity""ignore_color_polarity""ignore_color_polarity""ignore_color_polarity""ignore_color_polarity", 'ignore_global_polarity'"ignore_global_polarity""ignore_global_polarity""ignore_global_polarity""ignore_global_polarity""ignore_global_polarity", 'ignore_local_polarity'"ignore_local_polarity""ignore_local_polarity""ignore_local_polarity""ignore_local_polarity""ignore_local_polarity", 'ignore_part_polarity'"ignore_part_polarity""ignore_part_polarity""ignore_part_polarity""ignore_part_polarity""ignore_part_polarity", 'use_polarity'"use_polarity""use_polarity""use_polarity""use_polarity""use_polarity"
ContrastContrastContrastContrastcontrastcontrast (输入控制) number-array → HTupleSequence[Union[int, str]]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)
模板图像中对象对比度的阈值或迟滞阈值。
默认值:
'auto'
"auto"
"auto"
"auto"
"auto"
"auto"
建议值:
'auto'"auto""auto""auto""auto""auto", 10, 20, 30, 40, 60, 80, 100, 120, 140, 160
MinContrastMinContrastMinContrastMinContrastminContrastmin_contrast (输入控制) number → HTupleUnion[int, str]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)
搜索图像中对象的最小对比度。
默认值:
'auto'
"auto"
"auto"
"auto"
"auto"
"auto"
建议值:
'auto'"auto""auto""auto""auto""auto", 1, 2, 3, 5, 7, 10, 20, 30, 40
限制:
MinContrast < Contrast
GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (输入控制) string-array → HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
泛型参数的名称。
默认值:
[]
值列表:
[], 'min_size'"min_size""min_size""min_size""min_size""min_size", 'part_size'"part_size""part_size""part_size""part_size""part_size"
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (输入控制) integer-array → HTupleSequence[Union[int, float, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
泛型参数的值。
默认值:
[]
值列表:
[], 'big'"big""big""big""big""big", 'medium'"medium""medium""medium""medium""medium", 'small'"small""small""small""small""small"
ModelIDModelIDModelIDModelIDmodelIDmodel_id (输出控制) deformable_model → HDeformableModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
模型的句柄。
结果
如果参数有效,算子
create_local_deformable_modelcreate_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModelCreateLocalDeformableModelcreate_local_deformable_model 返回值 2 (H_MSG_TRUE)。如有必要,则抛出异常。
可能的前趋
determine_deformable_model_paramsdetermine_deformable_model_paramsDetermineDeformableModelParamsDetermineDeformableModelParamsDetermineDeformableModelParamsdetermine_deformable_model_params
可能的后继
set_deformable_model_originset_deformable_model_originSetDeformableModelOriginSetDeformableModelOriginSetDeformableModelOriginset_deformable_model_origin,
set_deformable_model_paramset_deformable_model_paramSetDeformableModelParamSetDeformableModelParamSetDeformableModelParamset_deformable_model_param,
get_deformable_model_contoursget_deformable_model_contoursGetDeformableModelContoursGetDeformableModelContoursGetDeformableModelContoursget_deformable_model_contours,
find_local_deformable_modelfind_local_deformable_modelFindLocalDeformableModelFindLocalDeformableModelFindLocalDeformableModelfind_local_deformable_model,
get_deformable_model_paramsget_deformable_model_paramsGetDeformableModelParamsGetDeformableModelParamsGetDeformableModelParamsget_deformable_model_params,
write_deformable_modelwrite_deformable_modelWriteDeformableModelWriteDeformableModelWriteDeformableModelwrite_deformable_model,
clear_deformable_modelclear_deformable_modelClearDeformableModelClearDeformableModelClearDeformableModelclear_deformable_model
替代
read_deformable_modelread_deformable_modelReadDeformableModelReadDeformableModelReadDeformableModelread_deformable_model
另见
create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model,
create_planar_calib_deformable_modelcreate_planar_calib_deformable_modelCreatePlanarCalibDeformableModelCreatePlanarCalibDeformableModelCreatePlanarCalibDeformableModelcreate_planar_calib_deformable_model
模块
匹配