ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Camera calibration => ImportError: No module named cv_bridge_boost on Mac OS X

asked 2013-06-18 08:23:12 -0600

Artem gravatar image

updated 2014-01-28 17:16:57 -0600

ngrennan gravatar image

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 ...
OK
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
    self.run()
  File "/opt/ros/groovy/lib/camera_calibration/cameracalibrator.py", line 68, in run
    self.function(m)
  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.

  • UPDATE

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 ...
OK
Waiting for service /stereo/right/set_camera_info ...
OK

However the window is still frozen.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-06-30 05:53:10 -0600

Artem gravatar image

updated 2013-10-28 05:06:23 -0600

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-06-18 08:23:12 -0600

Seen: 1,629 times

Last updated: Dec 03 '13