-1

I’m making a camera calibration toolkit with OpenCV in C++. I’m using "calibrateCamera” and “undistort” functions from opencv2/calib3d. I get good results for two image set but I get terrible result for 5 image set. All image sets are good and has enough picture to calibrate camera.

here some of these image sets

For examle when I try my code with that image set I can find and draw corners of chessboard correctly but the other stuff are wrong. Distortion coefs are not true, the optical center of camera is negative so undistortion is weird.

chessboard corners

result

What do you think about problem?

Marek R
  • 32,568
  • 6
  • 55
  • 140
newww
  • 1
  • 1
  • Please be more specific. You described that something is wrong, but you didn't provide any information how to get this invalid result. Show some code, describe calibration algorithm. This is like coming to car mechanic without a car and saying "car doesn't move". – Marek R Jul 06 '21 at 14:25
  • 1
    Looks to me like the images where the calibration rectifies the image fairly well are the ones where the target occupies a larger part of the image (and the checkerboard is fairly central) compared to the ones which don't work so well where the checkerboard is to the side and small. Not surprising. – DisappointedByUnaccountableMod Jul 06 '21 at 14:33
  • you have my answer already, and it's from before you opened this question: https://forum.opencv.org/t/strange-calibration-result-failure/4192 – Christoph Rackwitz Jul 06 '21 at 17:03
  • I'm sorry @ChristophRackwitz if I made you upset. I just try to get different aspect because my coworker's Matlab calibration looks like more acurate. – newww Jul 07 '21 at 08:24

1 Answers1

0

I think you have a mistake. There are some differences between the 1st image sequence and the 2nd one. The images from the 1st sequence contain a wide area of the calibration pattern, but the images from the 2nd sequence don't. So, the information about camera distortion was insufficient, and the calibration function of openCV doesn't work properly.

pullidea-dev
  • 1,768
  • 1
  • 7
  • 23