Main Content

Use Custom Point Cloud Source Reader for Labeling

The Lidar Labeler app enables you to label ground truth data in point clouds. You can use a custom reader to import the data. First, create a custom reader function. Then, load the custom reader function and corresponding point cloud data source into the Lidar Labeler.

Create Custom Reader Function

Specify a custom reader as a function handle. The custom reader must have this syntax.

outputPointCloud = readerFcn(sourceName,currentTimestamp)
In this example, readerFcn is the name of the custom reader function.

The custom reader function loads a point cloud from sourceName, which corresponds to the current timestamp specified by currentTimestamp. For example, suppose you want to load the point cloud at the third timestamp for a timestamp duration vector that runs from 1 to 5 seconds. To specify currentTimestamp, at the MATLAB® command prompt, enter this code.

timestamps = seconds(1:5);
currIdx = 3;
currentTimestamp = timestamps(currIdx);

outputPointCloud from the custom reader function must be a pointCloud object.currentTimestamp is a scalar value that corresponds to the current frame that the function is executing.

Import Data Source into Lidar Labeler App

To import a custom data source into the app, first create a structure. This structure stores the function handle and timestamps. Specify the custom reader function handle that reads the data, and the timestamps.

sourceParams = struct();
sourceParams.FunctionHandle = readerFcn;
sourceParams.Timestamps = timestamps;

To load this structure into the app, at the MATLAB command prompt, enter this code.


Alternatively, on the toolstrip of the Lidar Labeler app, select Import > Add Point Cloud. Then, in the Select Point Cloud dialog box, choose Custom Point Cloud as the Source Type. Specify Custom Reader Function as the function handle and also specify Source Name. In addition, you must import corresponding timestamps from the MATLAB workspace.

Select Custom Point Cloud Source

See Also



Related Topics