Shape Detector
This function block is designed to detect distinct shapes within a given input image. It provides a method to filter shapes based on various parameters, providing contours and area measurements for each detected shape.
📥 Inputs
Image This input accepts any image data in which shapes need to be detected.
📤 Outputs
Filtered Image An output image that shows the results of the shape detection process, including all detected contours.
Contoured Image This output highlights the detected shapes on the input image, providing visual feedback.
Border Coordinates The coordinates of the bounding rectangles around detected shapes, which can be used for further processing.
Center Positions The positions of the centers of the detected shapes.
Areas The area measurements of each detected shape, giving insight into the size of the shapes.
🕹️ Controls
Blur Coefficient A slider that allows you to adjust the amount of median blur applied to the input image before detection. This helps to reduce noise that might interfere with shape detection.
Auto Threshold A checkbox that enables the automatic calculation of the threshold values used for binary conversion of the image.
Threshold Range A range slider to manually set the threshold values for shape detection when the auto threshold is not selected.
Clear Spots Parameter A slider to set the size of the morphological kernel used for closing gaps between contours in the detected shapes.
🎨 Features
Shape Detection The block can identify and detect distinct shapes based on filtered input images.
Flexible Configuration Users can customize detection parameters such as blur amount, threshold values, and morphological features, resulting in tailored detection outcomes.
Visual Feedback Contours and centers of the detected shapes are visualized, providing immediate feedback on the detection results.
📝 Usage Instructions
- Connect Input: Link an image containing shapes to the - Imageinput of the block.
- Set Blur Coefficient: Adjust the - Blur Coefficientslider to control the amount of blur applied to reduce noise.
- Enable Auto Threshold (if desired): Check the - Auto Thresholdbox to automatically calculate the threshold values, or leave it unchecked to set them manually using the- Threshold Rangeslider.
- Set Clear Spots Parameter: Adjust the - Clear Spots Parameterto refine the morphological processing applied to the thresholded image.
- Run the Block: Evaluate the block to detect shapes and retrieve filtered images, contours, coordinates, and areas. 
📊 Evaluation
When executed, this function block performs shape detection on the input image based on the specified parameters and outputs the filtered image, contoured results, coordinates, center positions, and areas of all detected shapes.
💡 Tips and Tricks
🛠️ Troubleshooting
Last updated
Was this helpful?
