camera_calibration tutorial with monocular webcam just pops up blank window

asked 2020-12-12 12:13:07 -0500

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: http://wiki.ros.org/camera_calibratio...

I am using the package http://wiki.ros.org/cv_camera 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 cameracalibrator.py from the tutorial:

ros@ros-vbox:~/catkin_ws/src$ rosrun camera_calibration cameracalibrator.py --size 8x7 --square 0.007 image:=/cv_camera/image_raw camera:=/cv_camera
('Waiting for service', '/cv_camera/set_camera_info', '...')
OK
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/home/ros/catkin_ws/src/image_pipeline/camera_calibration/src/camera_calibration/camera_calibrator.py", line 107, in run
    self.function(m)
  File "/home/ros/catkin_ws/src/image_pipeline/camera_calibration/src/camera_calibration/camera_calibrator.py", 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/calibrator.py", 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
/cv_camera/camera_info
/cv_camera/image_raw
/cv_camera/image_raw/compressed
/cv_camera/image_raw/compressed/parameter_descriptions
/cv_camera/image_raw/compressed/parameter_updates
/cv_camera/image_raw/compressedDepth
/cv_camera/image_raw/compressedDepth/parameter_descriptions
/cv_camera/image_raw/compressedDepth/parameter_updates
/cv_camera/image_raw/theora
/cv_camera/image_raw/theora/parameter_descriptions
/cv_camera/image_raw/theora/parameter_updates
/left
/right
/rosout
/rosout_agg

and rosservice list:

ros@ros-vbox:~$ rosservice list
/cameracalibrator/get_loggers
/cameracalibrator/set_logger_level
/cv_camera/get_loggers
/cv_camera/image_raw/compressed/set_parameters
/cv_camera/image_raw/compressedDepth/set_parameters
/cv_camera/image_raw/theora/set_parameters
/cv_camera/set_camera_info
/cv_camera/set_logger_level
/rosout/get_loggers
/rosout/set_logger_level
edit retag flag offensive close merge delete

Comments

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 -0500 )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 -0500 )edit

here the same

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