create opencv camera matrix for iPhone 5 solvepnp

后端 未结 5 1178
春和景丽
春和景丽 2021-01-31 12:35

I am developing an application for the iPhone using opencv. I have to use the method solvePnPRansac:

http://opencv.willowgarage.com/documentation/cpp/camera_calibration_

5条回答
  •  囚心锁ツ
    2021-01-31 13:06

    The "focal length" you are dealing with here is simply a scaling factor from objects in the world to camera pixels, used in the pinhole camera model (Wikipedia link). That's why its units are pixels/unit length. For a given f, an object of size L at a distance (perpendicular to the camera) z, would be f*L/z pixels.

    So, you could estimate the focal length by placing an object of known size at a known distance of your camera and measuring its size in the image. You could aso assume the central point is the center of the image. You should definitely not ignore the lens distortion (dist_coef parameter in solvePnPRansac).

    In practice, the best way to obtain the camera matrix and distortion coefficients is to use a camera calibration tool. You can download and use the MRPT camera_calib software from this link, there's also a video tutorial here. If you use matlab, go for the Camera Calibration Toolbox.

提交回复
热议问题