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.


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

    • Custom Point Cloud — To load point cloud data from a custom source, create a custom reader function and add it to your MATLAB path. In the Custom Reader Function box specify the path to the reader function, and in the Source Name box specify the path to the data folder.

      Import Custom Point Cloud 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

You can adjust the point cloud view using the x-, y-, z-axes at the bottom left corner of the point cloud pane.

Rotate point cloud using point cloud axes

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 Value

 Color Variation

 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

 Hide Ground

 View Clusters

Measure Point Cloud

Select the Measurements option from the app toolstrip. The app opens a Measurements tab. You can measure point cloud attributes such as distance, angle, and volume using the measurement tools in this tab.

Measurement tab

To measure an attribute of the point cloud, select a measurement tool on the app toolstrip, then interactively select points on the point cloud to return the corresponding measurement.

  • Distance — Measure the distance between any two points in the point cloud.

  • Elevation — Measure the elevation between any two points in the point cloud.

  • Location — Obtain the xyz-coordinates of a point.

  • Angle — Select three points on the point cloud to measure the angles of the triangle defined by the points.

  • Volume — Measure the volume inside a cuboid region on the point cloud. You can interactively adjust the limits and the size of the cuboid.

The app deletes all your measurements in the current signal when you exit the Measurements tab.

Keyboard Shortcuts

You can use these keyboard short cuts in the Measurements tab of the Lidar Viewer app.

  • Click Esc to undo your measurement tool selection.

  • Click R to enable rotation. You can use these controls in the rotate mode.

    ActionKeyboard ShortcutExample
    Move forward or backward

    w — Forward

    s — Backward

    Animation displaying forward, backward, left, and right movement.

    Move left or right

    a — Left

    d — Right

    Look around the scene (pitch/yaw rotation of the camera)

    Up arrow — Camera pitches up

    Down arrow — Camera pitches down

    Left arrow — Camera turns left in yaw

    Right arrow — Camera turns right in yaw

    Animation displaying the view in a scene using pitch and yaw capability.

    Roll the scene (roll rotation of the camera)

    q — Camera moves clockwise. (Scene appears to move counterclockwise.)

    e — Camera moves counterclockwise. (Scene appears to move clockwise.)

    Animation displaying the view in a scene using the roll capability.

    Rotate the scene (rotate the camera around the point cloud)

    Shift + Left or Right — Camera orbits horizontally around the point cloud. (Scene appears to stand still as camera moves externally around it horizontally.)

    Shift + Up or Down — Camera orbits vertically around the point cloud. (Scene appears to stand still as camera moves externally around it vertically.)

    Animation displaying the view with the camera rotating around a point capability.

    Zoom in or out

    z — Zoom in

    x — Zoom out

    Animation displaying the view in a scene using the zoom capability.

    Look at a view plane

    1 — XY

    2 — YX

    3 — XZ

    4 — ZX

    5 — YZ

    6 — ZY

    Camera positioned in the selected plane with a line of sight to the center of the plot.

    Animation displaying the view in a scene using view plane capability.

    Switch between rotate and pan Spacebar — Press and hold the spacebar to switch the interaction to pan. Release the spacebar to switch back to rotate.

    Animation displaying the view in a scene using the ability to switch between rotate and pan.

    Rotate in X-, Y-, and Z- dimensionsT — Adds rotate interaction in the third dimension.

    Animation displaying the view in a scene using the capability to rotate between the X-, Y-, and Z- dimensions.

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





 Ground Removal


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 new custom preprocessing algorithm or import an existing one into the app. Follow these steps to apply a custom preprocessing algorithm to your data.

  1. Click Add Algorithm. To apply your algorithm to only a single point cloud frame, select an option from the Spatial Algorithms section. To apply your algorithm to multiple point cloud frames, select an option from the Temporal Algorithms section.

  2. To create a new algorithm, select New. Select whether to create an algorithm using a Class Template or a Function Template. MATLAB opens a new MAT file that contains a code framework and directions to create your custom algorithm. With the template, you can also define user interface (UI) elements for parameter tuning. These UI elements appear in the Algorithm Parameters pane.

  3. To import your algorithm into the app, first select Add Algorithm and, in the Spatial Algorithms or Temporal Algorithms section, select From File. Then, select Import Class or Import Function. In the dialog box, select the file that contains the algorithm you want to import.

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

You can also export the history of edit operations to a function-based algorithm using Export To Function.

For more information on creating custom preprocessing workflows, see Create Custom Preprocessing Workflow with Lidar Viewer.

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.


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.


A Windows® OS machine must have WebGL™ 2 support for graphics rendering.

See Also




Related Topics