best_match_rotT_best_match_rotBestMatchRotBestMatchRotbest_match_rot最佳匹配旋转(算子)

名称

best_match_rotT_best_match_rotBestMatchRotBestMatchRotbest_match_rot — 通过旋转搜索模板和图像的最佳匹配。

警告

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

签名

best_match_rot(Image : : TemplateID, AngleStart, AngleExtend, MaxError, SubPixel : Row, Column, Angle, Error)

Herror T_best_match_rot(const Hobject Image, const Htuple TemplateID, const Htuple AngleStart, const Htuple AngleExtend, const Htuple MaxError, const Htuple SubPixel, Htuple* Row, Htuple* Column, Htuple* Angle, Htuple* Error)

void BestMatchRot(const HObject& Image, const HTuple& TemplateID, const HTuple& AngleStart, const HTuple& AngleExtend, const HTuple& MaxError, const HTuple& SubPixel, HTuple* Row, HTuple* Column, HTuple* Angle, HTuple* Error)

void HTemplate::BestMatchRot(const HImage& Image, double AngleStart, double AngleExtend, double MaxError, const HString& SubPixel, HTuple* Row, HTuple* Column, HTuple* Angle, HTuple* Error) const

void HTemplate::BestMatchRot(const HImage& Image, double AngleStart, double AngleExtend, double MaxError, const HString& SubPixel, double* Row, double* Column, double* Angle, double* Error) const

void HTemplate::BestMatchRot(const HImage& Image, double AngleStart, double AngleExtend, double MaxError, const char* SubPixel, double* Row, double* Column, double* Angle, double* Error) const

void HTemplate::BestMatchRot(const HImage& Image, double AngleStart, double AngleExtend, double MaxError, const wchar_t* SubPixel, double* Row, double* Column, double* Angle, double* Error) const   ( Windows only)

void HImage::BestMatchRot(const HTemplate& TemplateID, double AngleStart, double AngleExtend, double MaxError, const HString& SubPixel, HTuple* Row, HTuple* Column, HTuple* Angle, HTuple* Error) const

void HImage::BestMatchRot(const HTemplate& TemplateID, double AngleStart, double AngleExtend, double MaxError, const HString& SubPixel, double* Row, double* Column, double* Angle, double* Error) const

void HImage::BestMatchRot(const HTemplate& TemplateID, double AngleStart, double AngleExtend, double MaxError, const char* SubPixel, double* Row, double* Column, double* Angle, double* Error) const

void HImage::BestMatchRot(const HTemplate& TemplateID, double AngleStart, double AngleExtend, double MaxError, const wchar_t* SubPixel, double* Row, double* Column, double* Angle, double* Error) const   ( Windows only)

static void HOperatorSet.BestMatchRot(HObject image, HTuple templateID, HTuple angleStart, HTuple angleExtend, HTuple maxError, HTuple subPixel, out HTuple row, out HTuple column, out HTuple angle, out HTuple error)

void HTemplate.BestMatchRot(HImage image, double angleStart, double angleExtend, double maxError, string subPixel, out HTuple row, out HTuple column, out HTuple angle, out HTuple error)

void HTemplate.BestMatchRot(HImage image, double angleStart, double angleExtend, double maxError, string subPixel, out double row, out double column, out double angle, out double error)

void HImage.BestMatchRot(HTemplate templateID, double angleStart, double angleExtend, double maxError, string subPixel, out HTuple row, out HTuple column, out HTuple angle, out HTuple error)

void HImage.BestMatchRot(HTemplate templateID, double angleStart, double angleExtend, double maxError, string subPixel, out double row, out double column, out double angle, out double error)

def best_match_rot(image: HObject, template_id: HHandle, angle_start: float, angle_extend: float, max_error: float, sub_pixel: str) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

def best_match_rot_s(image: HObject, template_id: HHandle, angle_start: float, angle_extend: float, max_error: float, sub_pixel: str) -> Tuple[float, float, float, float]

描述

算子 best_match_rotbest_match_rotBestMatchRotBestMatchRotBestMatchRotbest_match_rotTemplateIDTemplateIDTemplateIDTemplateIDtemplateIDtemplate_id 模板与 ImageImageImageImageimageimage 图像进行匹配。其工作原理类似于 best_matchbest_matchBestMatchBestMatchBestMatchbest_match,但扩展了模式旋转功能。参数 AngleStartAngleStartAngleStartAngleStartangleStartangle_startAngleExtendAngleExtendAngleExtendAngleExtendangleExtendangle_extend 定义了模式的最大旋转范围:AngleStartAngleStartAngleStartAngleStartangleStartangle_start 指定逆时针方向的最大旋转角度, AngleExtendAngleExtendAngleExtendAngleExtendangleExtendangle_extend 则指定相对于该角度的顺时针方向最大旋转角度。这两个值必须小于或等于创建模式时使用的值(参见 create_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRotCreateTemplateRotcreate_template_rot)。与 best_matchbest_matchBestMatchBestMatchBestMatchbest_match 不同,best_match_rotbest_match_rotBestMatchRotBestMatchRotBestMatchRotbest_match_rot 会额外返回模式的旋转角度 AngleAngleAngleAngleangleangle(单位:弧度)。该角度的精度取决于 create_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRotCreateTemplateRotcreate_template_rot 的参数 AngleStep。当 SubPixelSubPixelSubPixelSubPixelsubPixelsub_pixel = 'true'"true""true""true""true""true" 时,位置和角度将以“亚像素”精度进行计算。

执行信息

参数

ImageImageImageImageimageimage (输入对象)  singlechannelimage(-array) objectHImageHObjectHImageHobject (byte)

需要在其中查找模式的输入图像。

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

模板编号。

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

模式的最小旋转角度(弧度)。

默认值: -0.39

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

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

AngleStartAngleStartAngleStartAngleStartangleStartangle_start 的最大正向延伸。

默认值: 0.79

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

限制: AngleExtend > 0

MaxErrorMaxErrorMaxErrorMaxErrormaxErrormax_error (输入控制)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

灰度值的最大平均差值。

默认值: 30.0

建议值: 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 11.0, 15.0, 17.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0

值范围: 0 ≤ MaxError MaxError MaxError MaxError maxError max_error ≤ 255

最小增量: 1

建议增量: 3

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

当为 'true'"true""true""true""true""true" 时,实现亚像素级精度。

默认值: 'false' "false" "false" "false" "false" "false"

值列表: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

RowRowRowRowrowrow (输出控制)  point.y(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

最佳匹配的行位置。

ColumnColumnColumnColumncolumncolumn (输出控制)  point.x(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

最佳匹配的列位置。

AngleAngleAngleAngleangleangle (输出控制)  angle.rad(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

模式旋转角度(弧度)。

ErrorErrorErrorErrorerrorerror (输出控制)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

最佳匹配的灰度值平均差异。

结果

如果参数值正确,算子 best_match_rotbest_match_rotBestMatchRotBestMatchRotBestMatchRotbest_match_rot 返回值 2 ( H_MSG_TRUE )。当输入为空(没有可用输入图像)时,可设置行为通过算子 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的前趋

create_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRotCreateTemplateRotcreate_template_rot, read_templateread_templateReadTemplateReadTemplateReadTemplateread_template, set_offset_templateset_offset_templateSetOffsetTemplateSetOffsetTemplateSetOffsetTemplateset_offset_template, set_reference_templateset_reference_templateSetReferenceTemplateSetReferenceTemplateSetReferenceTemplateset_reference_template, adapt_templateadapt_templateAdaptTemplateAdaptTemplateAdaptTemplateadapt_template, draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region, draw_rectangle1draw_rectangle1DrawRectangle1DrawRectangle1DrawRectangle1draw_rectangle1, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain

替代

best_match_rot_mgbest_match_rot_mgBestMatchRotMgBestMatchRotMgBestMatchRotMgbest_match_rot_mg

另见

best_matchbest_matchBestMatchBestMatchBestMatchbest_match, best_match_mgbest_match_mgBestMatchMgBestMatchMgBestMatchMgbest_match_mg

模块

匹配