1 | initial version |
Ok, I've been wracking my brain on this and I think I've finally solved it!
Tl;dr -- make sure the edges are well represented by the checkerboard in your calibration images.
The key is that the distortion is extreme at the edges, and my theory was that without good checkerboard representation at the edges, the edge distortion solution would not be very accurate. This seems to have fixed it. If you want some numbers for navel-gazing, here are my distCoeffs for two different calibration image sets: one close up, the other mostly far away.
Note: the coefficients are both positive and negative (meaning "moustache distortion" and not monotonic.) Note in particular the really big values for the far away images -- indicating severe edge distortion. My idea was that since distortion is mild in the center, if all my checkerboards are in the center, the distortion could solve in widely varying ways, subject to factors like roundoff error and such.
Looks like my theory is correct -- the coefficients and ROI converge nicely as I increase the images for the near images. Not quite so nice for the far ones.
Bonus ProTip (from Paul Debevec's PhD thesis, chapter 4) -- you can't do gamma correction (or any lightening) on calibration images, because this can shrink or expand the edges of white on black squares!
(k1, k2, p1, p2, k3 -- p is the center point of the distortion.)
Far:
Close: