Pixel per square foot

I read about the pixel on the foot, but can someone teach me how I can calculate the pixel on the foot? If you set the resolution to 640 (horizontal) x 480 (vertical), the lens range is 2.8 to 12 mm, distance = 16 feet (about 5 meters) and the pixel per foot is?

Is anyone

+4
source share
2 answers

I think I understand what you mean - you want to calculate how wide the image is in real units?

If you know the angle of the field of view f and the distance to the target d , you can calculate the width w plane visible at this distance with a small number of triggers.

  <------------------w--------------------> ***************************************** * ^ * <-----o------> * * | * * * | * * * | * * * | * * * | * * * | * * * d * * * | * * * | * * * | * * * | * * * | * f/2 * * | * * * | * * * v * * * * * * * * *** * 

So, remember the old school SOH CAH TOA? tan(angle) = opposite / adjacent . We want to calculate the opposite dimension o , and we know that it is adjacent d , and the angle is f/2 , so we get o = tan(f/2) * d

o is half the width, so we double it to give the final calculation w = d * tan(f/2) * 2

So, now you know the real-time width w units of measurement of the plane d from the camera, and you know that your image is p pixels wide, a pixel per unit is just p/w

The only problem that remains is to calculate the field of view angle f from the focal length of the lens - which is a bit more specialized. It depends on the camera, in particular on the size of the image sensor. You can create a chart for many popular cameras here http://www.howardedin.com/articles/fov.html .

If you know the size of the image sensor or use film negatives of 36 mm x 24 mm, you can use this formula to calculate the FOV for a β€œnormal” rectilinear lens:

 fieldOfView = 2 * arctan (sensorWidth / (2 * focalLength)) 
+6
source

The easiest way is to actually take a picture of a 1-foot ruler and open it in an image editing program and count the number of pixels from one end to the other.

+1
source

Source: https://habr.com/ru/post/1402632/


All Articles