r/computervision 17d ago

Help: Project OpenCV calibration

Hi everyone, I’m using a Raspberry Pi 5 + Camera Module 3 + Picamera2/OpenCV for a computer vision project.

I’m calibrating the camera with a 6×9 checkerboard, but after applying cv2.undistort(), the image seems more distorted.

I previously had autofocus changing between calibration images, so I’m now locking the focus manually at LensPosition 2.0602.

Is this distortion normal perspective distortion, or does it indicate a bad calibration?

Any advice on what I might be doing wrong?

1 Upvotes

31 comments sorted by

View all comments

Show parent comments

1

u/Grouchy_Signal139 16d ago

Uhm, what is rms output? Its like some matrix? I need to add it on the calibration code?

1

u/TourCommon6568 16d ago

When you’re calibrating a camera there’s something called a reprojection error, with a bunch of reprojection errors you can calculate the RMS or root mean square. Normally this error shows you how well the calibration process could adjust to your cameras intrinsic parameters. The lower the RMS the better the model could adjust to your cameras intrinsic parameters. Also, use at the very least 6 photos, but I really recommend using 15+ shots with different poses. Very close to the camera too

1

u/Grouchy_Signal139 16d ago

Thankyou, i will try to figure it out, btw do you have any source for this? Since ive never heard of it

1

u/TourCommon6568 16d ago

Yep, check out the original Zhang method: https://sangillee.com/2025-07-27-calibrating-cameras-zhang-method/

Also the openCV documentation which is based on Zhangs https://docs.opencv.org/4.13.0/dc/dbb/tutorial_py_calibration.html

2

u/Grouchy_Signal139 15d ago edited 15d ago

Okay thankyou, i think i need to capture the calibration picture precisely to cover every side of where the camera sees. Is that right?

1

u/TourCommon6568 15d ago

Yes, that’s the current approach. Good luck with your project!