Main Content

Get Started with Lidar Viewer

Use the Lidar Viewer app to view, analyze, and perform preprocessing operations on lidar data. Use the app to prepare data for advanced workflows like labeling, segmentation, and calibration.

Lidar Viewer App Session

This topic provides an overview of the app workflow and underlying features. To open the app, at the MATLAB® command prompt, enter this command.

lidarViewer

Alternatively, you can open the app from the Apps tab, under Image Processing and Computer Vision.

Load Data

The Lidar Viewer app can import pointCloud objects from the workspace and read point cloud data from PLY, PCAP, LAS, LAZ, PCD, and rosbag files. You can load lidar data from multiple sources at once. Use this process to load data into the app:

  • On the app toolstrip, select Import > From File. Choose a data source from the list.

  • In the Import dialog box that appears, specify the location of the point cloud data from the selected data source.

    • Point Cloud Sequence — In the Provide path to a folder containing PCD/PLY file(s) box, specify the path to the folder containing your point cloud data. Alternatively, select Browse, browse to the folder containing your data, and then select Select Folder.

    • Velodyne Lidar — For Velodyne® lidar data, select the device model name from the Device Model list. In the Provide path to a calibration file box, specify the path to the calibration file of the sensor.

      Import Velodyne Lidar dialogue box

    • LAS/LAZ File— In the Provide path to a LAS/LAZ file box, specify the path to the folder containing your point cloud data. Alternatively, select Browse, browse to the folder containing your data, and then select Select Folder.

    • Rosbag — For rosbag files, select the topics that contain point cloud data from the Point Cloud Topics list. To load data from a rosbag file, you must have a ROS Toolbox license.

      Import Rosbag dialogue box

  • Alternatively, select Import > From Workspace on the app toolstrip. In the Import From Workspace dialog box that appears, select the variables/ objects from the workspace you want to import.

    Import Workspace dialogue box

The app loads and plots point cloud data in the Point Cloud Display pane.

Data Visualization

The Lidar Viewer app organizes loaded data, based on the order you import it, as a list in the Data Browser pane. To delete the imported data, right click on the data you want to delete and select Delete Data.

Data Browser pane

Select the data that you want to visualize. The metadata of the point cloud populates in the Point Cloud Information pane. The information and fields change based on the data source and available metadata.

Point Cloud Information pane

The visualization pane displays the point cloud data along with playback controls in the Playback Slider.

Point Cloud Display and Playback Slider

The Playback Slider pane contains a slider that indicates your current position in the point cloud sequence, as well as buttons to control the playback of the point cloud data. The buttons, from left to right, are:

  • First Frame

  • Previous Frame

  • Play

  • Next Frame

  • Last Frame

If you select Play, the Play button becomes the Pause button, and all the playback controls except Pause are disabled.

For point cloud data with timestamp information such as PCAP, rosbag files, the app displays start time, current time, and end time on the Playback Slider pane.

Playback Slider with timestamps

Color Controls

Lidar Viewer provides various visualization features to analyze point cloud data. The app uses color to visualize more details about the displayed point cloud.

Color section on app toolstrip

You can control the color of the displayed point cloud by using these options in the Color section of the app toolstrip:

 Colormap

 Colormap Value

 Point Size

 Background Color

Camera View Options

Visualize section

The app provides various predefined camera angles for viewing the point cloud data, as well as the option to create custom views:

 XY View

 YZ View

 XZ View

 Bird's Eye View

 Chase View

 Ego View

 Ego Direction

 Custom Views

 Restore Default View

Edit Point Cloud

Apply preprocessing operations to a point cloud by selecting on the Edit Point Cloud from the app toolstrip. The app opens the Edit tab. This tab retains the color and visualization features present in the Lidar Viewer tab . You can select built-in preprocessing operations from the Algorithm section of the toolstrip:

Algorithm and Finalize sections

 Denoising

 Downsampling

 Filtering

 Cropping

 Ground Removal

 Organizing

After selecting an algorithm, the app populates the Algorithm Parameters pane with the corresponding tunable parameters.

Algorithm Parameters

Algorithm Parameters pane

The Lidar Viewer app dynamically updates the point cloud as you tune the parameters, enabling you to see the results in realtime. Select Apply All Frames to apply the algorithm to all the frames in the data source. After tuning your parameters select OK. The History pane records all preprocessing operations applied to the current frame. You can apply the same algorithm multiple times on the data using OK. Select Cancel to exit the edit algorithm.

Preprocessing History panel

You can discard all applied algorithms by selecting Discard Operations. You can also export the selected preprocessing steps and the parameters, as a function by selecting Export To Function. The app creates a MAT file containing your custom preprocessing function. The function accepts a pointCloud object as input and outputs the processed pointCloud object.

Custom Preprocessing Algorithms

Add Algorithm drop-down

You can create a custom preprocessing algorithm and import it into the app. The app provides a blueprint for creating a class-based algorithm definition. Click Add Algorithm and select Create Custom Edit from the list. MATLAB opens a new MAT file that contains boilerplate code and directions to create a class-based definition for your custom algorithm. You can also define user interface (UI) elements for parameter tuning. These UI elements appear in the Algorithm Parameters pane. After creating the algorithm definition, select Add Algorithm > Import Edit to import the algorithm into the app.

You can also import previously exported preprocessing functions by selecting Add Algorithm > Import Function. You can use this workflow to save and reuse preprocessing steps.

To finalize your edits to the point cloud and return to the Lidar Viewer tab, on the app toolstrip, select Accept.

Export Point Cloud

You can export point clouds as PCD or PLY files. After processing your point clouds, on the app toolstrip, select Export Point Cloud. Lidar Viewer opens the Export Point Cloud dialog box.

Export Point Cloud dialog box

Select the point clouds you want to export. Then, in the Provide path to the destination folder text box, specify or browse to the destination folder.

Note

If the input point cloud data is in PLY format, the app exports it as a PLY file. If you load input data of any other format, the app exports them as PCD files.

See Also

Apps

Functions

Objects