pcshowpair

Visualize difference between two point clouds

Description

example

pcshowpair(ptCloudA,ptCloudB) creates a visualization depicting the differences between the two input point clouds. The differences are displayed using a blending of magenta for point cloud A and green for point cloud B.

pcshowpair(ptCloudA,ptCloudB,Name,Value) visualizes the differences using additional options specified by one or more Name,Value pair arguments.

ax = pcshowpair(___) returns the plot axes to the visualization of the differences, using any of the preceding syntaxes.

Examples

collapse all

Load two point clouds that were captured using a Kinect device in a home setting.

load('livingRoom');

pc1 = livingRoomData{1};
pc2 = livingRoomData{2};

Plot and set the viewpoint of point clouds.

figure
pcshowpair(pc1,pc2,'VerticalAxis','Y','VerticalAxisDir','Down')
title('Difference Between Two Point Clouds')
xlabel('X(m)')
ylabel('Y(m)')
zlabel('Z(m)')

Input Arguments

collapse all

Point cloud A, specified as a pointCloud object. The function uses levels of magenta to represent ptCloudA and a pure magenta when the point cloud contains no color information.

Point cloud B, specified as a pointCloud object. The function uses levels of green to represent ptCloudB and a pure green when the point cloud contains no color information.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'VerticalAxisDir','Up' sets the vertical axis direction to up.

Approximate diameter of the point marker, specified as the comma-separated pair consisting of 'MarkerSize' and a positive scalar. The units are in points. A marker size larger than six can reduce the rendering performance.

Vertical axis, specified as the comma-separated pair consisting of 'VerticalAxis' and 'X', 'Y', or 'Z'. When you reload a saved figure, any action on the figure resets the vertical axis to the z-axis.

Vertical axis direction, specified as the comma-separated pair consisting of 'VerticalAxisDir' and 'Up' or 'Down'. When you reload a saved figure, any action on the figure resets the direction to the up direction.

Output axes, specified as the comma-separated pair consisting of 'Parent' and an axes graphics object that displays the point cloud visualization.

Note

You cannot set the value of 'Parent' to a UIAxes object (created using the uiaxes function).

Output Arguments

collapse all

Plot axes, returned as an axes graphics object. Points with NaN or Inf coordinates are not displayed.

You can set the default center of rotation for the point cloud viewer to rotate around the axes center or around a point. Set the default behavior from the Computer Vision Toolbox Preferences.

Tips

  • To improve performance, pcshowpair automatically downsamples the rendered point cloud during interaction with the figure. The downsampling occurs only for rendering the point cloud and does not affect the saved points.

  • To view point data or modify color display values, hover over the axes toolbar and select one of the following options.

    FeatureDescription
    Datatip

    Click Data Tips to view the data point values for any point in the point cloud figure. For a normal point cloud, the Data Tips displays the x,y,z values. Additional data properties for the depth image and lidar are:

    Point Cloud DataData Value Properties
    Depth image (RGB-D sensor)Color, row, column
    LidarIntensity, range, azimuth angle, elevation angle, row, column

    Background color

    Click Rotate and then right-click in the figure for background options.

    Colormap value

    Click Rotate and then right-click in the figure for colormap options. You can modify colornap values for the coordinate and range values available, depending on the type of point cloud displayed.

    View

    Click Rotate to change the viewing angle of the point cloud figure to the XZ, ZX,YZ, ZY, XY, or the YX plane. Click Restore View to reset the viewing angle.

  • pcshowpair supports the 'opengl' option for the Renderer figure property only.

Introduced in R2015b