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

camera_calibration opens gui window but freezes

asked 2018-07-03 08:42:24 -0500

martinakos gravatar image

I'm trying to run the camera_calibration node. I run this command:

rosrun camera_calibration cameracalibrator.py --size 8x7 --square 0.023 --approximate=0.1 --no-service-check image:=/camera/color/image_raw

I see a window opening but then it freezes indefinitely. I tried to debug cameracalibrator.py and saw that the freeze occurs at the cv2.namedWindow("display", cv2.WINDOW_NORMAL) in the run() method of DisplayThread which is created in the OpenCVCalibrationNode __init__(). I have tried to move the cv2.namedWindow somewhere else but it also freezes. In fact after trying a few times the freeze transforms into a segmentation fault when executing the cv2.namedWindow statement.

Any idea what could the problem be?

I'm running Ubuntu 16.04, ROS kinetic, opencv version is 3.3

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
1

answered 2018-07-06 03:57:49 -0500

martinakos gravatar image

This was an opencv library version conflict, as I suspected. I had opencv 3.4 also in a development folder. Despite camera_calibration being built with the opencv 3.3 that came with ROS kinetic installation for some reason ldd showed a dependency to a lib in opencv 3.4. I think this dependency came through a thirdparty library built with opencv 3.4 and installed in the system. Interestingly enough other opencv calls in camera_calibration worked well but only showed the problem when opening a window.

I uninstalled opencv 3.4 and rebuild a bunch of libraries with ROS's opencv 3.3 and it worked.

edit flag offensive delete link more
1

answered 2018-07-03 09:13:42 -0500

pavel92 gravatar image

Have you tried waiting few minutes for the window to unfreeze? I know that camera_calibration window can freeze up to 10 minutes after clicking the "calibrate" button (this is even stated in the documentation). From what I understand, in your case the gui freezes at the start?
According to the camera_calibration, there is also a camera parameter in the command:

rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 image:=/my_camera/image camera:=/my_camera
edit flag offensive delete link more

Comments

yes it freezes at the start. I have waited for a long time anyway, but I think it's not related with the calibration computation. Maybe more like a library conflict.

martinakos gravatar image martinakos  ( 2018-07-03 09:38:48 -0500 )edit
0

answered 2019-09-19 16:07:57 -0500

rukie gravatar image

I also ran into this issue.

To address it, I downloaded the latest image_pipeline from github into my catkin workspace and ran catkin_make.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2018-07-03 08:42:24 -0500

Seen: 790 times

Last updated: Sep 19 '19