Aurora Visio Studio TOP » Tutorial Exercises » Classify the Mounts (classify_mounts)
Classify the Mounts (classify_mounts)
Aim
Devise an algorithm that finds damaged mounts by analyzing the areas of blobs.
Input
A single image with a set of mounts in it.
The input image is stored in
classify_mounts
directory.
Output
A set of regions which contains only damaged mounts.
Hints
To solve this issue the Blob Analysis technique could be used. This exercise shows one of the typical computer vision problems. In order to extract the blobs from the background the ThresholdToRegion filter should be applied.
To extract a single region for each object use SplitRegionIntoBlobs filter. To get only the damaged blobs, consider using ClassifyRegions filter.
CreateHistogram filter may be helpful in finding the invalid object area.
Labeling connections is explained in this article.
Solution (AVS)
-
Add LoadImage filter to ACQUIRE section to get an image from the input directory.
-
To extract objects from the image add ThresholdToRegion filter to PROCESS section, set the value of inMaxValue to 128 and inMinValue to Auto.
-
To split a single region into separate objects use SplitRegionIntoBlobs filter. The output of this filter is an array of regions called Blobs.
-
To select damaged mounts use ClassifyRegions filter. Set inFeature to Area because it is the feature the comparison of the blobs will be based on.
-
Add CreateHistogram filter with the value of inBinSize set to 25. The image below shows the distribution of region areas.
-
Connect outValues of ClassifyRegions filter to inArray of CreateHistogram filter.
The image below shows preview windows configured to analyze the mounts' areas.
-
Now the project can be executed. To find the boundary value of accepted area use outHistogram output of CreateHistogram filter.
-
Set inMaximum value of ClassifyRegions to 2000.
Main macrofilter uses the Blob Analysis technique to find damaged mounts.
その他の資料
- Blob Analysis - Article presents detailed information about the Blob Analysis technique.