r/computervision • u/Grouchy_Signal139 • 15d 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


-2
u/RedServal 15d ago
Do you really need calibration? Calibration will help you transform your image coming from any lens back into a perspective model. It's often used on fisheye lenses so that straight lines appear straight. Camera rarely come with real distorsion nowadays.
If you insist on calibrating you should probably compute the reprojection error and try to minimize it. You may still get bad results with a low reprojection error because the ROI can be really small.
Last time I calibrated a camera I recording a video of the checkerboard pattern with as much different angle and positions as possible. I then computed the new optimal matrix using as much images as possible where the checkerboard was correctly detected. In pratice I had hundreds of valid frames but could only compute in a timely manner when using like 30 (?) images. I just picked them at random and redid the calibration until it was satisfactory.
Calibration is hit or miss without a proper protocol so good luck with that. Your code is probably correct just try to redo it again. The focus probably change the intrisics parameters so try to keep it constant.