groundTruthLidar
Description
The groundTruthLidar
object contains information about lidar
ground truth labels. The data source used to create the object is a collection of lidar point
cloud data. You can create, export, or import a groundTruthLidar
object from
the Lidar Labeler app.
Creation
To export a groundTruthLidar
object from the Lidar
Labeler app, on the app toolstrip, select Export > To Workspace. The app exports the object to the MATLAB® workspace. To create a groundTruthLidar
object
programmatically, use the groundTruthLidar
function (described
here).
Description
returns an object containing lidar ground truth labels that can be imported into the
Lidar Labeler app.gTruth
= groundTruthLidar(dataSource
,labelDefs
,labelData
)
dataSource
specifies the source of the lidar point cloud data and sets theDataSource
property.labelDefs
specifies the definitions of region of interest (ROI) and scene labels containing information such asName
,Type
, andGroup
, and sets theLabelDefinitions
property.labelData
specifies the identifying information, position, and timestamps for the marked ROI labels and scene labels, and sets theLabelData
property.
Properties
DataSource
— Source of ground truth lidar data
PointCloudSequenceSource
object | VelodyneLidarSource
object | LasFileSequenceSource
object | CustomPointCloudSource
object | RosbagSource
object
Source of ground truth lidar data, specified as a PointCloudSequenceSource
, VelodyneLidarSource
,
LasFileSequenceSource
, CustomPointCloudSource
, or
RosbagSource
object. This object contains the information that
describes the source from which the ground truth lidar data was labeled. This table
provides more details about the type of objects that you can specify.
Object Name | Data Source | Class Reference |
---|---|---|
PointCloudSequenceSource | Point cloud sequence folder | vision.labeler.loading.PointCloudSequenceSource |
VelodyneLidarSource | Velodyne® packet capture (PCAP) file | vision.labeler.loading.VelodyneLidarSource |
LasFileSequenceSource | LAS or LAZ file sequence folder | lidar.labeler.loading.LasFileSequenceSource |
CustomPointCloudSource | Point cloud data from custom sources | lidar.labeler.loading.CustomPointCloudSource |
RosbagSource | Rosbag file | lidar.labeler.loading.RosbagSource |
LabelDefinitions
— Label definitions
table
This property is read-only.
Label definitions, specified as a table. To create this table, use one of these options.
In the Lidar Labeler app, create label definitions, and then export them as part of a
groundTruthLidar
object.Use a
labelDefinitionCreatorLidar
object to generate a label definitions table. If you save this table to a MAT-file, you can then load the label definitions into a Lidar Labeler app session by selecting Open > Label Definitions from the app toolstrip.Create the label definitions table at the MATLAB command line.
This table describes the required and optional columns of the table specified in the
LabelDefinitions
property.
Column | Description | Required or Optional | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Name | Strings or character vectors specifying the name of each label definition. | Required | ||||||||
Type |
| Required | ||||||||
LabelColor | RGB triplets that specify the colors of the label definitions. Values are in the range [0, 1]. The color yellow (RGB triplet [1 1 0]) is reserved for the color of selected labels in the Lidar Labeler app. | Optional When you define labels in the Lidar Labeler app, you must specify a color. Therefore, an exported label definitions table always includes this column. When you create
label definitions using the | ||||||||
Group | Strings or character vectors specifying the group to which each label definition belongs. | Optional If you create the label definitions table at
the MATLAB command line, you do not need to include a
If you export label
definitions from the Lidar Labeler app or create them using a
| ||||||||
Description | Strings or character vectors that describe each label definition. | Optional If you create the label definitions table at
the MATLAB command line, you do not need to include a
If you export label
definitions from the Lidar Labeler app or create them using a
| ||||||||
Hierarchy | Structures containing attribute information for each label definition.
If a label definition does not contain attributes, then the table entry for that label definition is empty. | Optional When you define sublabels or attributes in the
Lidar Labeler app or the
|
LabelData
— Label data for each ROI and scene label
timetable
This property is read-only.
Label data for each ROI and scene label, specified as a timetable
. Each column of LabelData
holds labels for a
single label definition and corresponds to the Name
value for each
row in LabelDefinitions
. The storage format for the label data
depends on the label type.
Label Type | Storage Format for Labels at Each Timestamp |
---|---|
|
The figure shows how these values determine the position of a cuboid. |
labelType.Scene | Logical vector, where
|
If the Cuboid
ROI label data includes attributes, then the labels
at each timestamp must be specified as structures instead. The structure includes these
fields.
Label Structure Field | Description |
---|---|
Position | Positions of the parent labels at the given timestamp The format of |
AttributeName1,...,AttributeNameN | Attributes of the parent labels Each defined attribute
has its own field, where the name of the field corresponds to the attribute
name. The attribute value is a character vector for a
|
Object Functions
changeFilePaths | Change file paths in ground truth data |
selectLabels | Select ground truth data by label name or type |
selectLabelsByGroup | Select ground truth data by label group name |
selectLabelsByName | Select ground truth data by label name |
selectLabelsByType | Select ground truth data by label type |
Examples
Create Ground Truth Lidar Object
Create ground truth data for a Velodyne lidar source that captures a car on the road. Specify the signal sources, label definitions, and ROI label data.
Create a Velodyne data source.
sourceName = fullfile(toolboxdir('vision'),'visiondata', ... 'lidarData_ConstructionRoad.pcap'); sourceParams = struct(); sourceParams.DeviceModel = 'HDL32E'; sourceParams.CalibrationFile = fullfile(matlabroot,'toolbox','shared', ... 'pointclouds','utilities','velodyneFileReaderConfiguration', ... 'HDL32E.xml');
Load the data source.
dataSource = vision.labeler.loading.VelodyneLidarSource; dataSource.loadSource(sourceName,sourceParams);
Create label definitions.
ldc = labelDefinitionCreatorLidar; addLabel(ldc,'Car','Cuboid'); labelDefs = ldc.create;
Create ground truth data for lidar sequence.
numPCFrames = numel(dataSource.Timestamp{1}); carData = cell(numPCFrames,1); carData{1} = [1.0223 13.2884 1.1456 8.3114 3.8382 3.1460 0 0 0]; lidarData = timetable(dataSource.Timestamp{1},carData, ... 'VariableNames',{'Car'});
Create the ground truth lidar object.
gTruth = groundTruthLidar(dataSource,labelDefs,lidarData)
gTruth = groundTruthLidar with properties: DataSource: [1x1 vision.labeler.loading.VelodyneLidarSource] LabelDefinitions: [1x5 table] LabelData: [40x1 timetable]
Version History
Introduced in R2020b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)