ClassesClassesClassesClasses | | | | Operators

best_matchbest_matchBestMatchbest_matchBestMatchBestMatch (Operator)

Name

best_matchbest_matchBestMatchbest_matchBestMatchBestMatch — Searching the best matching of a template and an image.

Warning

best_matchbest_matchBestMatchbest_matchBestMatchBestMatch is obsolete and is only provided for reasons of backward compatibility. New applications should use the shape-based or NCC-based operators instead.

Signature

best_match(Image : : TemplateID, MaxError, SubPixel : Row, Column, Error)

Herror best_match(const Hobject Image, const Hlong TemplateID, double MaxError, const char* SubPixel, double* Row, double* Column, double* Error)

Herror T_best_match(const Hobject Image, const Htuple TemplateID, const Htuple MaxError, const Htuple SubPixel, Htuple* Row, Htuple* Column, Htuple* Error)

Herror best_match(Hobject Image, const HTuple& TemplateID, const HTuple& MaxError, const HTuple& SubPixel, double* Row, double* Column, double* Error)

Herror best_match(Hobject Image, const HTuple& TemplateID, const HTuple& MaxError, const HTuple& SubPixel, HTuple* Row, HTuple* Column, HTuple* Error)

double HImage::BestMatch(const HTemplate& TemplateID, const HTuple& MaxError, const HTuple& SubPixel, double* Column, double* Error) const

HTuple HImageArray::BestMatch(const HTemplate& TemplateID, const HTuple& MaxError, const HTuple& SubPixel, HTuple* Column, HTuple* Error) const

HTuple HTemplate::BestMatch(const HImageArray& Image, const HTuple& MaxError, const HTuple& SubPixel, HTuple* Column, HTuple* Error) const

void BestMatch(const HObject& Image, const HTuple& TemplateID, const HTuple& MaxError, const HTuple& SubPixel, HTuple* Row, HTuple* Column, HTuple* Error)

void HTemplate::BestMatch(const HImage& Image, double MaxError, const HString& SubPixel, HTuple* Row, HTuple* Column, HTuple* Error) const

void HTemplate::BestMatch(const HImage& Image, double MaxError, const HString& SubPixel, double* Row, double* Column, double* Error) const

void HTemplate::BestMatch(const HImage& Image, double MaxError, const char* SubPixel, double* Row, double* Column, double* Error) const

void HImage::BestMatch(const HTemplate& TemplateID, double MaxError, const HString& SubPixel, HTuple* Row, HTuple* Column, HTuple* Error) const

void HImage::BestMatch(const HTemplate& TemplateID, double MaxError, const HString& SubPixel, double* Row, double* Column, double* Error) const

void HImage::BestMatch(const HTemplate& TemplateID, double MaxError, const char* SubPixel, double* Row, double* Column, double* Error) const

void HOperatorSetX.BestMatch(
[in] IHUntypedObjectX* Image, [in] VARIANT TemplateID, [in] VARIANT MaxError, [in] VARIANT SubPixel, [out] VARIANT* Row, [out] VARIANT* Column, [out] VARIANT* Error)

VARIANT HTemplateX.BestMatch(
[in] IHImageX* Image, [in] double MaxError, [in] BSTR SubPixel, [out] VARIANT* Column, [out] VARIANT* Error)

VARIANT HImageX.BestMatch(
[in] IHTemplateX* TemplateID, [in] double MaxError, [in] BSTR SubPixel, [out] VARIANT* Column, [out] VARIANT* Error)

static void HOperatorSet.BestMatch(HObject image, HTuple templateID, HTuple maxError, HTuple subPixel, out HTuple row, out HTuple column, out HTuple error)

void HTemplate.BestMatch(HImage image, double maxError, string subPixel, out HTuple row, out HTuple column, out HTuple error)

void HTemplate.BestMatch(HImage image, double maxError, string subPixel, out double row, out double column, out double error)

void HImage.BestMatch(HTemplate templateID, double maxError, string subPixel, out HTuple row, out HTuple column, out HTuple error)

void HImage.BestMatch(HTemplate templateID, double maxError, string subPixel, out double row, out double column, out double error)

Description

The operator best_matchbest_matchBestMatchbest_matchBestMatchBestMatch performs a matching of the template of TemplateIDTemplateIDTemplateIDTemplateIDTemplateIDtemplateID and ImageImageImageImageImageimage. Hereby the template will be moved over the points of ImageImageImageImageImageimage so that the template will lie always inside ImageImageImageImageImageimage. best_matchbest_matchBestMatchbest_matchBestMatchBestMatch works similar to fast_matchfast_matchFastMatchfast_matchFastMatchFastMatch, with the exception, that each time a better match is found the value of MaxErrorMaxErrorMaxErrorMaxErrorMaxErrormaxError is internally updated to a lower value to reduce runtime.

With regard to the parameter SubPixelSubPixelSubPixelSubPixelSubPixelsubPixel, the position will be indicated by subpixel accuracy. The matching criterion (“displaced frame difference”) is defined as follows:

The runtime of the operator depends 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 MaxErrorMaxErrorMaxErrorMaxErrorMaxErrormaxError determines the maximal error which the searched position is allowed to have at most. The lower this value is, the faster the operator runs.

RowRowRowRowRowrow and ColumnColumnColumnColumnColumncolumn return the position of the best match, whereby ErrorErrorErrorErrorErrorerror indicates the average difference of the grayvalues. If no position with an error below MaxErrorMaxErrorMaxErrorMaxErrorMaxErrormaxError was found the position (0,0) and a matching result of 255 for ErrorErrorErrorErrorErrorerror are returned. In this case MaxErrorMaxErrorMaxErrorMaxErrorMaxErrormaxError has to be set larger.

The maximum error of the position (without noise) is 0.1 pixel. The average error is 0.03 pixel.

Parallelization

Parameters

ImageImageImageImageImageimage (input_object)  singlechannelimage(-array) objectHImageHImageHImageHImageXHobject (byte)

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

TemplateIDTemplateIDTemplateIDTemplateIDTemplateIDtemplateID (input_control)  template HTemplate, HTupleHTupleHTemplate, HTupleHTemplateX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Template number.

MaxErrorMaxErrorMaxErrorMaxErrorMaxErrormaxError (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum average difference of the grayvalues.

Default value: 20.0

Suggested values: 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

Typical range of values: 0 ≤ MaxError MaxError MaxError MaxError MaxError maxError ≤ 255

Minimum increment: 1

Recommended increment: 3

SubPixelSubPixelSubPixelSubPixelSubPixelsubPixel (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Subpixel accuracy in case of 'true'"true""true""true""true""true".

Default value: 'false' "false" "false" "false" "false" "false"

List of values: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

RowRowRowRowRowrow (output_control)  point.y(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Row position of the best match.

ColumnColumnColumnColumnColumncolumn (output_control)  point.x(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Column position of the best match.

ErrorErrorErrorErrorErrorerror (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Average divergence of the grayvalues of the best match.

Result

If the parameter values are correct, the operator best_matchbest_matchBestMatchbest_matchBestMatchBestMatch returns the value 2 (H_MSG_TRUE). If the input is empty (no input images are available) the behaviour can be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

create_templatecreate_templateCreateTemplatecreate_templateCreateTemplateCreateTemplate, read_templateread_templateReadTemplateread_templateReadTemplateReadTemplate, set_offset_templateset_offset_templateSetOffsetTemplateset_offset_templateSetOffsetTemplateSetOffsetTemplate, set_reference_templateset_reference_templateSetReferenceTemplateset_reference_templateSetReferenceTemplateSetReferenceTemplate, adapt_templateadapt_templateAdaptTemplateadapt_templateAdaptTemplateAdaptTemplate, draw_regiondraw_regionDrawRegiondraw_regionDrawRegionDrawRegion, draw_rectangle1draw_rectangle1DrawRectangle1draw_rectangle1DrawRectangle1DrawRectangle1, reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain

Alternatives

fast_matchfast_matchFastMatchfast_matchFastMatchFastMatch, fast_match_mgfast_match_mgFastMatchMgfast_match_mgFastMatchMgFastMatchMg, best_match_mgbest_match_mgBestMatchMgbest_match_mgBestMatchMgBestMatchMg, best_match_pre_mgbest_match_pre_mgBestMatchPreMgbest_match_pre_mgBestMatchPreMgBestMatchPreMg, best_match_rotbest_match_rotBestMatchRotbest_match_rotBestMatchRotBestMatchRot, best_match_rot_mgbest_match_rot_mgBestMatchRotMgbest_match_rot_mgBestMatchRotMgBestMatchRotMg, exhaustive_matchexhaustive_matchExhaustiveMatchexhaustive_matchExhaustiveMatchExhaustiveMatch, exhaustive_match_mgexhaustive_match_mgExhaustiveMatchMgexhaustive_match_mgExhaustiveMatchMgExhaustiveMatchMg

Module

Matching


ClassesClassesClassesClasses | | | | Operators