ethz-asl / kalibr

The Kalibr visual-inertial calibration toolbox
Other
4.44k stars 1.4k forks source link

camera model pinhole-none #574

Open subutayebru opened 2 years ago

subutayebru commented 2 years ago

Hi!

I am having an issue that pinhole camera model none distortion configuration on kalibr using ros package, not the docker.

$rosrun kalibr  kalibr_calibrate_cameras --target ~/Calibration_Ebru/apriltag_045_printed.yaml --bag ~/Calibration_Ebru/2022-10-23-16-06-35.bag --models pinhole-none --topics /camera/color/image_raw --show-extraction --verbose

importing libraries
Initializing cam0:
    Camera model:     pinhole-none
Traceback (most recent call last):
  File "/home/bru/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_cameras", line 449, in <module>
    main()
  File "/home/bru/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_cameras", line 194, in main
    raise RuntimeError( "Unknown camera model: {0}. Try {1}.".format(modelName, list(cameraModels.keys())) )
RuntimeError: Unknown camera model: pinhole-none. Try ['pinhole-radtan', 'pinhole-equi', 'omni-radtan', 'pinhole-fov', 'ds-none', 'omni-none', 'eucm-none']. 

In kalibr _calibrate_cameras.py there are available models:


#available models
cameraModels = { 'pinhole-radtan': acvb.DistortedPinhole,
                 'pinhole-equi':   acvb.EquidistantPinhole,
                 'pinhole-fov':    acvb.FovPinhole,
                 'omni-none':      acvb.Omni,
                 'omni-radtan':    acvb.DistortedOmni,
                 'eucm-none':      acvb.ExtendedUnified,
                 'ds-none':        acvb.DoubleSphere}

How to add pinhole-none to the script?

Ros version: Melodic

NikolausDemmel commented 2 years ago

It will require some code changes. You could have a look at this PR, which added new camera models, for some pointers where you might have to add things to enable pinhole-none: https://github.com/ethz-asl/kalibr/pull/210

Note that your diff will be much simpler of course, since you're not implementing a new model, just enabling a new combination of existing model and distortion. You will only have to touch a subset of the places touched by above PR.