camera_calibration tutorial with monocular webcam just pops up blank window

asked 2020-12-12 12:13:07 -0600

hunny154 gravatar image

/OS Ubuntu 18.04 /rosdistro melodic /rosversion 1.14.5

Hi. I am having trouble calibrating my webcam using camera_calibrationpackage. I have no existing camera_info file yet. I'm a complete beginner in ROS. I am following this tutorial:

I am using the package to publish image_raw, camera_info as well as offer the service set_camera_info. I have confirmed with image_view that the feed is being published.

So in terminal #1, I am running roscore. In #2, I have the following:

ros@ros-vbox:~$ rosrun cv_camera cv_camera_node 
[ INFO] [1607795199.732718473]: using default calibration URL
[ INFO] [1607795199.733832868]: camera calibration URL: file:///home/ros/.ros/camera_info/camera.yaml
[ INFO] [1607795199.734298625]: Unable to open camera calibration file [/home/ros/.ros/camera_info/camera.yaml]
[ WARN] [1607795199.734352830]: Camera calibration file /home/ros/.ros/camera_info/camera.yaml not found.

In terminal #3 I am trying to run from the tutorial:

ros@ros-vbox:~/catkin_ws/src$ rosrun camera_calibration --size 8x7 --square 0.007 image:=/cv_camera/image_raw camera:=/cv_camera
('Waiting for service', '/cv_camera/set_camera_info', '...')
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 801, in __bootstrap_inner
  File "/home/ros/catkin_ws/src/image_pipeline/camera_calibration/src/camera_calibration/", line 107, in run
  File "/home/ros/catkin_ws/src/image_pipeline/camera_calibration/src/camera_calibration/", line 181, in handle_monocular
    max_chessboard_speed = self._max_chessboard_speed)
  File "/home/ros/catkin_ws/src/image_pipeline/camera_calibration/src/camera_calibration/", line 725, in __init__
    super(MonoCalibrator, self).__init__(*args, **kwargs)
TypeError: super() argument 1 must be type, not classobj

(display:17643): GLib-GObject-CRITICAL **: 18:47:13.779: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(display:17643): GLib-GObject-CRITICAL **: 18:47:32.444: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

and a black display pops up with a camera type and a scale slider. The camera feed can't be seen. I'd appreciate some help, I haven't found anything similar online.

Btw, here's the output from rostopic list:

ros@ros-vbox:~$ rostopic list

and rosservice list:

ros@ros-vbox:~$ rosservice list
edit retag flag offensive close merge delete


I had something similar when calibrating a depth camera. It was solved by making sure that the type of the image is mono8 and normalize it (0-255).

YamenMh gravatar image YamenMh  ( 2021-01-12 08:18:27 -0600 )edit

Hi, did you find any solution? I tried the mono8 and normalize but I keep getting the same error

Alexouwu gravatar image Alexouwu  ( 2021-10-24 02:39:53 -0600 )edit

here the same

reg gravatar image reg  ( 2021-12-15 05:21:32 -0600 )edit