by Beifang Yi
Direct Camera Calibration (using OpenCV's routines).
The code:
Usage:
- (I compiled and ran my program in RedHat8.0 and OpenCV0.9.4).
- After compiling, type: ./calibration <file-number>
.....
- (for example, if using 01, 03, 05, 07, 09 image/data-file, type: ./calibration
1 3 5 7 9), and following will be occurred:
[b_yi@chicken prg3]$ ./calibration 1 3 5 7 9
input file number for accuracy test ? 5
accuracy error: 97.1017
input file number for projection test ? 10
projection error : 125.508
- And also an image will be displayed and saved showing the original
tested image (given by the requested input) with green
cross at the estimated / given pixel location and red
cross at the computed pixel location (with the computed calibration
parameters). (For some locations which match so well that you
can only see either the red crosses or the green ones with the other
occluded.)
Results:
1. When using images 01, 03, 05, 07, 09:
- Accuracy test error (accumulated error for all the 96 points in one
image) for image 05 is : 97.1017.
- The parameters:
Extrinsic Parameters: rotation matrix:
0.685203 0.033461 -0.727583
-0.108544 -0.983098 -0.147433
-0.720219 0.179996 -0.66999
Extrinsic Parameters: translation vector:
-164.661
94.392
724.197
Intrinsic Parameters:
731.056 0 325.737
0 734.467 246.272
0 0 1
- And the effect can be seen in following image:
- Projection test error (accumulated also) for image
10 is: 125.508.
- The parameters (extrinsic only, intrinsic same as above):
Extrinsic Parameters: rotation matrix:
0.999711 0.000843717 -0.0240213
-0.0113629 -0.864067 -0.503249
-0.0211806 0.503376 -0.863808
Extrinsic Parameters: translation vector:
-159.31
78.8653
576.958
- And the effect can be seen in following image:
2. When using images 01, 02, 03, 04, 05, 06, 07, 08, 09:
- Accuracy test error (accumulated error for all the 96 points in one
image) for image 07 is : 122.602.
- The parameters:
Extrinsic Parameters: rotation matrix:
0.920533 -0.0161807 0.390329
0.0540686 -0.984249 -0.168314
0.386905 0.176043 -0.905159
Extrinsic Parameters: translation vector:
-142.245
69.0835
553.8
Intrinsic Parameters:
732.631 0 324.235
0 735.863 245.581
0 0 1
- And the effect can be seen in following image:
- Projection test error (accumulated also) for image image
15 is: 151.227.
- The parameters:
Extrinsic Parameters: rotation matrix:
0.981816 -0.162489 0.0981578
-0.186909 -0.917877 0.350096
0.03321 -0.362076 -0.931557
Extrinsic Parameters: translation vector:
-132.026
77.2353
702.764
- And the effect can be seen in following image:
Camera Calibration Using the Projection Matrix
Please see the member functions projMatInit()
and projMatCalibration(). Because
of lack of 3D object data file and corresponding image data file, no results
can be obtained.