Friday, February 19, 2010

Camera Calibration using MATLAB toolbox

Camera Calibration


The camera calibration toolbox of MATLAB downloaded from
http://www.vision.caltech.edu/bouguetj/calib_doc/ is an easier was of calibrating the camera.

It has an interface, which makes things easier.

But first several images of the grid oriented in different directions were taken. Shown below are the 16 images of the grid. In each image, the camera is fixed and the grid is moved.

Figure 1. Grid images.

The images in the folder must be named in sequence, for example DSC1.jpg, DSC2.jpg, DSC3.jpg, and so on. To input the images, click the button [Image names].

Figure 2. Calibration toolbox interface

The images are read by the program. The corners of the grid are selected one by one. A window showing the grid is displayed. The inner corners of the grid are selected, because the outer corners might be damaged.

Figure 3. Corner selection window.

The corners are selected starting from the upper left, clockwise. The GUI will ask for the dimension of the boxes in the grid. For this grid, each box is 1 inch wide and 1 inch long.

The corners are then extracted by the toolbox (use [Extract grid corners] button), and are labeled in the image (Figure 4).


Figure 4. Corners are extracted.

This is done for the rest of the images. You must be careful not to make any mistake. Otherwise, you will have to do this all over again, starting from the image input process. (This is most frustrating when you are in the last few images)

After the corners are extracted for all the images (in this case 16), the camera can now be calibrated. Click the button [Calibration]. The intrinsic parameters of the camera is now calculated by the program. Shown in Figure 5 is the output of the program.



Figure 5. Intrinsic camera parameters.

We have now calculated for the intrinsic parameters of the camera, such as focal length, principal point, skew, etc.

The extrinsic parameters can also be measured (click [Show extrinsic] button). The camera centered view or fixed-camera view is displayed (Figure 6). Here, the different orientations of the grid as captured by the camera is projected.


Figure 6. Extrinsic parameter (camera-centered)

Figure 7 shows the extrinsic parameters (world-centered). Here, the different locations of the camera is projected, as seen by the grid. This is basically the same as in Figure 6, because location is relative.


Figure 7. Extrinsic parameter (world-centered).


The camera was calibrated using the Camera Calibration Toolbox in Matlab. For more detailed instructions, refer to this link: http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/example.html

I give myself 10 points for this activity. I was able to get the intrinsic parameters the camera using the toolbox.



0 comments:

Post a Comment