2D Alignment
Description
This Step aligns the input image with the template through translation, rotation, and scaling to make them consistent.
Input and Output
Input
| Input Port | Data Type | Description |
|---|---|---|
Image |
Image |
Image used for template matching. |
Object Pose |
Pose2D |
The position and orientation of the matched objects in the image. |
Output
| Output Port | Data Type | Description |
|---|---|---|
Aligned Image |
Image |
The image after alignment. |
Matching Score |
Number |
Used to evaluate the match quality. |
Alignment Parameter Group |
Pose2D |
The translation, rotation, and scaling parameters required to align the matched object with the template. |
Object Pose |
Pose2D |
The position, orientation, and scale ratio of the aligned objects in the image. |
Object Bounding Box |
Shape2D/Rectangle |
Bounding box of the matched object, derived from the template bounding box based on the matching result. |
Parameter Description
| Parameter | Description |
|---|---|
ROI Settings |
The ROI is used to define the image area to be processed by the algorithm. Once this parameter is selected, the Step will only use the data in the ROI to match the template. |
Mask Settings |
For template matching, the system ignores the image regions covered by the masks. For the mask settings and adjustment methods, refer to ROI Settings. |
Template Settings
| Parameter | Description |
|---|---|
Select Template |
This parameter is used to specify the matching template. Click Open the editor to open 2D Template Editor, where you can edit the template for alignment. After specifying and saving the template, click ▼ and select the template in the drop-down menu. For instructions on how to use the editor, see 2D Template Editor. |
Matching Settings
Frequently Used Parameters
| Parameter | Description |
|---|---|
Edge Polarity Sensitive |
This parameter controls whether edge polarity must match the template. The polarity indicates the direction of intensity changes along the edges, e.g., light-to-dark or dark-to-light. If there is not a large disparity in the data acquisition scenarios, enable this option to ensure matching accuracy. If there is a large disparity, disable this option to enhance the matching generalization ability. Enabled by default. |
Min Matching Score |
This parameter is used to determine whether a matching result is valid. Any result whose score is below this value will be discarded. Default value: 50.0 |
Min Scale Ratio |
The minimum scale ratio of the target relative to the template. A narrower scale ratio range improves matching speed. Default value: 1.00 |
Max Scale Ratio |
The maximum scale ratio of the target relative to the template. A narrower scale ratio range improves matching speed. Default value: 1.00 |
Min Rotation Angle |
The minimum rotation angle of the target relative to the template. A narrower rotation angle range improves matching speed. Default value: -15° |
Max Rotation Angle |
The maximum rotation angle of the target relative to the template. A narrower rotation angle range improves matching speed. Default value: 15° |
|
Advanced Parameters
Parameter |
Description |
||
Min Valid Match Ratio |
The minimum ratio of valid matched edge points to the total number of edge points in the template. Default value: 50% |
||
Search Radius |
The radius of the circular search area for finding corresponding matching points of each template feature point in the target image during pose refinement. Default value: 8
|
||
Max Overlap Ratio |
Used to filter out duplicate matching results. If there is an overlap between two matching results and the overlap ratio exceeds this value, only the result with the higher matching score will be retained. Default value: 50% |
||
Padding Ratio |
Specifies the ratio of allowed padded size to template size when the target object may be partially outside the image. Padding can recover edge matches that would otherwise fail, but generally increases computation.
|
||
Edge Threshold Type |
How the edge threshold is set.
|
||
Edge Threshold |
Points with gradient magnitude greater than or equal to this value are considered edge features for template matching. This parameter is visible only when Edge Threshold Type is set to Custom threshold. |
||
Show Edge Points |
When enabled, the data visualization window displays the extracted edge points. This parameter is for visualization only and does not affect the processing result. |