0
\$\begingroup\$

I am trying to measure the surface area of an object from an image taken by the ZED 2i camera. I have the pixel size information from the datasheet (found here).

Is it possible to accurately determine the surface area of an object using this pixel size or sensor size information? If so, could you please guide me on the best approach to achieve this?

Thank you for your help!

enter image description here

\$\endgroup\$
1
  • 1
    \$\begingroup\$ What research have you done regarding the near ad infinitum existing questions we have concerning this? \$\endgroup\$
    – Michael C
    Commented Jun 11 at 3:56

3 Answers 3

0
\$\begingroup\$

No, given only the sensor/pixel size it is not possible.

If you had accurate distance information you could (trigonometry). Or if there was something else of known size in the image you could (relative/comparative).

\$\endgroup\$
3
0
\$\begingroup\$

If it is a flat object, yes - with a bit of calibration. You need to know the distance, angle, sensor size, and focal length.

If it is an irregular object, photogrammetry can be used to create a 3D model from many images of the object taken at different view points. Software (free photogrammetry programs exist) is used to create a 3D model which can be imported in to a solid model manipulation program.

Edit with regards to the OP's comment:
The high school physics answer is to use the thin lens equation for field of view (FOV):

$$ FOV = {2 \times arctan \left({sensor\_size \over {2 \times f}} \right)} $$ Where:
\$sensor\_size\$ = some dimension of the sensor in mm. I like using the horizontal dimension.

\$f\$ = actual focal length of the lens in mm. Do not use the equivalent 35 mm focal length. This information can be found in the EXIF header of your image.

$$ pixel\_angle = {horizontal\_FOV \over number\_of\_horizontal\_pixels } $$

Determine the pixel dimensions of the object and multiply by the \$ pixel\_angle \$ to get the angular dimensions of your object.

A little bit of trigonometry assuming the object is centered: $$ size\_in\_mm = {2 \times distance\_in\_mm \times tan \left (angular\_dimension \over {2} \right)} $$

You'll probably find that this method gives quite a bit of error due to the focal length not being reported accurately; and; if focused closely the magnification factor will throw the apparent focal length off.

A better technique is to take a picture of a rectangle of known dimensions. From this, you can scale your unknown object to the reference image of the known rectangle.

You can also place a scale (ruler) in the image of your object and figure out what the dimensions are of your object from the reference scale (ruler). This is the technique I use since distance and focal length are not needed.

Notes on dimensioning from images:

  1. Use as large of a distance as possible to reduce perspective distortion and wide angle lens distortion. I generally shoot from a distance of about 10 x object_size if I need to meld images of an object in to a 2D drawing or figure out dimensions of an odd object that can't be readily measured with calipers.

  2. The object needs to be parallel to the sensor plane. If not parallel, you'll get keystoning which takes extra steps to correct.

  3. Use a lens with a minimal amount of distortion. I usually use a macro lens since macros generally have a flat field of view and very little distortion.

\$\endgroup\$
2
  • \$\begingroup\$ I have the distance, sensor size, and focal length. Could you please let me know how I can proceed? Thanks! \$\endgroup\$
    – code_lover
    Commented Jun 10 at 8:16
  • \$\begingroup\$ Please publish sensor size and focal length. \$\endgroup\$ Commented Jun 11 at 15:50
0
\$\begingroup\$

The easiest way to do this is to take images of something of known size to calibrate the pixels to distance. Perhaps a high quality steel ruler. For example let's say you image 10mm and it comes out to 200 pixels. then you know the calibration is 20 pixels per millimeter. You should do this separately for the horizontal and vertical directions just to make sure you don't have non-square pixels.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.