# Measuring the Object dimensions using Graph Hi everybody,

is it possible to use OpenCV to detect an object on graph paper and get it's size by analyzing the lines and check where they are broken?

Maybe someone has a clue for me were to start.

edit retag close merge delete

Sort by » oldest newest most voted Hi der.freiburger!

Yes you can measure the approximate size of object in real world by using a reference graph. Provided that object is in constant distance from the camera.

here are the steps to measure the size of object:

1. How will you measure length of a line drawn in this picture? 2. You need a ruler as a reference. To make this ruler you have to know the real world ruler size which will be in pixels in our case.

3. Now make an graph. I'm gonna take a unit line as a reference graph. I'm taking centimeter scale as reference. 1. Place this graph in front of the camera & detect the Two red dots. Now calculate the number of pixels between this two points ref. Lets assume the distance is 1000 pixels. So 1 cm is taking 1000 pixels. So 1 pixel is equal to 0.1 cm & take this as a Reference_pixels_count.

2. Now place an object & find corners.Now cycle through each corner & find the distance between each corner. Multiply this distance with the Reference_pixels_count to get the actual dimension of the object. NOTE: This method can work only for object in a single Z-Plane(Depth).

more

Official site

GitHub

Wiki

Documentation