Hello all,
I used a chessboard calibration procedure to obtain a camera matrix using OpenCV and python based on this tutorial: http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html
I ran through the sample code on that page and was able to reproduce their results with the chessboard pictures in the OpenCV folder to get a camera matrix.
I then tried the same procedure with my own checkerboard grid and camera, and I obtained the following matrix:
mtx = [1535 0 638 0 1536 204 0 0 1]
I am trying to better understand these results, based on the camera sensor and lens I am using.
Based on: http://ksimek.github.io/2013/08/13/intrinsic/
Fx = fx * W/w
Fx = focal length in mm W = sensor width in mm w = image width in pixels fx = focal length in pixels
The size of my images: 1264 x 512 (width x height) I am using the following lens: http://www.edmundoptics.com/imaging/imaging-lenses/edmund-optics-designed-lenses/megapixel-finite-conjugate-video-imaging-lenses/58203/
This has focal length 8 mm.
I am using a FL3-U3-13Y3 camera from PtGrey (https://www.ptgrey.com/flea3-13-mp-mono-usb3-vision-vita-1300-camera), which has an image width of 12 mm, according to this picture:
From the camera matrix, fx is the element in the first row, first column. So above, fx = 1535. In short:
fx = 1535 pixels (from camera matrix I obtained) w = 1264 pixels (image size I set) W = 12 mm (from datasheet) Fx = 8 mm (from datasheet)
Using: Fx = fx * W/w, we would expect Fx = 1535 * 12 / 1264 = 14.57 mm
But the actual lens is 8 mm. Why the discrepancy?
I would think that the actual size of a chess grid would have to be known, but I did not see mention of manipulation of that in the tutorial link I provided. I basically had to scale down the chessboard grid so that it would work with my camera setup.
I would appreciate any help or insight on this.
Thanks in advance,
Mehdi