Point Cloud Viewer
Libraries:
Computer Vision Toolbox /
Sinks
Description
The Point Cloud Viewer block creates a Point Cloud Viewer window to display a sequence of 3-D point cloud data that streams from a device such as a Microsoft® Kinect® or a lidar sensor. The Point Cloud Viewer block also provides simulation controls in the Point Cloud Viewer window to play, pause, and step through the streaming point cloud data sequence.
Features of Point Cloud Viewer
Playback control — Control streaming playback of a point cloud sequence using the Run, Step Forward, and Stop buttons.
Set axis limits — Limit the display of the 3-D point cloud data by setting the x-, y-, and z-axis limits.
Set background color — Set the background color of the viewer window against which to display of point cloud data.
Vertical axis direction control — Set the vertical axis direction of the point cloud data to upward-positive or downward-positive.
View plane control — Set the view plane to change the viewing angle of the point cloud data.
Analyze point cloud data — Inspect point cloud data using the Data Tips option on the axes toolbar of the Point Cloud Viewer window.
Examples
Visualize Point Cloud Sequence
Visualize a streaming point cloud sequence by using a Point Cloud Viewer block.
Ports
Input
Location — Positions of points in 3-D coordinate space
matrix | array
Positions of the points in 3-D coordinate space, specified as:
An M-by-3 matrix or M-by-N-by-3 array for a 3-D point cloud.
An M-by-3-by-T or M-by-N-by-3-by-T array for a sequence of 3-D point clouds, where T is the total number of 3-D point clouds in the point cloud sequence.
Each array specifies the x-, y-, and z- coordinates of a points in the point cloud, but the format differs between unorganized point cloud and organized point clouds.
For unorganized point clouds, you must specify Location as an M-by-3 or M-by-3-by-T array, where M is the total number of points, and each row provides the xyz-coordinates for a point.
For organized point clouds, you must specify Location as an M-by-N-by-3 or an M-by-N-by-3-by-T array, where M×N is the total number of points, and the third dimension of the array provides the x-, y-, and z-coordinates for the corresponding point. Projective cameras, such as a Kinect or a lidar sensor, store points as an organized point cloud. An organized point cloud is laid out as a 2-D or a 3-D array of points that resembles an image- or video-like structure.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| Simulink.ImageType
Color — Color of point cloud
[]
(default) | matrix | array
Point cloud color, specified as:
An M-by-3 matrix or M-by-N-by-3 array for a 3-D point cloud.
An M-by-3-by-T or M-by-N-by-3-by-T array for a sequence of 3-D point clouds, where T is the total number of 3-D point clouds in a point cloud sequence.
For an unorganized point cloud, specified as an M-by-3 matrix or M-by-3-by-T array, each row specifies the RGB color triplet for a point in the point cloud data. For an organized point cloud, specified as an M-by-N-by-3 or M-by-N-by-3-by-T array, each channel of the third dimension specifies the RGB color triplet for the corresponding point in the point cloud data. You can specify the same color for all points or a different color for each point.
For the
single
ordouble
data type, you must specify the Color RGB value in the range [0, 1].For the
uint8
data type, you must specify the Color RGB value in the range [0, 255].For the
uint16
data type, you must specify the Color RGB value in the range [0, 65535].
Note
Input to the Color port must have the same dimensions and data type as the input to the Location port.
Dependencies
To enable this port, select the File > Location and Color Port parameter.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| Simulink.ImageType
Parameters
File
Open at Start of Simulation — Open Point Cloud Viewer window at start of simulation
on
(default) | off
Select this parameter to display the Point Cloud Viewer window at the start of the simulation. Clear this parameter to prevent the Point Cloud Viewer window from opening at the start of the simulation.
Location Port — Enable point location as input
on
(default) | off
Select this parameter to enable the Location port for inputting the 3-D point cloud coordinates. If you select this parameter, the Location and Color Port parameter clears automatically.
Location and Color Port — Enable point location and color as input
off
(default) | on
Select this parameter to enable both the Location and Color input ports. If you select this parameter, the Location Port parameter clears automatically.
File > Configuration > Edit > Core
The Point Cloud Viewer Configuration dialog box enables you to change the behavior and appearance of the graphic user interface (GUI).
To open the Configuration dialog box and edit parameters, select File > Configuration > Edit.
The Core tab in the Configuration dialog box lists the general settings of the GUI.
In the Core tab, select
General UI
and click Properties to open the General UI Properties dialog box.
Display the full path — Display full path of source data in title bar
off
(default) | on
Select this parameter to display the model name and full path to the source data in the title bar of the Point Cloud Viewer window. If you clear this parameter, the window displays a shortened name.
Tools > Point Cloud Information
The Point Cloud Information dialog box displays information about the input point cloud sequence. This information includes Source type, Source name, Frame size, Source data type, and Display data type.
View
Bring All Point Cloud Viewer Windows Forward — Bring all Point Cloud Viewer windows to front of display
off
(default) | on
Select this parameter to bring all the Point Cloud Viewer windows forward, in front of all other open windows behind.
Simulation Toolbar — Show simulation toolbar
on
(default) | off
Select this parameter to show the simulation toolbar on the Point Cloud Viewer window.
To perform a relevant operation using the simulation toolbar, select the corresponding feature as described in the table.
Feature | Description |
---|---|
Run | Start the simulation, and view the point cloud sequence. |
Step Forward | Start the simulation, view one frame of the point cloud sequence, and pause. |
Stop | Stop the simulation. |
Highlight Simulink Block | Highlight the Point Cloud Viewer block with a blue background in the Simulink model. |
Snapshot (Freeze Display) | Freeze Point Cloud Viewer window to enable you take a snapshot of the window using the Print or Print Preview option in File menu. Note Unselect this option to return the Point Cloud Viewer window to an active state from a frozen state.
|
Settings | Enable the Settings pane on the Point Cloud Viewer window. |
Status Bar — Show status bar
on
(default) | off
Select this parameter to show the status bar on the Point Cloud Viewer window. The status bar, at the bottom of the Point Cloud Viewer window, shows this information about the point cloud sequence.
Dimension
Organization
Status of the window during simulation
Timestamp of the current frame
Highlight Simulink Block — Highlight Point Cloud Viewer block
off
(default) | on
Highlight the Point Cloud Viewer block in blue in the Simulink model.
Simulation
To access this parameter, select the Simulation menu in the Point Cloud Viewer window.
Run — View entire point cloud sequence
off
(default) | on
Select this parameter to start the simulation and view the point cloud sequence continuously from the first to the last frame. You can also perform this action by clicking Run on the simulation toolbar.
Continue — Continue viewing the point cloud sequence
off
(default) | on
Select this parameter to continue viewing the point cloud sequence till the last frame. To enable the Continue parameter, start the simulation by clicking Step Forward on simulation toolbar.
Stop — Stop viewing the point cloud sequence
off
(default) | on
Select this parameter to stop the display of the point cloud sequence. You can also perform this action by clicking Stop on the simulation toolbar.
Drop Frames to Improve Performance — Reduce frame rate of input point cloud sequence
on
(default) | off
Select this parameter to reduce the frame rate of the input streaming point cloud sequence to improve the performance of the simulation. If you clear this parameter, the block displays every frame in the input point cloud sequence signal during the simulation.
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
More About
Settings Pane
To display the Settings pane on the point cloud viewer window, click Settings on the simulation toolbar.
You can use the Settings pane to:
Set Axes Limits. The Point Cloud Viewer window does not display point cloud data outside these limits.
Xlimits — Range of x-axis coordinates, specified in the format [
minimum limit
,maximum limit
]. The default value for this parameter is [-50
,50
].Ylimits — Range of y-axis coordinates, specified in the format [
minimum limit
,maximum limit
]. The default value for this parameter is [-50
,50
].Zlimits — Range of z-axis coordinates, specified in the format [
minimum limit
,maximum limit
]. The default value for this parameter is [-5
,40
].
Set the Appearance of the point cloud data points in the Point Cloud Viewer window by adjusting the approximate diameter of the point marker using Marker Size. MATLAB® graphics defines the unit of measure as points. The default Marker Size value is
1
. A marker size larger than6
can reduce rendering performance.
Axes Toolbar Operations
Keyboard shortcuts are enabled only for the rotate (default) mode. To view the axes toolbar operations, point to the figure and select one of these options. Click the Restore View icon to reset the display.
Feature | Description | ||||||
---|---|---|---|---|---|---|---|
Vertical Axis | Select an X-, Y-, or Z-direction to set the direction of that axis of the point cloud as the positive vertical direction. Use the keyboard arrow keys to move the point cloud with respect to the direction selected. | ||||||
View Plane | Select the viewing angle of the point cloud figure as the XY, YX, XZ, ZX, YZ, or ZY plane. | ||||||
Background Color | Display a color chart from which you can select a background color. | ||||||
Axes On/Off | Turn the display axes on or off. | ||||||
Projection | Select perspective or orthogonal view. | ||||||
Export |
| ||||||
Brush | Enable data brushing mode. | ||||||
Data Tips | View the point data values of a point by selecting it in the point cloud figure. The Data Tips display shows the x, y, and z values of the points. Point clouds for depth images and lidar contain these additional data properties:
| ||||||
Rotate 3D | Drag to rotate the point cloud figure. You can also right-click any point on the point cloud figure and select Rotate Around a Point to specify that point as the center of rotation for the figure. To return to axes rotation, right-click again and select Rotate Around Axes Center. While in Rotate 3D mode, you can also select the color source for the point cloud by right-clicking anywhere in the point cloud figure and selecting Color Source, and then selecting an option from the list. The figure applies the active colormap to the point cloud based on the values in the selected source. For a point cloud of only position data, the Color Source options are X, Y, Z, and User Specified. Point clouds for depth image and lidar data include these additional color source options:
| ||||||
Pan, Zoom in, and Zoom out | Maneuver the point cloud in the figure, or zoom the point cloud figure in or out. | ||||||
Restore View | Restore the original view of the axes. |
Version History
Introduced in R2023a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)