Skip to content

Conversation

@cal-pratt
Copy link
Contributor

Before running a chessboard calibration, images are down-sampled to speed up the calculation process. After the initial estimates are found, the points are scaled, and fixed to proper image corners using cornerSubPix method. This keeps error low while increasing calibration time greatly.

@cal-pratt
Copy link
Contributor Author

I was noticing a large amount of pixel error after running larger scales. This is because large jumps in scales can cause a larger error to be propagated into the final image, making the subpixel correction algorithm fail. A single jump to original resolution causes large pixel errors:
image

To reduce the error, the image is gradually scaled to proper size, running the subpixel correction algorithm iteratively on larger images:

image

This in turn creates far less rms error in the final projection.

Before iterative solution:

scale 1
calibrateCameraRmsError: 0.28
INFO: cameraMatrix = {
    { 2425.728384975679, 0.0, 1336.8598231006679, },
    { 0.0, 2433.2315978304923, 971.5522263984041, },
    { 0.0, 0.0, 1.0, },
}; 

scale 2 
calibrateCameraRmsError: 0.4
INFO: cameraMatrix = {
    { 2420.7773012863013, 0.0, 1343.5666398362293, },
    { 0.0, 2428.060191585721, 959.0764544347993, },
    { 0.0, 0.0, 1.0, },
}; 

scale 5
calibrateCameraRmsError: 2.27
INFO: cameraMatrix = {
    { 2413.637540967931, 0.0, 1341.4026027457041, },
    { 0.0, 2410.52816873944, 951.5685457494493, },
    { 0.0, 0.0, 1.0, },
}; 

After iterative solution:


scale 1
calibrateCameraRmsError: 0.282
cameraMatrix = {
    { 2425.728384975679, 0.0, 1336.8598231006679, },
    { 0.0, 2433.2315978304923, 971.5522263984041, },
    { 0.0, 0.0, 1.0, },
}; 0.28 rms

scale: 1.8
calibrateCameraRmsError: 0.284
cameraMatrix = {
    { 2425.731155347157, 0.0, 1336.8592156109237, },
    { 0.0, 2433.234347855433, 971.5502012742322, },
    { 0.0, 0.0, 1.0, },
};

scale: 2.5
calibrateCameraRmsError: 0.295
cameraMatrix = {
    { 2420.777955568642, 0.0, 1343.5665168042763, },
    { 0.0, 2428.0608312564236, 959.0759604057756, },
    { 0.0, 0.0, 1.0, },
};

@cal-pratt cal-pratt merged commit 17ebd81 into master Jun 16, 2017
@cal-pratt cal-pratt deleted the sub-pix branch June 16, 2017 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants