ethz-asl / kalibr

The Kalibr visual-inertial calibration toolbox
Other
4.39k stars 1.41k forks source link

'_sensor_msgs__CompressedImage' object has no attribute 'encoding' #463

Closed laibazahid26 closed 2 years ago

laibazahid26 commented 3 years ago

When I write the calibration command given below: /kalibr_calibrate_cameras --target ~/Downloads/april_6x6_80x80cm.yaml --bag ~/Downloads/CalibrationBag.bag --models pinhole-equi --topics camera/image_raw I get the following errors:

importing libraries
Initializing cam0:
    Camera model:     pinhole-equi
    Dataset:          /root/Downloads/CalibrationBag.bag
    Topic:            camera/image_raw
    Number of images: 2086
Extracting calibration target corners
Traceback (most recent call last):
  File "/var/kalibr-build/devel/bin/kalibr_calibrate_cameras", line 5, in <module>
    exec(fh.read())
  File "<string>", line 444, in <module>
  File "<string>", line 175, in main
  File "/var/kalibr-build/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_common/TargetExtractor.py", line 73, in extractCornersFromDataset
    raise RuntimeError("Exception during multithreaded extraction: {0}".format(e))
RuntimeError: Exception during multithreaded extraction: '_sensor_msgs__CompressedImage' object has no attribute 'encoding'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
ImportError: No module named apport.fileutils

Original exception was:
Traceback (most recent call last):
  File "/var/kalibr-build/devel/bin/kalibr_calibrate_cameras", line 5, in <module>
    exec(fh.read())
  File "<string>", line 444, in <module>
  File "<string>", line 175, in main
  File "/var/kalibr-build/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_common/TargetExtractor.py", line 73, in extractCornersFromDataset
    raise RuntimeError("Exception during multithreaded extraction: {0}".format(e))
RuntimeError: Exception during multithreaded extraction: '_sensor_msgs__CompressedImage' object has no attribute 'encoding'

How can I solve these bugs? Any help would be highly appreciated.

ConnaLu commented 3 years ago

I get the same error,do you get any idea?

laibazahid26 commented 3 years ago

I get the same error,do you get any idea?

Sorry, not yet.

thejerrycheng commented 2 years ago

hi, is it possible to share the april_6x6_80x80cm.yaml to me. the original folder needs permission to access now

seajayshore commented 2 years ago

Did you manage to solve this? I have a similar error...

I think in your case it might be due to using compressed images in the bagfile instea of raw image. I had to convert images to raw to get it to work even partially. Note that your screenshot of your terminal doesn't even state any progress extracting target corners after the "Extracting calibration target corners" statement.

My setup progresses through many images but eventually crashes due to the same RuntimeError("Exception during multithreaded extraction: {0}".format(e))

goldbattle commented 2 years ago

This is due to using a compressed image topic. Currently the repo does not have support for such topic. You can see PR https://github.com/ethz-asl/kalibr/pull/493

goldbattle commented 2 years ago

Addressed via #523