0

I would like to determine the camera matrix of a feed. The image is of width shape=(1440,2960) where 1440 is the height and 2960 is the width.

I would like to find the camera matrix for the same. I used the following calculation to find cx,cy

cx = shape[1]/2
cy = shape[0]/2

How do I find an approximate fx and fy? I tried to use shape[1] as my focal length but it doesn't seem to work for some reason :(

user1241241
  • 664
  • 5
  • 20

1 Answers1

1

As you mentioned, shape[1] is the width of your image. So you obviously can't use it as the focal length. There is no way to determine the focal length based on the image size alone. You either know the intrinsic parameters of your camera or you need to calibrate it. For more information, see the following docs: https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html https://docs.opencv.org/3.4/dc/dbb/tutorial_py_calibration.html

David Salb
  • 162
  • 1
  • 11
  • I'm following the same approach as here https://www.learnopencv.com/head-pose-estimation-using-opencv-and-dlib/ and they are assigning but for me it doesn't work :( – user1241241 May 14 '20 at 08:53