exhaustive_match — Matching of a template and an image.
The operator exhaustive_match matches ImageTemplate and Image within the region of interest RegionOfInterest. Hereby the ImageTemplate will be moved over all points of Image which lie within the RegionOfInterest. With regard to the parameter Mode, a matching criterion will be calculated. The result values will be stored in ImageMatch.
The following matching criteria (Mode) are available:
Calculating the average "displaced frame difference":
To calculate the normalized correlation as well as the “displaced frame difference” is (with regard to the area of ImageTemplate) very time consuming. Therefore it is important to restrict the input region (RegionOfInterest if possible, i.e. to apply the filter only in a very confined “region of interest”.
As far as quality is concerned, both modes return comparable results, whereby the mode 'dfd' is faster by a factor of about 3.5.
Area to be searched in the input image.
Result image: values of the matching criterion.
Desired matching criterion.
Default value: 'dfd'
List of values: 'dfd', 'norm_correlation'
read_image(Image,'monkey') dev_display(Image) draw_rectangle2(WindowHandle,Row,Column,Phi,Length1,Length2) gen_rectangle2(Rectangle,Row,Column,Phi,Length1,Length2) reduce_domain(Image,Rectangle,Template) exhaustive_match(Image,Image,Template,ImageMatch,'dfd') invert_image(ImageMatch,ImageInvert) local_max(Image,Maxima) union1(Maxima,AllMaxima) add_channels(AllMaxima,ImageInvert,FitMaxima) threshold(FitMaxima,BestFit,230.0,255.0) dev_display(BestFit)
If the parameter values are correct, the operator exhaustive_match 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>). If necessary, an exception is raised.