2D Visualization Example


Outline

2D Visualization Class

Lidar Visualization

Annotations Visualizations

Combined Visualization

Loading frame information

This step is required to use the frame transformations class. The content of this snippet is explained in Notebook 1.

In [1]:
from vod.configuration import KittiLocations
from vod.frame import FrameDataLoader


kitti_locations = KittiLocations(root_dir="example_set",
                                output_dir="example_output")

frame_data = FrameDataLoader(kitti_locations=kitti_locations,
                             frame_number="01201")

2D Visualization class

The Visualization2D class allows the projection of the lidar, radar data, and the 3D-boxes of the annotation to the camera picture. The example below shows the instantiation of the class, and applies the draw_plot() to plot the picture.

In [2]:
from vod.visualization import Visualization2D

vis2d = Visualization2D(frame_data)

vis2d.draw_plot()

LIDAR point-cloud visualization

By changing the arguments of the draw_plot() method, plotting lidar points is also possible.

In [3]:
vis2d.draw_plot(show_lidar=True)

Radar point-cloud visualization

Similar to Lidar, provided show_radar=True argument, the radar pcl can be also plotted over the picture.

In [4]:
vis2d.draw_plot(show_radar=True)

Annotation visualization

Similar to point-cloud data, the 3D bounding boxes can be also plotted over the picture.

In [5]:
vis2d.draw_plot(show_gt=True)

2D Combined sensors and filters

Plotting the point-clouds and the annotations in a single plot is also possible. It is also possible to set filters for distance, which limits the number of plotted instances. Using the save_figure argument, it is possible to save the image to a file as well.

In [6]:
vis2d.draw_plot(show_lidar=True,
                             show_radar=True,
                             show_gt=True,
                             min_distance_threshold=5,
                             max_distance_threshold=20,
                             save_figure=True)