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 shows one of the typical computer vision problems. To solve this problem ClassifyRegions filter 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 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 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.

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

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