Ask Your Question
1

Measuring the Object dimensions using Graph

asked 2014-08-24 13:06:25 -0600

der.freiburger gravatar image

updated 2014-09-23 05:26:46 -0600

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.

Thanks in advance!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
4

answered 2014-08-25 01:50:04 -0600

updated 2014-08-25 09:56:45 -0600

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? image description

  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.

image description

  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.

image description

NOTE: This method can work only for object in a single Z-Plane(Depth).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-08-24 13:06:25 -0600

Seen: 2,908 times

Last updated: Sep 23 '14