Loading [MathJax]/extensions/tex2jax.js

You are here: Start » Tutorial Exercises » Shape Fitting: Measuring holes (shape_fitting)

Shape Fitting: Measuring holes (shape_fitting)

Aim

Devise an algorithm that finds the radius of an inspected part.

Input

The set of images depicting a single element. The radius and the number of holes are variable.

Images are stored in shape_fitting directory.

Output

The calculated radius length.

Hints

The object under inspection is always located in a fixed position.

Use the FitCircleToEdges filter to find inner and outer borders of the inspected object. The sizes of circles in the image are variable. Take some margin for detection of the circle radius into account.

Calculate the radius of an element using the CircleToCircleDistance filter.

Labeling connections is explained in this article.

Solution (FIS)

►Click here to show the solution.

Additional Tasks

  • Calculate holes count using Blob analysis technique,
  • Calculate holes number using 1D Edge Detection technique.

Further Readings

  • 1D Edge Detection - The article explaining how edge detection filters work.
  • Blob Analysis - Article presents detailed information about the Blob Analysis technique.
  • Shape Fitting - This article presents usage of the Shape Fitting technique.