Skip to content

exhaustive_match_mgexhaustive_match_mgExhaustiveMatchMgExhaustiveMatchMgexhaustive_match_mgexhaustive_match_mgđź”—

Short descriptionđź”—

exhaustive_match_mgexhaustive_match_mgExhaustiveMatchMgExhaustiveMatchMgexhaustive_match_mgexhaustive_match_mg — Matching a template and an image in a resolution pyramid.

Signatuređź”—

exhaustive_match_mg( image Image, image ImageTemplate, out image ImageMatch, string Mode, integer Level, integer Threshold )exhaustive_match_mg( Image, ImageTemplate : ImageMatch : Mode, Level, Threshold : )void ExhaustiveMatchMg( const HObject& Image, const HObject& ImageTemplate, HObject* ImageMatch, const HTuple& Mode, const HTuple& Level, const HTuple& Threshold )static void HOperatorSet.ExhaustiveMatchMg( HObject image, HObject imageTemplate, out HObject imageMatch, HTuple mode, HTuple level, HTuple threshold )def exhaustive_match_mg( image: HObject, image_template: HObject, mode: str, level: int, threshold: int ) -> HObject

Herror exhaustive_match_mg( const Hobject Image, const Hobject ImageTemplate, Hobject* ImageMatch, const char* Mode, const Hlong Level, const Hlong Threshold )

Herror T_exhaustive_match_mg( const Hobject Image, const Hobject ImageTemplate, Hobject* ImageMatch, const Htuple Mode, const Htuple Level, const Htuple Threshold )

HImage HImage::ExhaustiveMatchMg( const HImage& ImageTemplate, const HString& Mode, Hlong Level, Hlong Threshold ) const

HImage HImage::ExhaustiveMatchMg( const HImage& ImageTemplate, const char* Mode, Hlong Level, Hlong Threshold ) const

HImage HImage::ExhaustiveMatchMg( const HImage& ImageTemplate, const wchar_t* Mode, Hlong Level, Hlong Threshold ) const (Windows only)

HImage HImage.ExhaustiveMatchMg( HImage imageTemplate, string mode, int level, int threshold )

Descriptionđź”—

The operator exhaustive_match_mgExhaustiveMatchMg is an additional option for the operator exhaustive_matchExhaustiveMatch performing a matching of the image Imageimageimage and the template ImageTemplateimageTemplateimage_template. Hereby ImageTemplateimageTemplateimage_template will be moved over all points of the region of Imageimageimage, a matching criterion will be calculated with regard to the parameter Modemodemode and the result values will be stored in ImageMatchimageMatchimage_match.

Of images having been filtered this way, normally only those areas with good matching results are of interest. The size of the area to be searched, i.e. the region of the input image Imageimageimage, determines decisively the runtime of the matching filter. Therefore it is recommendable to use at first exhaustive_match_mgExhaustiveMatchMg with reduced image resolution in order to determine a “region of interest” in which good matching results can be expected; then in this restricted area only the real matching (see also exhaustive_matchExhaustiveMatch) will be executed with normal resolution.

Hereby the Gauss-pyramids of Imageimageimage and ImageTemplateimageTemplateimage_template will be composed (in particular the corresponding regions will be transformed as well). Then on each level of the resolution pyramids - starting with the startlevel Levellevellevel - the matching inside the current “region of interest” will be executed. Whereby the “region of interest” on the startlevel is equivalent to the region of the input image Imageimageimage. After the filtering, a new “region of interest” is determined with the help of a threshold operation and will be transformed on the next resolution level:

      threshold(...:...:0,Threshold,...:),   if Mode = 'dfd'
      threshold(...:...:Threshold,255,...:), if Mode = 'norm_correlation'

The final matching in the determined “region of interest” will then be calculated with the highest resolution (Levellevellevel 0). The output image ImageMatchimageMatchimage_match includes the corresponding filter result and the final “region of interest”, which is determined on the result image with the help of a threshold operation.

The operator exhaustive_match_mgExhaustiveMatchMg therefore is not simply a filter, but can also be considered as a member of the class of region transformations.

Execution informationđź”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

Parametersđź”—

Imageimageimage (input_object) singlechannelimage(-array) → object (byte)object (byte)HObject (byte)HImage (byte)HObject (byte)Hobject (byte)

Input image.

ImageTemplateimageTemplateimage_template (input_object) singlechannelimage → object (byte)object (byte)HObject (byte)HImage (byte)HObject (byte)Hobject (byte)

The domain of this image will be matched with Imageimageimage.

ImageMatchimageMatchimage_match (output_object) image(-array) → object (byte)object (byte)HObject (byte)HImage (byte)HObject (byte)Hobject * (byte)

Result image and result region: values of the matching criterion within the determined “region of interest”.

Number of elements: ImageMatch == Image

Modemodemode (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Desired matching criterion.

Default: 'dfd'"dfd"
List of values: 'dfd', 'norm_correlation'"dfd", "norm_correlation"

Levellevellevel (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Startlevel in the resolution pyramid (highest resolution: Level 0).

Default: 11
Suggested values: 0, 1, 2, 3, 4, 5, 6, 7, 80, 1, 2, 3, 4, 5, 6, 7, 8
Restriction: Level <= ld(width(Image)) && Level <= ld(height(Image)) && Level <= ld(width(ImageTemplate)) && Level <= ld(height(ImageTemplate))

Thresholdthresholdthreshold (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Threshold to determine the “region of interest”.

Default: 3030
Suggested values: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245, 2505, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245, 250
Value range: 0 ≤ Threshold ≤ 255
Minimum increment: 1
Recommended increment: 5

Exampleđź”—

(C)

read_image(&Image,"monkey")\;
disp_image(Image,WindowHandle)\;
draw_rectangle2(WindowHandle,&Row,&Column,&Phi,&Length1,&Length2)\;
gen_rectangle2(&Rectangle,Row,Column,Phi,Length1,Length2)\;
reduce_domain(Image,Rectangle,&Template)\;
exhaustive_match_mg(Image,Template,&ImageMatch,'dfd'1,30)\;
invert_image(ImageMatch,&ImageInvert)\;
local_max(ImageInvert,&BestFit)\;
disp_region(BestFit,WindowHandle)\;

Resultđź”—

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

Combinations with other operatorsđź”—

Combinations

Possible predecessors

draw_regionDrawRegion, draw_rectangle1DrawRectangle1

Possible successors

thresholdThreshold, local_maxLocalMax

Alternatives

exhaustive_matchExhaustiveMatch

See also

gen_gauss_pyramidGenGaussPyramid

Moduleđź”—

Foundation