0
$\begingroup$

I would like to position a camera around a scene to reproduce some perspective images. I was given the camera's extrinsics and intrinsics and my camera seems to be at the right position and facing in the right direction. However, the field of view (fov) of the camera seems off and I was able to get a similar fov as that of the perspective images by manually adjusting the focal length and sensor width parameters in Blender.

I was given xfov and yfov which are the half-angles of the horizontal and vertical fields of view of the camera in radians (the angle from the central ray to the leftmost/bottommost ray in the field of view) and the image dimension is 1280x720. I do not have information about the sensor width of the camera. How do I use this information to determine the correct values for the focal length and sensor width of my camera in Blender?

$\endgroup$
4
  • $\begingroup$ The combination of sensor size and the length of the lens, in mm, determine the field of view. If you don't have a sensor size , then use just the field of view instead of lens size, and set it to the value you need. Be aware that in blender the field of view is in degrees, not radians, so make the conversion accordingly. $\endgroup$ – no-can-do Aug 10 '20 at 7:14
  • $\begingroup$ Usually the camera matrix contains information on the center of the lens for x and y (in pixels or mm) you can also use that information to determine sensor size. $\endgroup$ – no-can-do Aug 10 '20 at 7:17
  • $\begingroup$ @no-can-do thanks for your reply. If I set the field of view (in degrees) instead of lens size, the field of view will still be affected by the sensor width which I don't have. Also, the camera intrinsic matrix has information about the center of the image (in pixels) which I believe is different from the center of the lens right? Can I use the center of the image to determine the sensor width? $\endgroup$ – Micael Tchapmi Aug 10 '20 at 16:38
  • $\begingroup$ I found what I was looking for from blender.stackexchange.com/a/40835/99643 . The following equations were helpful from that answer: sensor_width_in_mm = K[1,1]*K[0,2] / (K[0,0]*K[1,2]); s_u = resolution_x_in_px / sensor_width_in_mm; focal_length_in_mm = K[0,0] / s_u; $\endgroup$ – Micael Tchapmi Aug 10 '20 at 20:15
0
$\begingroup$

I found what I was looking for from https://blender.stackexchange.com/a/40835/99643 .

The following equations were helpful from that answer:

sensor_width_in_mm = $K[1,1]*K[0,2] / (K[0,0]*K[1,2])$
$s_u$ = resolution_$x$_in_px / sensor_width_in_mm
focal_length_in_mm = $K$[$0,0$] / $s_u$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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