Circumference Measurement
Last updated
Was this helpful?
Last updated
Was this helpful?
You can measure an object's several features such as width, height, and circumference using AugeLab Studio's native function blocks.
In this example, will separate an object from its background and measure its area, width, and height.
First, Use Load Image block and load paper.jpg from the example images folder.
With and adjusting Hue, Saturation, and Values we'll try to separate the calculator from the background:
Contours are polygons that consist of several points on the 2D image space. Using contours, you can calculate their circumference, center point, angle, etc. However, the contours themselves do not contain information about their width and height since they are polygons with an unknown number of edges.
Calculated width, height, and area do not represent real-life units. They represent the number of pixels. In order to convert them to metric units, you'll need a constant to convert from pixel to unit length.
You may run the scenario one step everytime you adjust the sliders in HSV Filter block to see differen outputs. To understand what does HSV mean, refer to documentation.
You may use or other pre-processing blocks to ease out random noise from images. However, it's always better to keep preprocessing to minimum when dealing with measurements.
Now that have successfully separated the outline of object from the background, we can use and to extract the shape of our object. Add these blocks to the scenario accordingly and tweak with slider values:
Calculating width and height would require block. Combining this with Find Contour we'll be able to calculate width, height, and area:
There you have it! This tutorial have shown you how to calculate the area, width, and height of an object by the separation method. You may check other methods to work with different shapes.