You are here: Start » 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 in RegionArray which contains only damaged mounts.

Hints

To solve this problem the Blob Analysis technique should be used. This exercise show one of the typical computer vision problems. To solve this problem filter ClassifyRegions should be used.

To extract objects from the background ThresholdToRegion filter can be used.

To extract a single region for each object use SplitRegionIntoBlobs filter.

CreateHistogram filter may be helpful in finding the invalid object area.

Solution (AVS)

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

  2. To extract objects from the image use ThresholdToRegion filter with the value of inMaxValue set to 128 and inMinValue set to Auto.

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

  4. To select damaged mounts use ClassifyRegions filters. Set inFeature to Area.

  5. To visualize data use CreateHistogram filter with the value of inBinSize set to 25. The image below shows the distribution of region areas.

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

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

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

  8. Set inMaximum value of ClassifyRegions to 2000.

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