Rosanswers logo

Running the camera calibration on Mac OS 10.8.4 rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 image:=/stereo/left/image_raw camera:=/stereo/left causes this error

Waiting for service /stereo/left/set_camera_info ...
Exception in thread Thread-5:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 552, in __bootstrap_inner
  File "/opt/ros/groovy/lib/camera_calibration/cameracalibrator.py", line 68, in run
  File "/opt/ros/groovy/lib/camera_calibration/cameracalibrator.py", line 134, in handle_monocular
    drawable = self.c.handle_msg(msg)
  File "/opt/ros/groovy/lib/python2.7/site-packages/camera_calibration/calibrator.py", line 736, in handle_msg
    gray = self.mkgray(msg)
  File "/opt/ros/groovy/lib/python2.7/site-packages/camera_calibration/calibrator.py", line 271, in mkgray
    return self.br.imgmsg_to_cv(msg, "mono8")
  File "/opt/ros/groovy/lib/python2.7/site-packages/cv_bridge/core.py", line 101, in imgmsg_to_cv
    source_type = self.encoding_as_cvtype(img_msg.encoding)
  File "/opt/ros/groovy/lib/python2.7/site-packages/cv_bridge/core.py", line 73, in encoding_as_cvtype
    from cv_bridge.boost.cv_bridge_boost import getCvType
ImportError: No module named cv_bridge_boost

Could you try it on your system? I wonder if it's my system fails or the cv_brige/cameracalibration has got compatibility issues with Mac.

I'm running Groovy, cv_bridge is 1.10.6.

I should also mention that broken display windows appears. By broken I mean it so small that only one slide bar is visible, and the window freezes.


It is weird, when I run calibration for a stereo pair, I don't get any error messages.

rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 right:=/stereo/right/image_raw left:=/stereo/left/image_raw left_camera:=/stereo/left right_camera:=/stereo/right
Waiting for service /stereo/left/set_camera_info ...
Waiting for service /stereo/right/set_camera_info ...

However the window is still frozen.

Originally posted by Artem on ROS Answers with karma: 709 on 2013-06-18

Post score: 0


1 Answer 1


Rosanswers logo

Here is the answers for the above stated problems. To calibrate stereo camera without hardware synchronisation, the approximate=0.01 flag should be used. If it's set up then this problem becomes the original calibration problem with monocular camera. To solve it you have to rename cv_bridge_boost.dylib to cv_bridge_boost.so. After you will start seeing the calibration window, however it will not respond to mouse clicks. To solve this you have to rebuild opencv with GTK as a backend. These are the steps I took to successfully build opencv

I had to modify CMakeLists.txt in opencv folder as follows

Line 129:
OCV_OPTION(WITH_GTK            "Include GTK support"                         OFF  )

LINE 135:
OCV_OPTION(WITH_OPENGL         "Include OpenGL support"                      ON  IF (NOT ANDROID) )

LINE 617:
        status("    Carbon:" NO)
LINE 616:
        status("    Carbon:" NO)

LINE 140:
OCV_OPTION(WITH_QT             "Build with Qt Backend support"               OFF  IF (NOT ANDROID AND NOT IOS) )

Then gtk should be installed

brew install gtk+
brew install gtkglext

and /opt/X11/lib/pkgconfig should be added to ~/.profile

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:$PKG_CONFIG_PATH

after building opencv, I could run stereo calibration without a problem.

PS: I hope I did not forget to mention any steps.

Originally posted by Artem with karma: 709 on 2013-06-30

This answer was ACCEPTED on the original site

Post score: 2


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.