Main Content

lidar.labeler.loading.LasFileSequenceSource class

Package: lidar.labeler.loading
Superclasses: vision.labeler.loading.MultiSignalSource

Load signals from LAS or LAZ file sequence sources into Lidar Labeler app

Description

The lidar.labeler.loading.LasFileSequenceSource class creates an interface for loading a signal from a LAS or LAZ file sequence data source into the Lidar Labeler app. In the Select Point Cloud dialog box of the app, when Source Type is set to LAS/LAZ File Sequence, this class controls the parameters in that dialog box.

To access this dialog box, in the app, select Open > Add Point Cloud.

The lidar.labeler.loading.LasFileSequenceSource class is a handle class.

Creation

When you export labels from a Lidar Labeler app session that contains a LAS or LAZ file sequence source, the exported groundTruthLidar object stores an instance of this class in its DataSource property.

To create a LasFileSequenceSource object programmatically, such as when programmatically creating a groundTruthLidar object, use the lidar.labeler.loading.LasFileSequenceSource function (described here).

Description

example

lasSeqSource = lidar.labeler.loading.LasFileSequenceSource creates a LasFileSequenceSource object for loading a signal from a LAS or LAZ file sequence data source. 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 LAS or LAZ file 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 LAS or LAZ file sequence signal, specified as a cell array containing a single duration vector of timestamps.

In the Select Point Cloud 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 LAS or LAZ file sequence signals, then the structure does not include this field, and the SourceParams property is empty, []. For LAS or LAZ file sequence signals, the default timestamp duration vector has elements from 0 to the number of valid LAS or LAZ 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 LAS file sequence.

lasSeqFolder = fullfile(toolboxdir('lidar'),'lidardata','las');

The LAS file consists of two point cloud frames that occur at one-second intervals. Specify the timestamps of the frames as a duration vector of two seconds.

timestamps = seconds(1:2);

Create a LAS file sequence source. Load the folder path and timestamps into the LasFileSequenceSource object.

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

lasSeqSource = lidar.labeler.loading.LasFileSequenceSource;
loadSource(lasSeqSource,sourceName,sourceParams)

Read the second frame in the sequence. Display the frame.

signalName = lasSeqSource.SignalName;
pc = readFrame(lasSeqSource,signalName,2);

figure
pcshow(pc)

Introduced in R2020b