You are here: Start » Program Examples » Mounts (Blob Analysis)
Mounts (Blob Analysis)
Aim:
The task is to detect mounts and divide them into OK/NG parts.
Input:
An image of mounts. The position of the objects is variable. Some of the objects are damaged.
Output:
The marked mounts divided into OK and NG objects.
Hints:
The location of the object is variable. To find the object, the Blob Analysis technique can be used.
To separate OK and NG parts, compare each found blob's area to the good template value. You can use a formula.
Use the RegionBoundingCircle and the DrawCircles_TwoColors to mark OK and NG items.
Solution (AVS):
-
In Workspace Explorer, open the workspace Examples, and in the Filmstrip window, select the Mounts dataset. Drag the Image channel to the ACQUIRE section.
-
Add the ExtractBlobs_Intensity filter to locate the mounts. Disable the inProcessingParams HoleThreshold. The value should be Auto.
-
Add the formula with the outIsOK output:
outIsOK = area(inRegion) >= inMinOkArea
- Connect the outRegion output from the previous filter to the formula inRegion input.
- Set the inMinOkArea input's value to 2250.
-
Add the RegionBoundingCircle and connect its input with the ExtractBlobs_Intensity output.
-
Add the DrawCircles_TwoColors:
- Connect its inImage input to the ReadFilmstrip output.
- Connect the inCircles input to the RegionBoundingCircle output.
- Connect the inConditions input to the formula output.
- Set the inDrawingStyle Thickness to 2.
-
Now the final output of the whole program should be the image with the OK parts marked in green and the NG parts marked in red.
Video Tutorial
Please check the the video tutorial on our YouTube channel:
Macrofilter Main
Used Filters
Icon | Name | Description |
---|---|---|
![]() |
DrawCircles_TwoColors | Usually: green or red for pass/fail status. |
![]() |
ExtractBlobs_Intensity | Segments an image into blobs by thresholding using a single value. |
![]() |
RegionBoundingCircle | Computes the smallest circle enclosing a region. |
Further Readings
- Blob Analysis - Article presents detailed information about the Blob Analysis technique.