Measuring an object from an image using a known object size

So what I need to do is measure the length of the leg from an image taken by a regular user. This image will contain a leg with a black toe, a coin (or other known dimensional object) and white paper (for example, A4), where the other two objects will be located. What do i already have? -I have already worked with opencv, but just with simple projects; -I have already started reading some articles on camera calibration ( "Learn OpenCv" ), but still do not know if I should go so far.

Now I need a certain orientation, because I still do not understand if I am solving this problem correctly. I have some questions: will I really need to calibrate the camera to get two or three foot measurements? How can I find the points of interest to me to measure the line, each picture represents a different picture, or are there methods to follow?

Ps: sorry for my English, I really need to improve it: - /

+4
source share
4 answers

Firstly, some things for obtaining images:

  • Can you count on a black sock and a white background? Colors do not matter, as is the high contrast between the sock and the background.
  • Can you standardize the viewing angle? Looking directly at the foot will reduce perspective distortion.
  • Can you standardize stage lighting? This will facilitate the processing described below.
  • Finally, you’ll get a more accurate estimate if you zoom in (or position the camera closer) so that the foot fills more of the image frame.

analysis. (Please note that this discussion will focus on your question about determining the axes of the foot. Identification and analysis of coins will use a similar process, but there will be some differences.)

Finally, I provided links to the older C interface. You can take a look at the new C ++ interface (I just didn’t manage to translate my code to 2.4)

+4
source

Antonio Criminisi probably wrote the last word on this subject many years ago. See His "Single View Metrology" and his Ph.D. dissertation, if you have the time.

+1
source

You do not need to calibrate the camera if your image has an object of a known size. Well ... at least if your camera is not too distorted, and if you do not expect high-quality measurements.

A simple approach would be to detect a white (perspective distorted) rectangle, map corners to an undistorted rectangle (using, for example, cv :: warpPerspective ()), and use the known size of this rectangle to determine the size of another object in the picture. But this only works for objects in the same plane as paper, preferably not too far from it.

0
source

I'm not sure if you need to build it yourself, but if you just need to do it, rather than encode it. You can use KLONK Image Measurement for this. There is a free and paid version.

0
source

All Articles