create_template_rotT_create_template_rotCreateTemplateRotCreateTemplateRotcreate_template_rot (算子)

名称

create_template_rotT_create_template_rotCreateTemplateRotCreateTemplateRotcreate_template_rot — 准备旋转模板匹配的模式。

警告

create_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRotCreateTemplateRotcreate_template_rot 已过时,仅出于向后兼容性考虑而保留。新应用程序应改用基于形状或基于 NCC 的算子。

签名

create_template_rot(Template : : NumLevel, AngleStart, AngleExtend, AngleStep, Optimize, GrayValues : TemplateID)

Herror T_create_template_rot(const Hobject Template, const Htuple NumLevel, const Htuple AngleStart, const Htuple AngleExtend, const Htuple AngleStep, const Htuple Optimize, const Htuple GrayValues, Htuple* TemplateID)

void CreateTemplateRot(const HObject& Template, const HTuple& NumLevel, const HTuple& AngleStart, const HTuple& AngleExtend, const HTuple& AngleStep, const HTuple& Optimize, const HTuple& GrayValues, HTuple* TemplateID)

void HTemplate::HTemplate(const HImage& Template, Hlong NumLevel, double AngleStart, double AngleExtend, double AngleStep, const HString& Optimize, const HString& GrayValues)

void HTemplate::HTemplate(const HImage& Template, Hlong NumLevel, double AngleStart, double AngleExtend, double AngleStep, const char* Optimize, const char* GrayValues)

void HTemplate::HTemplate(const HImage& Template, Hlong NumLevel, double AngleStart, double AngleExtend, double AngleStep, const wchar_t* Optimize, const wchar_t* GrayValues)   ( Windows only)

void HTemplate::CreateTemplateRot(const HImage& Template, Hlong NumLevel, double AngleStart, double AngleExtend, double AngleStep, const HString& Optimize, const HString& GrayValues)

void HTemplate::CreateTemplateRot(const HImage& Template, Hlong NumLevel, double AngleStart, double AngleExtend, double AngleStep, const char* Optimize, const char* GrayValues)

void HTemplate::CreateTemplateRot(const HImage& Template, Hlong NumLevel, double AngleStart, double AngleExtend, double AngleStep, const wchar_t* Optimize, const wchar_t* GrayValues)   ( Windows only)

HTemplate HImage::CreateTemplateRot(Hlong NumLevel, double AngleStart, double AngleExtend, double AngleStep, const HString& Optimize, const HString& GrayValues) const

HTemplate HImage::CreateTemplateRot(Hlong NumLevel, double AngleStart, double AngleExtend, double AngleStep, const char* Optimize, const char* GrayValues) const

HTemplate HImage::CreateTemplateRot(Hlong NumLevel, double AngleStart, double AngleExtend, double AngleStep, const wchar_t* Optimize, const wchar_t* GrayValues) const   ( Windows only)

static void HOperatorSet.CreateTemplateRot(HObject template, HTuple numLevel, HTuple angleStart, HTuple angleExtend, HTuple angleStep, HTuple optimize, HTuple grayValues, out HTuple templateID)

public HTemplate(HImage template, int numLevel, double angleStart, double angleExtend, double angleStep, string optimize, string grayValues)

void HTemplate.CreateTemplateRot(HImage template, int numLevel, double angleStart, double angleExtend, double angleStep, string optimize, string grayValues)

HTemplate HImage.CreateTemplateRot(int numLevel, double angleStart, double angleExtend, double angleStep, string optimize, string grayValues)

def create_template_rot(template: HObject, num_level: int, angle_start: float, angle_extend: float, angle_step: float, optimize: str, gray_values: str) -> HHandle

描述

算子 create_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRotCreateTemplateRotcreate_template_rot preprocesses a pattern, which is passed as an image, for the template matching. An extension to create_templatecreate_templateCreateTemplateCreateTemplateCreateTemplatecreate_template the matching can applied to rotated patterns. The parameters AngleStartAngleStartAngleStartAngleStartangleStartangle_start and AngleExtendAngleExtendAngleExtendAngleExtendangleExtendangle_extend define the maximum rotation of the pattern: AngleStartAngleStartAngleStartAngleStartangleStartangle_start specifies the maximum counter clockwise rotation and AngleExtendAngleExtendAngleExtendAngleExtendangleExtendangle_extend the maximum clockwise rotation relative to this angle. Therefore AngleExtendAngleExtendAngleExtendAngleExtendangleExtendangle_extend has to be smaller than . With the parameter AngleStepAngleStepAngleStepAngleStepangleStepangle_step the maximum angle resolution (on the highest resolution level) can be specified.

You have to be aware, that all possible rotations are calculated beforehand to reduce runtime during matching. This leads to a higher execution time for create_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRotCreateTemplateRotcreate_template_rot and high memory requirements for the template. The amount of memory depends on the parameters AngleExtendAngleExtendAngleExtendAngleExtendangleExtendangle_extend and AngleStepAngleStepAngleStepAngleStepangleStepangle_step. The number of pyramid levels can be neglected. If A is the number of pixels of TemplateTemplateTemplateTemplatetemplatetemplate, the memory M needed for the template in byte is about:

After the transformation, a number (TemplateIDTemplateIDTemplateIDTemplateIDtemplateIDtemplate_id) is assigned to the template for being used in the further process.

A description of the other parameters can be found at the operator create_templatecreate_templateCreateTemplateCreateTemplateCreateTemplatecreate_template

注意

You have to be aware, that depending on the resolution a large number of pre calculated patterns have to be created which might result in a large amount of memory needed.

执行信息

此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。

参数

TemplateTemplateTemplateTemplatetemplatetemplate (输入对象)  singlechannelimage objectHImageHObjectHImageHobject (byte)

Input image whose domain will be processed for the pattern matching.

NumLevelNumLevelNumLevelNumLevelnumLevelnum_level (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximal number of pyramid levels.

默认值: 4

值列表: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

AngleStartAngleStartAngleStartAngleStartangleStartangle_start (输入控制)  angle.rad HTuplefloatHTupleHtuple (real) (double) (double) (double)

Smallest Rotation of the pattern.

默认值: -0.39

建议值: -3.14, -1.57, -0.79, -0.39, -0.20, 0.0

AngleExtendAngleExtendAngleExtendAngleExtendangleExtendangle_extend (输入控制)  angle.rad HTuplefloatHTupleHtuple (real) (double) (double) (double)

Maximum positive Extension of AngleStartAngleStartAngleStartAngleStartangleStartangle_start

默认值: 0.79

建议值: 6.28, 3.14, 1.57, 0.79, 0.39

限制: AngleExtend > 0

AngleStepAngleStepAngleStepAngleStepangleStepangle_step (输入控制)  angle.rad HTuplefloatHTupleHtuple (real) (double) (double) (double)

Step rate (angle precision) of matching.

默认值: 0.0982

建议值: 0.3927, 0.1963, 0.0982, 0.0491, 0.0245

限制: AngleStep > 0

OptimizeOptimizeOptimizeOptimizeoptimizeoptimize (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Kind of optimizing.

默认值: 'sort' "sort" "sort" "sort" "sort" "sort"

值列表: 'none'"none""none""none""none""none", 'sort'"sort""sort""sort""sort""sort"

GrayValuesGrayValuesGrayValuesGrayValuesgrayValuesgray_values (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Kind of gray values.

默认值: 'original' "original" "original" "original" "original" "original"

值列表: 'gradient'"gradient""gradient""gradient""gradient""gradient", 'normalized'"normalized""normalized""normalized""normalized""normalized", 'original'"original""original""original""original""original", 'sobel'"sobel""sobel""sobel""sobel""sobel"

TemplateIDTemplateIDTemplateIDTemplateIDtemplateIDtemplate_id (输出控制)  template HTemplate, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

模板编号。

结果

如果参数有效,算子 create_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRotCreateTemplateRotcreate_template_rot 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的前趋

draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, thresholdthresholdThresholdThresholdThresholdthreshold

可能的后继

best_match_rotbest_match_rotBestMatchRotBestMatchRotBestMatchRotbest_match_rot, best_match_rot_mgbest_match_rot_mgBestMatchRotMgBestMatchRotMgBestMatchRotMgbest_match_rot_mg, adapt_templateadapt_templateAdaptTemplateAdaptTemplateAdaptTemplateadapt_template, set_reference_templateset_reference_templateSetReferenceTemplateSetReferenceTemplateSetReferenceTemplateset_reference_template, clear_templateclear_templateClearTemplateClearTemplateClearTemplateclear_template, set_offset_templateset_offset_templateSetOffsetTemplateSetOffsetTemplateSetOffsetTemplateset_offset_template, write_templatewrite_templateWriteTemplateWriteTemplateWriteTemplatewrite_template

替代

create_ncc_modelcreate_ncc_modelCreateNccModelCreateNccModelCreateNccModelcreate_ncc_model, create_templatecreate_templateCreateTemplateCreateTemplateCreateTemplatecreate_template

模块

匹配