Skip to content

Using lens distortion maps

Lens distortion maps let you create undistorted images without implementing the selected camera model in your own software.

Exporting maps

  1. Complete and review the calibration.
  2. Choose Calibration → Export Lens Distortion Maps.
  3. Choose a destination and wait for export to finish.

For each camera, Calib GEOM writes:

File Contents
camera_N_mapU.tiff Horizontal source-image coordinates
camera_N_mapV.tiff Vertical source-image coordinates
camera_N_K.json Camera matrix for the undistorted output

Keep all three files together. If you cancel an export, check that every required file was written before using it.

Using the maps

The maps tell a remapping function where to sample the original image for each output pixel. They contain absolute pixel coordinates, not offsets. The exported camera matrix describes the undistorted output image.

The libCalibGeom documentation includes map integration examples, including a Python example. libCalibGeom is a separate product and is not included with Calib GEOM. These map examples use OpenCV to read Calib GEOM's exports and do not require the libCalibGeom library at runtime.

The C++ example runs as:

distortion_maps exports/camera_0 image.png --output=undistorted.png
python distortion_maps.py exports/camera_0 image.png

Use the filename prefix, such as exports/camera_0, rather than the path to an individual map. The Python example writes image_undistorted.png. Your OpenCV installation must support float32 TIFF with Zstandard compression.

Check the usable image area

Pixels without a valid source location cannot supply image content. The examples display these areas as black; this does not mean the original scene was black there.

A pinhole output cannot preserve the entire field of view of every fisheye or omnidirectional camera. Check the useful output area for your lens. For non-central cameras, image remapping is not a replacement for full ray geometry at arbitrary depths; use unprojection maps when ray origins matter.