You are here: Start » Tutorial Exercises » Classify the Mounts (classify_mounts)

Classify the Mounts (classify_mounts)


Devise an algorithm that finds damaged mounts by analyzing the areas of blobs.


A single image with a set of mounts in it.

The input image is stored in classify_mounts directory.


A set of regions which contains only damaged mounts.


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 (FIS)

  1. Add LoadImage filter to ACQUIRE section to get an image from the input directory.

  2. To extract objects from the image add ThresholdToRegion filter to PROCESS section, set the value of inMaxValue to 128 and inMinValue to Auto.

  3. To split a single region into separate objects use SplitRegionIntoBlobs filter. The output of this filter is an array of regions called Blobs.

  4. 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.

  5. Add CreateHistogram filter with the value of inBinSize set to 25. The image below shows the distribution of region areas.

  6. Connect outValues of ClassifyRegions filter to inArray of CreateHistogram filter.

    The image below shows preview windows configured to analyze the mounts' areas.

  7. Now the project can be executed. To find the boundary value of accepted area use outHistogram output of CreateHistogram filter.

  8. Set inMaximum value of ClassifyRegions to 2000.

Video Tutorial

Main macrofilter uses the Blob Analysis technique to find damaged mounts.

Further Readings

  • Blob Analysis - Article presents detailed information about the Blob Analysis technique.