Visualizing a single image

We cannot use rostopic echo /camera because, as it's an image, the amount of information in plain text would be huge and not human-readable. Hence, we are going to use the following command:

    $ rosrun image_view image_view image:=/camera
  

This is the image_view node, which shows the images in the given topic (the image argument) in a window. This way, we can visualize every image or frame published in a topic in a very simple and flexible manner-even over a network. If you press the right button of your mouse in the window, you can save the current frame in the disk, usually in your home directory, or ~/.ros.

ROS Kinetic also has rqt_image_view, which supports viewing multiple images in a single window but does not allow the saving of images by right-clicking. We can select the image topic manually on the GUI or as we do with image_view:

    $ rosrun rqt_image_view rqt_image_view
  

The previous command yields an output shown in the following screenshot:

ROS provides a camera calibration interface built on top of the OpenCV calibration API. We will cover this in Chapter 8, Computer Vision, when we will see how to work with cameras. There, we will see monocular and stereo cameras as well as the ROS image pipeline (image_proc and stereo_image_proc), which allows the rectification of the camera image distortion and computes the depth image disparity for stereo pairs so that we obtain a point cloud.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.220.120