TemplateMatch
The TemplateMatch block finds the single highest matching area of a template image within a source image.
Library
ComputerVision/Images/Matching
Description
To find the matching area, the template image is moved over the source image one pixel at a time.
Output from the Template Match block is the resulting image and the x,y coordinates of the upper right corner of the matching area. You can also control whether the matching area is marked with a rectangle in the resulting image.
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
method | Method | SQDIFF: The best matches are low values. SQDIFF NORMED: The best matches are low values. TM CCORR: The best matches are high values. TM CCORR NORMED: The best matches are high values. TM COEFF: The best matches are high values. TM COEFF NORMED: The best matches are high values. | String | 'SQDIFF' |
externalActivation | External activation | This parameter defines if the block receives or inherits an external activation. When External Activation is used, an additional activation port is added to the block. Default is OFF. | Number | 0 |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
thickness | Thickness | Specifies the rectangle’s border thickness as an integer greater than 0. | Scalar | |
red | Red | Specifies the rectangle’s color as RGB values. | Scalar | |
green | Green | Specifies the rectangle’s color as RGB values. | Scalar | |
blue | Blue | Specifies the rectangle’s color as RGB values. | Scalar |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
src | explicit | input | 1 | |
template | explicit | input | 2 | |
x | explicit | output | 1 | |
y | explicit | output | 2 | |
image | explicit | output | 3 | |
Port 6 | activation | input | externalActivation |