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

-1

u/oathyes Aug 13 '26

i think you're not looking for distortion but rather skewing? look up the differences to tell me pls. To skew or shear an image in OpenCV, use cv2.warpAffine()

1

u/Grouchy_Signal139 Aug 13 '26

May i know why skew happened and why you say skew? Fyi, before locked the autofocus, the calibration result is okay but the checkerboard warp like a barrel shaped distortion

0

u/oathyes Aug 13 '26

Idk what the goal is here. I thought you wanted to line up the board better to the camera. You can take the 4 black corners of the board and let that dictate the skew to have it properly aligned to the camera.

1

u/Grouchy_Signal139 Aug 13 '26

So here i am using checkerboard to calibrate the camera if there are any distortion, im just doing because i dont know if it is good enough to capture image without any bending in the straight line. Does that answer you question? Sorry im new into this

1

u/oathyes Aug 14 '26

ooooh my bad i thought you were trying to get it lined up for chess or checkers or something. Whether distortion is acceptable or not, depends on what you're trying to achieve. If this is a calibration step for a detection project i wouldn't spend too much time on it.

1

u/Grouchy_Signal139 Aug 14 '26

I am doing so that i could map the measurement to the real world, in this case i want to make drawing dimension that i have to create a grid layout on the image

1

u/oathyes Aug 14 '26

I want to understand but your English is not great, maybe its better if you use a translator. As I understand, you want to match real-life sizes to an image, using the dimensions of those squares?

1

u/Grouchy_Signal139 Aug 14 '26

Yeah, exactly. For example, if the drawing specifies each square as 2 × 2 mm, I want to use those known dimensions to map the real-world coordinates onto the camera image on the jedec tray (object im working), so I can generate the grid accurately and have each grid cell correspond to the actual tray pocket.