You are on page 1of 4

In this project we are going to calibrate the camera.

The material employed is


the camera of iPhone 5S and the code given Caltech.
First nine picture were taken with the phone. Then the program calib_gui.m was
run. The pictures had to be in the same folder as the programs.
The first step is to enter the name of the images followed by the extension. In my
case it was IMG and jpeg. This was the window that I obtained.
Calibration images

Figure 1 Loading the Images into Matlab

It must be said that all the pictures (average of 2 Mbytes size) were loaded into
the RAM since the computer has an 8 GB RAM.
Once the images were loaded the next was to extract the grid corners. I choose
to process all the images and the windows size in my case was 26. I do believe
that this related to the size of the picture. Also the program asked whether to
determine the number of squares automatically or manually. I choose the
automatic system. Finally, we had to determine dX and dY which is also
proportional to the size of picture. In my case was 100mm.
This what the corner extraction looked like:

Figure 2 Corner Calibration

And finally after calibrating all the images the program will return the last image

Figure 3Last step of extracting the corners

Also it must be said that the program in each picture will ask about the
distortion. In my case there wasnt any.
Then the final step was to hit the calibration button menu and all these
parameters will show up in the command window:

Aspect ratio optimized (est_aspect_ratio = 1) -> both components of fc


are estimated (DEFAULT).
Principal point optimized (center_optim=1) - (DEFAULT). To reject
principal point, set center_optim=0
Skew not optimized (est_alpha=0) - (DEFAULT)
Distortion not fully estimated (defined by the variable est_dist):
Sixth order distortion not estimated (est_dist(5)=0) - (DEFAULT) .
Initialization of the principal point at the center of the image.
Initialization of the intrinsic parameters using the vanishing points of
planar patterns.

Initialization of the intrinsic parameters - Number of images: 9

Calibration parameters after initialization:

Focal Length:

fc = [ 2883.61223

2883.61223 ]

Principal point:

cc = [ 1631.50000

1223.50000 ]

Skew:
degrees

alpha_c = [ 0.00000 ]

Distortion:
]

kc = [ 0.00000

=> angle of pixel = 90.00000

0.00000

0.00000

0.00000

0.00000

Main calibration optimization procedure - Number of images: 9


Gradient descent iterations:
1...2...3...4...5...6...7...8...9...10...11...12...13...14...15...16...17...18...19
...20...21...done
Estimation of uncertainties...done

Calibration results after optimization (with uncertainties):

Focal Length:
32.12366 ]

fc = [ 2874.49085

2904.04750 ] [ 27.56335

Principal point:
36.36125 ]

cc = [ 1671.20525

1177.53083 ] [ 54.77791

Skew:
alpha_c = [ 0.00000 ] [ 0.00000 ]
axes = 90.00000 0.00000 degrees

=> angle of pixel

Distortion:
kc = [ 0.16748 -0.20452 -0.00824 0.00460
0.00000 ] [ 0.03892 0.15696 0.00605 0.00970 0.00000 ]
Pixel error:

err = [ 1.28021

2.69688 ]

Note: The numerical errors are approximately three times the standard
deviations (for reference).
I re did the calibration again with the same pictures but this time there was some
distortion. The reason is that I clicked on the wrong spot for the corner and the
program was able to correct it.

You might also like