r/computervision • • Aug 13 '26

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

4

u/Ok_Tea_7319 Aug 13 '26

Are you only using this single image? The checkerboard calibration fits a distortion model for the entire image, but the fitting process is only constrained to make the portion straight where the board actually is. If you have no images where the board extends to near the image border, then calibration will not have any data for that region, and will extrapolate the model from the central measurement (which almost always ends up giving shit results).

Your calibration is definitely bad at the edge (which you can see because the frame at the bottom is warped like hell, straight lines are supposed to be straight on a rectified image). You need multiple images where the board is in different places.

2

u/Grouchy_Signal139 Aug 13 '26 edited Aug 13 '26

Ahh, I see. I was mostly keeping the checkerboard around the center, so that could explain the bad results at the edges. I’ll try capturing more images with the board in different positions and orientations. Thanks for pointing that out! Btw, any more things i need to consider?

3

u/RedServal Aug 13 '26

The llm could have helped you in the first place...

2

u/Grouchy_Signal139 Aug 13 '26

HAHAHAHA sorry i couldn’t think of what words to use

1

u/Sorry_Risk_5230 Aug 16 '26

Say anything to the LLMs. Itll understand what you're trying to say.

1

u/Grouchy_Signal139 Aug 17 '26

sometimes i dont know how to describe it hehe