fast_matchT_fast_matchFastMatchFastMatchfast_match (算子)

名称

fast_matchT_fast_matchFastMatchFastMatchfast_match — 搜索模板和图像的所有匹配项。

警告

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

签名

fast_match(Image : Matches : TemplateID, MaxError : )

Herror T_fast_match(const Hobject Image, Hobject* Matches, const Htuple TemplateID, const Htuple MaxError)

void FastMatch(const HObject& Image, HObject* Matches, const HTuple& TemplateID, const HTuple& MaxError)

HRegion HTemplate::FastMatch(const HImage& Image, double MaxError) const

HRegion HImage::FastMatch(const HTemplate& TemplateID, double MaxError) const

static void HOperatorSet.FastMatch(HObject image, out HObject matches, HTuple templateID, HTuple maxError)

HRegion HTemplate.FastMatch(HImage image, double maxError)

HRegion HImage.FastMatch(HTemplate templateID, double maxError)

def fast_match(image: HObject, template_id: HHandle, max_error: float) -> HObject

描述

算子 fast_matchfast_matchFastMatchFastMatchFastMatchfast_match performs a matching of the template of TemplateIDTemplateIDTemplateIDTemplateIDtemplateIDtemplate_id and ImageImageImageImageimageimage. Hereby the template will be moved over the points of ImageImageImageImageimageimage so that the template always lies completely inside of ImageImageImageImageimageimage. The matching criterion (“displaced frame difference”) is defined as follows: The difference between fast_matchfast_matchFastMatchFastMatchFastMatchfast_match and exhaustive_matchexhaustive_matchExhaustiveMatchExhaustiveMatchExhaustiveMatchexhaustive_match is that the matching for one position is stopped if the error is too high. This leads to a reduced runtime but one might miss correct matches. The runtime of the operator depends mainly on the size of the domain of ImageImageImageImageimageimage. Therefore it is important to restrict the domain as far as possible, i.e. to apply the operator only in a very confined “region of interest”. The parameter MaxErrorMaxErrorMaxErrorMaxErrormaxErrormax_error determines the maximal error which the searched position is allowed to show. The lower this value is, the faster the operator runs.

All points which show a matching error smaller than MaxErrorMaxErrorMaxErrorMaxErrormaxErrormax_error will be returned in the output region MatchesMatchesMatchesMatchesmatchesmatches. This region can be used for further processing. For example by using a connection and best_matchbest_matchBestMatchBestMatchBestMatchbest_match to find all the matching objects. If no point has a match error below MaxErrorMaxErrorMaxErrorMaxErrormaxErrormax_error the empty region (i.e no points) is returned.

执行信息

参数

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

Input image inside of which the pattern has to be found.

MatchesMatchesMatchesMatchesmatchesmatches (输出对象)  region(-array) objectHRegionHObjectHRegionHobject *

All points whose error lies below a certain threshold.

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

模板编号。

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

Maximal average difference of the gray values.

默认值: 20.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

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

最小增量: 1

建议增量: 1

结果

如果参数值正确,算子 fast_matchfast_matchFastMatchFastMatchFastMatchfast_match 返回值 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_templatecreate_templateCreateTemplateCreateTemplateCreateTemplatecreate_template, read_templateread_templateReadTemplateReadTemplateReadTemplateread_template, adapt_templateadapt_templateAdaptTemplateAdaptTemplateAdaptTemplateadapt_template, draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region, draw_rectangle1draw_rectangle1DrawRectangle1DrawRectangle1DrawRectangle1draw_rectangle1, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain

可能的后继

connectionconnectionConnectionConnectionConnectionconnection, best_matchbest_matchBestMatchBestMatchBestMatchbest_match

替代

best_matchbest_matchBestMatchBestMatchBestMatchbest_match, best_match_mgbest_match_mgBestMatchMgBestMatchMgBestMatchMgbest_match_mg, fast_match_mgfast_match_mgFastMatchMgFastMatchMgFastMatchMgfast_match_mg, exhaustive_matchexhaustive_matchExhaustiveMatchExhaustiveMatchExhaustiveMatchexhaustive_match, exhaustive_match_mgexhaustive_match_mgExhaustiveMatchMgExhaustiveMatchMgExhaustiveMatchMgexhaustive_match_mg

模块

匹配