2D Target Object Counting
Function Description
This step detects and counts target workpieces in images through 2D template matching. By comparing workpiece features with templates, it automatically counts matched targets and determines whether counting results are qualified based on configured quantity range.
Input and Output
Input
| Input Port | Data Type | Description |
|---|---|---|
Image |
Image |
Image to be inspected. |
2D Alignment Parameter Group |
Pose2D |
Synchronously adjusts pose of target region according to pose transformation of target objects. |
Output
| Output Port | Data Type | Description |
|---|---|---|
Quantity Judgment Result |
String |
Used to determine whether the number of matching results is within expected range, OK or NG. |
Quantity Check |
Bool |
Indicates whether matching quantity meets expectations. |
Matching Score |
Number[] |
Used to evaluate quality of matching results. |
Number of Matching Results |
Number |
Number of matching results. |
Parameter Description
| Parameter | Description |
|---|---|
ROI Settings |
Description: Used to limit image-processing area. If ROI is not set, the step processes the entire image. Adjustment instruction: After clicking the icon, drag with the left mouse button in data-visualization area to draw an ROI of corresponding shape. |
Mask Settings |
Description: Used to set one or multiple masks so image regions covered by masks are ignored during matching. Adjustment instruction: After clicking the icon, add anchor points by left-clicking in data-visualization area to draw polygon masks. |
Template Settings
| Parameter | Description |
|---|---|
Select Template |
Description: Used to set matching template. Adjustment instruction: Open 2D Template Editor and edit templates used for matching in this tool. After configuration is completed and template is saved, click ▼ and select a template from drop-down menu. Refer to 2D Matching Template Editor for usage details. |
Matching Settings
| Parameter | Description | ||
|---|---|---|---|
Edge Polarity Sensitive |
Description: Controls whether edge polarity must match the template during matching. Polarity indicates grayscale transition direction at edges, such as bright-to-dark or dark-to-bright. Default value: Enabled. Adjustment instruction: If data-acquisition conditions are consistent, enable this option to ensure matching accuracy; if differences are large, disable it to improve matching generalization. |
||
Minimum Matching Score |
Description: Used to determine whether matching results are valid. Results with matching scores lower than this value are discarded. Default value: 50.0. |
||
Valid Matching Threshold |
Description: In target images, points with gradient magnitude greater than or equal to this threshold are treated as valid edge points and participate in matching-score statistics. Default value: 10. |
||
Lower Limit of Valid Matching Ratio |
Description: Minimum ratio of validly matched edge points to total template edge points. Default value: 50%. |
||
Search Radius |
Description: During pose correction, this is the radius of circular search area allowed when searching corresponding matching points in target image for each template feature point. Default value: 8.
|
||
Upper Limit of Overlap Ratio |
Description: Used to filter duplicate matching results. When overlap ratio between two matching results exceeds this value, only the one with higher matching score is retained. Default value: 50%. |
||
Fill Ratio |
When the object to be matched may partially exceed image boundaries, this parameter specifies allowed fill size as a ratio of template size. Filling can improve edge-matching success rate but usually increases computation.
Default value: 0%. |
Quantity Threshold Settings
| Parameter | Description |
|---|---|
Lower Limit of Matching Result Quantity |
Description: Used to set expected minimum quantity of matching results. If actual quantity is lower than this value, result is judged as NG. Default value: 0. Adjustment instruction: Configure according to actual conditions. |
Upper Limit of Matching Result Quantity |
Description: Used to set maximum allowed quantity of matching results. If actual quantity is higher than this value, result is judged as NG. Default value: 9999. Adjustment instruction: Configure according to actual conditions. |