Main Content

vision.labeler.loading.PointCloudSequenceSource Class

Namespace: vision.labeler.loading
Superclasses: vision.labeler.loading.MultiSignalSource

Load signals from point cloud sequence sources into Ground Truth Labeler app

Since R2020a

Description

The vision.labeler.loading.PointCloudSequenceSource class creates an interface for loading signals from point cloud sequence data sources into the Ground Truth Labeler app. In the Add/Remove Signal dialog box of the app, when Source Type is set to Point Cloud Sequence, this class controls the parameters in that dialog box.

Add/Remove Signal dialog box with Source Type set to Point Cloud Sequence

To access this dialog box, in the app, select Import > Add Signals.

The default implementation of this class loads point cloud sequences composed of PCD or PLY files.

The vision.labeler.loading.PointCloudSequenceSource class is a handle class.

Creation

When you export labels from a Ground Truth Labeler app session that contains point cloud sequence sources, the exported groundTruthMultisignal object stores instances of this class in its DataSource property.

To create a PointCloudSequenceSource object programmatically, such as when programmatically creating a groundTruthMultisignal object, use the vision.labeler.loading.PointCloudSequenceSource function (described here).

Description

example

pcseqSource = vision.labeler.loading.PointCloudSequenceSource creates a PointCloudSequenceSource object for loading signals from point cloud sequence data sources. To specify the data source and the parameters required to load the source, use the loadSource method.

Properties

expand all

Name of the type of source that this class loads, specified as a string scalar.

Attributes:

GetAccess
public
Constant
true
NonCopyable
true

Description of the functionality that this class provides, specified as a string scalar.

Attributes:

GetAccess
public
Constant
true
NonCopyable
true

Name of the data source, specified as a string scalar. Typically, SourceName is the name of the file from which the signal is loaded.

Attributes:

GetAccess
public
SetAccess
protected

Parameters for loading a point cloud sequence signal from a data source, specified as a structure.

This table describes the required and optional fields of the SourceParams structure.

FieldDescriptionRequired or Optional
Timestamps

Timestamps for the point cloud sequence signal, specified as a cell array containing a single duration vector of timestamps.

In the Add/Remove Signal dialog box of the app, if you set the Timestamps parameter to From Workspace and read the timestamps from a variable in the MATLAB® workspace, then the SourceParams property stores these timestamps in the Timestamps field.

Optional

If you set the Timestamps parameter to Use Default and use the default timestamps for point cloud sequence signals, then the structure does not include this field, and the SourceParams property is empty, []. For point cloud sequence signals, the default timestamp duration vector has elements from 0 to the number of valid point cloud files minus 1. Units are in seconds.

Attributes:

GetAccess
public
SetAccess
protected

Names of the signals that can be loaded from the data source, specified as a string vector.

Attributes:

GetAccess
public
SetAccess
protected

Types of the signals that can be loaded from the data source, specified as a vector of vision.labeler.loading.SignalType enumerations. Each signal listed in the SignalName property is of the type in the corresponding position of SignalType.

Attributes:

GetAccess
public
SetAccess
protected

Timestamps of the signals that can be loaded from the data source, specified as a cell array of duration vectors. Each signal listed in the SignalName property has the timestamps in the corresponding position of Timestamp.

Attributes:

GetAccess
public
SetAccess
protected

Number of signals that can be read from the data source, specified as a nonnegative integer. NumSignals is equal to the number of signals in the SignalName property.

Attributes:

GetAccess
public
SetAccess
public
Dependent
true
NonCopyable
true

Methods

expand all

Examples

collapse all

Specify the path to a folder containing a point cloud sequence.

pcSeqFolder = fullfile(toolboxdir('driving'),'drivingdata',...
    'lidarSequence');

Load the timestamps that correspond to the sequence.

load(fullfile(pcSeqFolder,'timestamps.mat'));

Create a point cloud sequence source. Load the folder path and timestamps into the PointCloudSequenceSource object.

sourceName = pcSeqFolder;
sourceParams = struct;
sourceParams.Timestamps = timestamps;

pcseqSource = vision.labeler.loading.PointCloudSequenceSource;
loadSource(pcseqSource,sourceName,sourceParams);

Read the first frame in the sequence. Display the frame.

signalName = pcseqSource.SignalName;
pc = readFrame(pcseqSource,signalName,1);

figure
pcshow(pc)

Tips

  • You can this class as a starting point for creating a custom data source loading class. To view the source code for this class, use this command:

    edit vision.labeler.loading.PointCloudSequenceSource

Version History

Introduced in R2020a