2D Target Object Counting
Function
This Step is used to detect and count target objects in an image using 2D template matching. It compares the objects in the image with the template, automatically counts the number of matches, and determines whether the count falls within the specified range.
Input and Output
Input
| Input port | Data type | Description |
|---|---|---|
Image |
Image |
Image to be inspected. |
2D Alignment Parameter Group |
Pose2D |
Used to adjust the ROI’s pose in sync with the target object’s pose changes. |
Output
| Output port | Data type | Description |
|---|---|---|
Count Judgment Result |
String |
Used to indicate whether the number of matching results is within the specified range, OK or NG. |
Count Check |
Bool |
Used to indicate whether the match count falls within the specified range. True indicates the count meets the requirement, and false indicates it does not. |
Matching Score |
Number[] |
Used to evaluate the match quality. |
Match Count |
Number |
The number of matching results. |
Parameter Description
| Parameter | Description |
|---|---|
ROI Setting |
Parameter description: This parameter is used to limit the image processing area. When ROI is not set, the Step processes the entire image.
|
Mask Setting |
Parameter description: This parameter is used to set one or more masks so that image areas covered by the masks are ignored during matching.
|
Template Settings
| Parameter | Description |
|---|---|
Select Template |
Parameter description: This parameter is used to set the matching template.
|
Matching Settings
| Parameter | Description | ||
|---|---|---|---|
Edge Polarity Sensitive |
Parameter description: 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.
|
||
Min Matching Score |
Parameter description: This parameter is used to determine whether a matching result is valid. Any result whose score is below this value will be discarded.
|
||
Valid Matching Threshold |
Parameter description: In the target image, points with gradient magnitudes greater than or equal to this threshold are considered valid edge points and participate in matching score calculation.
|
||
Min Valid Match Ratio |
Parameter description: The minimum ratio of valid matched edge points to the total number of edge points in the template.
|
||
Search Radius |
Parameter description: 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 |
Parameter description: This parameter is 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.
|
||
Padding Ratio |
Parameter description: This parameter 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.
Default value: 0% |
Count Threshold Settings
| Parameter | Description |
|---|---|
Min Number of Matching Results |
Parameter description: This parameter is used to specify the minimum expected number of matching results. If the actual number of matching results is less than this value, the result is judged as NG.
|
Max Number of Matching Results |
Parameter description: This parameter is used to specify the maximum allowed number of matching results. If the actual number of matching results is greater than this value, the result is judged as NG.
|