ethz-asl / image_undistort

A compact package for undistorting images directly from kalibr calibration files. Can also perform dense stereo estimation
249 stars 93 forks source link

Attempted to create undistorter from invalid camera parameters #45

Open nberinpa opened 5 years ago

nberinpa commented 5 years ago

Hi, I calibrated my fisheye camera with the kalibr tool (omni- radtan and pinhole-equi). I recorded the image stream to a rosbag for the calibration. Now, I wanted to call this package to undistort the image stream. For that, I played the recorded data from the same rosbag as used for the calibration and loaded the yaml file from kalibr. But I always get this error message: Attempted to create undistorter from invalid camera parameters

Do you know what the problem could be?

Thanks! Niji

mzahana commented 3 years ago

@nberinpa I am facing the same issue with a fisheye camera, too. Were you able to solve this issue?

mzahana commented 3 years ago

An update: I just used the calibration YAML file that is provided by Kalibr, then it worked fine.

I had to load the calibration YAML file outside the <node> tag. Otherwise, the node name will be added to the node namesapece, and make the calibration parameters not discover-able.

zhangchunxia22 commented 2 years ago

I have the same problem,and i solve it by following: in camera_parameters.h line 167: static constexpr double kFocalLengthEstimationAttempts = 100 //change to static constexpr double kFocalLengthEstimationAttempts = 5


it is due to the resolution estimate process in camera_parameters.cpp for 100 loops cost a lot of time ,and before it finished, the output Camera cannot be created. so i change the loop count from 100 to 5. and it work.