How to achieve pixel level accuracy with camera calibration

asked 2018-07-18 14:21:13 -0500

jbrownkramer gravatar image

I am using OpenCV 2.4.11 to undistort the signal from a depth camera. It does a reasonable job, but I still notice that some straight edges do not appear as lines in the calibrated image. I would estimate that in the worst case, if I draw a line from one end of the straight edge to the other, I see a roughly 2 pixel deviation from the line in a 320x240 image. In my use case, this translates to 3 inches of error at the far operating range of my depth camera. I am looking to get 1 inch accuracy.

I have tried the checkerboard pattern and the asymmetric circles grid. I have found the asymmetric circles grid to produce much more correct and stable results, as well as better final distortion coefficients and camera matrices. I have used 40 images covering the FOV of the camera and at various poses. I tried using more, but at 90 images OpenCV consistently crashes (due to the debugging environment I am in, I can't currently say what is causing the crash).

Here is a picture with the original image and the undistorted image. Note that the bottom edge of the poster I am holding is straighter, but not completely straight in the undistorted image.

image description

Is this the best I can expect, or should I expect pixel-level accuracy? If I can do better, how can I do better?

Here is a folder with the calibration images and some ancilary files :

edit retag flag offensive close merge delete



Your calibration images look too similar. Try to acquire new images with better various pose, see for instance here or here for more information about the camera calibration process.

Also, more images do not mean automatically better accuracy. 20 to 40 calibration images should be enough.

Eduardo gravatar imageEduardo ( 2018-07-19 10:44:24 -0500 )edit

Thanks. I'll try that!

jbrownkramer gravatar imagejbrownkramer ( 2018-07-19 13:50:53 -0500 )edit

Your focus looks soft to my eyes, especially toward the edge of the image. Can you verify that you have crisp focus throughout the calibration volume?

opalmirror gravatar imageopalmirror ( 2018-07-19 17:47:36 -0500 )edit

There is an unavoidable small amount of blurring in the images.

jbrownkramer gravatar imagejbrownkramer ( 2018-07-23 09:31:33 -0500 )edit