The Lidar Labeler app enables you to interactively label ground truth data in a point cloud or a point cloud sequence and generate corresponding ground truth data.
This example demonstrates the capabilities of the Lidar Labeler app in a lidar ground truth data labeling workflow.
Use the Lidar Labeler app to interactively label point cloud files and sequences of point cloud files.
To open the Lidar Labeler app, at the MATLAB® command prompt, enter this command.
lidarLabeler
The app opens to an empty session.
Alternatively, you can open the app from the Apps tab, under Image Processing and Computer Vision.
The Lidar Labeler app enables you to load signals from multiple types of data sources. In the app, a data source is a file or folder containing one or more signals to label. Use this process to load the data for a point cloud sequence.
On the app toolstrip, click Open > Add point cloud. The Select Pointcloud window opens with
the Source Type parameter already set to
Point Cloud Sequence
.
In the Folder Name parameter, browse to the folder that contains the sequence of point cloud data(PCD) files that you want to load and click Select Folder.
If you have a variable of timestamps in the MATLAB workspace, set the
Timestamps parameter to From
Workspace
and, in the Import From
Workspace
window, select the variable and click
OK. Otherwise, set it to Use
Default
.
In the Select Pointcloud window, click OK. The point cloud sequence loads into the app.
After loading the point cloud data into the Lidar Labeler app, create
label definitions and attributes. Label definitions contain
the information about the labels that you wish to annotate the points with. You can
create label definitions interactively within the app or programmatically by using a
labelDefinitionCreatorLidar
object.
An ROI label is a label that corresponds to a region of interest (ROI).
On the ROI Labels tab in the left pane, click Label.
Create a Cuboid
label and provide a name
for the label.
From the Group
list, select
New Group
and provide a name for the
group. Adding labels to groups is optional.
The specified group name appears on the ROI Labels tab with the specified label name under it.
For more details about these labels, see ROI Labels and Attributes.
An ROI attribute specifies additional information about an ROI label. You can define ROI attributes of these types.
Numeric Value
— Specify a numeric scalar attribute,
such as the number of doors on a labeled vehicle.
String
— Specify a string scalar attribute, such as the
color of a vehicle.
Logical
— Specify a logical true or false attribute,
such as whether a vehicle is in motion.
List
— Specify a drop-down list attribute of predefined
strings, such as make or model of a vehicle.
Use this process to create an attribute.
On the ROI Labels tab in the left pane, select a label and click Attribute.
Provide a name in the Attribute Name box. Select the attribute type and click OK.
For more details about these attributes, see ROI Labels and Attributes.
A scene label defines additional information across a scene. Use scene labels to describe conditions, such as lighting and weather, or events, such as lane changes.
Use this process to create a scene label definition.
Select the Scene Labels tab in the left pane of the app and click Define new scene label.
In the Define new scene label window provide a name for the label.
Choose a Color for the label.
From the Group
list, select
New Group
and provide a name for the
group. Adding labels to groups is optional.
The Scene Labels pane shows the scene label definition.
You can use an automation algorithm to automatically label your data by using one of the included algorithms or by creating and importing a custom automation algorithm. For more details on creating a custom automation algorithm, see Create Automation Algorithm for Labeling. The app includes the Lidar Object Tracker and Point Cloud Temporal Interpolator labeling automation algorithms.
Use this process to label point cloud data using an automation algorithm.
Load the data into the app and create a ROI label definition.
On the LABEL tab of the app toolstrip, in the Automate Labeling section, click Select Algorithm.
Select an algorithm for automation.
Click Automate and then follow the automation instructions in the right pane of the app.
Once you have created labels for your point cloud data, the app provides options for viewing, adjusting, and comparing your point cloud and label data.
On the LIDAR tab of the app toolstrip, click Projected View to view the selected label in front-view, top-view, and side-view simultaneously. Use these views to manually adjust the accuracy of your labels.
Enable the Auto Align option to fit the cuboid to the label data and align the label in the direction of the object. This image shows the difference in a label with and without the Auto Align option enabled.
Label without Auto Align option | Label with Auto Align option |
|
|
Use the Camera View option to save and reuse custom views of the point cloud data. You can rotate, pan, and zoom the view, then save the view by clicking Camera View and selecting Save Camera View. Specify a name for the view and click OK. You can return to the saved view at any time by clicking Camera View and selecting the saved view from the drop-down list.
Connect an external tool to the application to display time-synchronized
images for use as reference while labeling. See the lidar.syncImageViewer.SyncImageViewer
class.
On the LABEL tab of the app toolstrip, select Export Labels > To Workspace. In the Export to workspace
window, leave the default export variable name, gTruth
, and click
OK. The app exports a
object, groundTruthLidar
gTruth
, to the
MATLAB workspace. This object contains the ground truth lidar label data captured from
the app session.
The properties of the groundTruthLidar
object,
gTruth
, contain information about the signal data source, label
definitions, and labels from the associated app session. Display information about the
object and each of its properties using these commands.
gTruth
— Display the properties of the
groundTruthLidar
object.
gTruth.DataSource
— Display the information about source of
the point cloud data.
gTruth.LabelDefinitions
— Display the table of information
about label definitions.
gTruth.LabelData
— Display the ROI and scene label
data.