Straight lines that bow

A regular grid pushed through the distortion model a calibration actually estimates, with the corner displacement in pixels read out live. The overlay shows the corrected grid, which is the payoff calibration buys.

Try this

Move k1 negative for barrel, positive for pincushion, and note how little of the coefficient it takes to move a corner by ten pixels.

Try it: bend the lens

Where this lab comes from

Camera Models, End to End: K, the Extrinsics, Calibration & PnP, with OpenCV

How a 3-D point becomes a pixel and back again: the intrinsic matrix K, the extrinsics R|t that place the camera in the world, Zhang calibration to 0.35 px reprojection error, and solvePnP recovering a 68-px-off pose to ~0. The math, two interactive labs, and runnable OpenCV in Python and C++.

More in cameras and geometry