🟧 Image Connected Component Analysis
Function Description
This operator performs connected component analysis on input binary images, identifying all independent white pixel regions (connected components) in the image. For each identified connected component, the operator can output its contour, center point, and independent mask image, and filter by area size.
Usage Scenarios
-
Object detection and segmentation: Separate each independent object instance and obtain their positions and contours.
-
Noise removal: Through area filtering, effectively remove small area noise points generated after binarization.
-
Defect detection: Detect scratches, stains, dents and other defects on product surfaces. Usually defects form independent connected regions after binarization.
Input Output
Input |
Binary Image: One or more binary images. |
Output |
Detection Results: A list of detection results, where each element represents a detected connected component, containing information such as the region’s contour, category, confidence score, etc. Result Center Point List: A list containing center point coordinates [x, y] of each identified connected component that passes area screening. Result Mask Images: Only when the parameter "Whether to Return Mask List" is enabled does this port output a list of binary images. Each image in the list corresponds to a detected connected component, where that region is white and the rest is black. |
Parameter Description
Result Type
Parameter Description |
Set how the contour of each detection object is represented. |
Parameter Adjustment |
|
Connected Component Type
Parameter Description |
Rules used in the image to determine which neighboring pixels are considered "connected". Common types are 4-connected and 8-connected. |
Parameter Adjustment |
|
Minimum Pixel Area
Parameter Description |
Set an area threshold where all connected components with pixel count (area) smaller than this value will be filtered out. |
Parameter Adjustment |
After binary processing, images often contain some tiny white spots caused by noise. By setting an appropriate minimum area, these meaningless noise points can be removed. When adjusting, observe the approximate pixel area of normal targets in the binary image and set this parameter to a value smaller than the smallest normal target but larger than most noise. For example, if normal targets all have areas above 200 pixels while noise points are mostly below 50 pixels, this value can be set to 100. |
Parameter Range |
[5, 400000], Default value: 100 |
Maximum Pixel Area
Parameter Description |
Set an area threshold where all connected components with pixel count (area) larger than this value will be filtered out. |
Parameter Adjustment |
This parameter can be used to exclude abnormally large area regions. For example, if due to lighting or improper threshold settings, most of the background is incorrectly identified as white regions, these can be filtered out through this parameter. Usually can be set to a value much larger than the maximum area that normal targets might have. |
Parameter Range |
[5, 4000000], Default value: 300000 |
Return Mask List
Parameter Description |
Control whether to generate and output an independent mask image for each detected connected component. |
Parameter Adjustment |
|