Machine Vision DISCUSSION

How do I know whether my OpenCV camera calibration is good enough, and what RMS error is acceptable?

Started by sayali camera calibrationreprojection errorOpenCV calibrateCameralens distortioncheckerboard pattern
5 replies 248 views 6 participants
Latest activity · 30 Sep 2026

How do I know whether my OpenCV camera calibration is good enough, and what RMS error is acceptable?

sayali Machine Vision Forum
#1

I calibrated a camera with a printed checkerboard and cv2.calibrateCamera using 12 images. The function returns an RMS value of 1.8, and the undistorted image looks a little better than the original, but straight edges near the corners are still slightly curved.

What does the returned number mean, what value should I expect from a good calibration, and how can I check the result independently?

Community replies 5

Re: How do I know whether my OpenCV camera calibration is good enough, and what RMS error is acceptable?

#2

The returned value is the RMS reprojection error in pixels. After estimating the camera matrix, the distortion coefficients and the pose of the board in each image, the function projects the known board corners back into every image and compares them with the detected corner positions. The RMS of those distances is what you get.

For a reasonable lens and a careful calibration, values well under 1 pixel are normal, and below about 0.5 pixel is a good result. A value of 1.8 pixels says the model does not fit the data well, so the curved lines you still see are consistent with it.

Re: How do I know whether my OpenCV camera calibration is good enough, and what RMS error is acceptable?

#3

The usual causes of a high error are in the data, not the algorithm. A board printed on paper and taped to cardboard is not flat, and a small bow is visible in the result; glue the print to glass or a rigid plate. Measure the printed square size, since printers scale pages. Avoid motion blur and use sub-pixel corner refinement (cv2.cornerSubPix). Use a pattern with different numbers of inner corners in the two directions, such as 9 × 6, so its orientation is unambiguous.

Compute the error per image as well, and drop or retake the worst views; one blurred image can dominate the total.

Re: How do I know whether my OpenCV camera calibration is good enough, and what RMS error is acceptable?

#4

A low RMS alone does not prove a good calibration. If all images show the board in the centre and roughly facing the camera, the error can be small while the distortion at the edges is not constrained at all, which matches curved lines near the corners.

Take 15 to 25 views in which the board reaches all four corners and the edges of the image, at different distances, and tilted up to about 45 degrees in different directions. Tilt is what allows the focal length to be separated from the distance. Keep focus and zoom locked during and after calibration, because changing either changes the intrinsic parameters.

Re: How do I know whether my OpenCV camera calibration is good enough, and what RMS error is acceptable?

#5

Independent checks: first, undistort an image containing long straight edges near the borders (a ruler, a door frame) and fit a line to the edge points; the residual should be a fraction of a pixel. Second, hold back a few images, estimate the board pose in them with cv2.solvePnP using your calibration, and look at the reprojection error on those unseen views.

Also look at the numbers for plausibility. The principal point should be near the image centre, and fx and fy should be nearly equal for square pixels. You can predict fx: focal length divided by pixel size, so a 6 mm lens with 3 µm pixels should give about 2000 pixels.

Re: How do I know whether my OpenCV camera calibration is good enough, and what RMS error is acceptable?

#6

On the model: start with the default five distortion coefficients (k1, k2, p1, p2, k3). Adding the rational or thin-prism terms with only a dozen images tends to overfit, giving a lower RMS and worse behaviour at the edges.

For very wide lenses the standard model stops fitting, and the cv2.fisheye module is the appropriate one. If the distortion coefficients come out very large with alternating signs, that is a sign of overfitting rather than of a truly distorted lens.

TEP COMMUNITY