build details

Show: section status errors & todos local changes recent changes last change in-page changes feedback controls

Exercise: Bag thumbnails

Modified 2019-09-22 by Andrea Censi

Skills learned

Modified 2019-09-22 by Andrea Censi

  • Reading images from images topic in a bag file.

Instructions

Modified 2019-09-22 by Andrea Censi

Write a program dt-bag-thumbnails as specified below.

Specification for dt-bag-thumbnails

Modified 2019-09-22 by Andrea Censi

The program dt-bag-thumbnails creates thumbnails for some image stream topic in a bag file.

The syntax is:

$ dt-bag-thumbnails bag topic output_dir

This should create the files:

output_dir/00000.jpg
output_dir/00001.jpg
output_dir/00002.jpg
output_dir/00003.jpg
output_dir/00004.jpg
...

where the progressive number is an incremental counter for the frames.

Test data

Modified 2019-09-22 by Andrea Censi

If you don’t have a ROS bag to work on, you can download the test bag example_rosbag_H5.bag. You should be able to get a total of 653 frames out of it.

Useful APIs

Modified 2019-09-22 by Andrea Censi

Read image from a topic

Modified 2019-09-22 by Andrea Censi

The duckietown_utils (unknown ref software_devel/duckietown-utils-library)

previous warning next (51 of 57) index
warning
I will ignore this because it is an external link. 

 > I do not know what is indicated by the link '#software_devel/duckietown-utils-library'.

Location not known more precisely.

Created by function n/a in module n/a.
package provides the utility function rgb_from_ros() (unknown ref software_devel/duckietown_utils-rgb_from_ros)
previous warning next (52 of 57) index
warning
I will ignore this because it is an external link. 

 > I do not know what is indicated by the link '#software_devel/duckietown_utils-rgb_from_ros'.

Location not known more precisely.

Created by function n/a in module n/a.
that processes a ROS message and returns the RGB image it contains (if any).

Color space conversion

Modified 2019-09-22 by Andrea Censi

In OpenCV, an image can be converted from one color space (e.g., BGR) to another supported color space (e.g., RGB). OpenCV provides a list of supported conversions. A ColorConversionCode defines a conversion between two different color spaces. An exhaustive list of color conversion codes can be found here. The conversion from a color space to another is done with the function cv.cvtColor.