Skip to content

Update the camera calibration app with the visualization of the lens distortion#1918

Open
s-trinh wants to merge 6 commits intolagadic:masterfrom
s-trinh:feat_calib_tools_displacement_map
Open

Update the camera calibration app with the visualization of the lens distortion#1918
s-trinh wants to merge 6 commits intolagadic:masterfrom
s-trinh:feat_calib_tools_displacement_map

Conversation

@s-trinh
Copy link
Contributor

@s-trinh s-trinh commented Feb 27, 2026

The chessboard calibration pattern is obsolete since the whole board must be detected and it does not allow to have points at the extremities of the image, which is crucial for correct lens distortion modelling.

This is what would give a classical images acquisition:

mosaics_reproj_err_with_dist_0000

But this is what is fed to the calibration procedure:

calibration_pattern_occupancy

With the first image in background, to check that the pattern occupancy is correct:

calibration_pattern_occupancy2

Some alternatives that are widely used are:

See also the DLR CalDe for advices about the procedure (e.g. oblique images are crucial, big calibration board in the image, ...):

image image image image

Previous PR: #1063

Following are some results on ViSP and additional calibration images found on the Net.


./visp-calibrate-camera default-chessboard.cfg --save

  • calibration pattern occupancy:
calibration_pattern_occupancy
  • effect of the distortion
distortion_displacement_map
Calibration with distortion in progress on 13 images...
Camera parameters for perspective projection with distortion:
  px = 536.9845596	 py = 537.4212583
  u0 = 344.111272	 v0 = 235.1745174
  kud = -0.2672795888
  kdu = 0.308119637

Global reprojection error: 0.4341517859
  • mosaic of undistorted images
mosaics_undist_0000

./visp-calibrate-camera default-circles.cfg --save

calibration_pattern_occupancy distortion_displacement_map
  • mosaics_reproj_err_with_dist_0000
    mosaics_reproj_err_with_dist_0000

Dataset 1

calibration_pattern_occupancy distortion_displacement_map
Calibration with distortion in progress on 21 images...
Camera parameters for perspective projection with distortion:
  px = 1205.671359	 py = 1204.805002
  u0 = 660.4616637	 v0 = 580.9800591
  kud = -0.1709858138
  kdu = 0.1929137239

Global reprojection error: 1.758919741
  • mosaics_reproj_err_with_dist_0000:

mosaics_reproj_err_with_dist_0000

Canon 6D Lens Canon 35mm

calibration_pattern_occupancy distortion_displacement_map
Calibration with distortion in progress on 23 images...
Camera parameters for perspective projection with distortion:
  px = 5414.713464	 py = 5414.149906
  u0 = 2713.074881	 v0 = 1819.078615
  kud = -0.08385360219
  kdu = 0.08659721482

Global reprojection error: 0.9372371689
  • mosaics_reproj_err_with_dist_0000
    mosaics_reproj_err_with_dist_0000

Canon 6D Lens Canon Ultrasonic Macro 24-105mm

calibration_pattern_occupancy distortion_displacement_map
Calibration with distortion in progress on 25 images...
Camera parameters for perspective projection with distortion:
  px = 3887.883503	 py = 3880.700626
  u0 = 2755.498706	 v0 = 1775.323829
  kud = -0.1084063088
  kdu = 0.1187173467

Global reprojection error: 3.474161422
  • mosaics_reproj_err_with_dist_0000
    mosaics_reproj_err_with_dist_0000

  • mosaics_undist_0000
    mosaics_undist_0000

Canon PowerShot SX130

Process frame: IMG_0025.JPG, grid detection status: 1, image used as input data
Process frame: IMG_0026.JPG, grid detection status: 1, image used as input data
Process frame: IMG_0027.JPG, grid detection status: 1, image used as input data
Process frame: IMG_0028.JPG, grid detection status: 1, image used as input data
Process frame: IMG_0029.JPG, grid detection status: 1, image used as input data
Process frame: IMG_0030.JPG, grid detection status: 1, image used as input data
Process frame: IMG_0031.JPG, grid detection status: 1, image used as input data
Process frame: IMG_0032.JPG, grid detection status: 1, image used as input data
Process frame: IMG_0033.JPG, grid detection status: 1, image used as input data
Process frame: IMG_0034.JPG, grid detection status: 1, image used as input data
Process frame: IMG_0035.JPG, grid detection status: 1, image used as input data
Catch an exception: Error [4]:	Maximum number of iterations reached

Canon 40D Lens Canon 28-90mm

calibration_pattern_occupancy distortion_displacement_map
Calibration with distortion in progress on 24 images...
Camera parameters for perspective projection with distortion:
  px = 4931.720173	 py = 4938.034173
  u0 = 1963.024086	 v0 = 1296.726668
  kud = -0.15083377
  kdu = 0.1564686076

Global reprojection error: 1.418242249
  • mosaics_reproj_err_with_dist_0000
    mosaics_reproj_err_with_dist_0000

GoPro

More distortion coefficients are needed.

calibration_pattern_occupancy distortion_displacement_map
Calibration with distortion in progress on 25 images...
Camera parameters for perspective projection with distortion:
  px = 1763.05464	 py = 1775.163417
  u0 = 2101.378805	 v0 = 1465.66668
  kud = -0.1818221764
  kdu = 0.2877112244

Global reprojection error: 10.79785318
  • mosaics_reproj_err_with_dist_0000
    mosaics_reproj_err_with_dist_0000

  • mosaics_undist_0000
    mosaics_undist_0000

Nikon D3200 Lens Nikon DX 18-105mm

calibration_pattern_occupancy distortion_displacement_map
Calibration with distortion in progress on 24 images...
Camera parameters for perspective projection with distortion:
  px = 4760.930112	 py = 4763.277097
  u0 = 3040.149807	 v0 = 1995.427415
  kud = -0.1364586128
  kdu = 0.1489301149

Global reprojection error: 2.718639959
  • mosaics_reproj_err_with_dist_0000
    mosaics_reproj_err_with_dist_0000

  • mosaics_undist_0000
    mosaics_undist_0000

OnePlus X

Process frame: IMG_20160509_135147.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_135210.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_135302.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_135333.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_135410.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_135704.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_135748.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_135841.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_135922.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_140007.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_140125.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_140254.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_140354.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_143142.jpg, grid detection status: 1, image used as input data
Process frame: IMG_20160509_143800.jpg, grid detection status: 1, image used as input data
Catch an exception: Error [4]:	Maximum number of iterations reached

RaspberryPi

calibration_pattern_occupancy distortion_displacement_map
Calibration with distortion in progress on 25 images...
Camera parameters for perspective projection with distortion:
  px = 2577.308021	 py = 2576.000385
  u0 = 1305.299627	 v0 = 971.9074695
  kud = 0.01764096471
  kdu = -0.01753010016

Global reprojection error: 0.6449599556
  • mosaics_reproj_err_with_dist_0000
    mosaics_reproj_err_with_dist_0000

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.63%. Comparing base (b03c98f) to head (971d67a).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1918      +/-   ##
==========================================
- Coverage   48.68%   48.63%   -0.06%     
==========================================
  Files         532      532              
  Lines       69293    69293              
  Branches    32403    32404       +1     
==========================================
- Hits        33735    33700      -35     
  Misses      24976    24976              
- Partials    10582    10617      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…e image center (in green) and the camera principal point (in red) in the distortion displacement map image.
@s-trinh s-trinh force-pushed the feat_calib_tools_displacement_map branch from d38bc19 to 971d67a Compare March 2, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant