Main Content

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 moreName,Valuepair 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)')

Figure contains an axes object. The axes object with title Difference Between Two Point Clouds contains 2 objects of type scatter.

Input Arguments

collapse all

Point cloud A, specified as apointCloudobject. The function uses levels of magenta to representptCloudAand a pure magenta when the point cloud contains no color information.

Point cloud B, specified as apointCloudobject. The function uses levels of green to representptCloudBand a pure green when the point cloud contains no color information.

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

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

Approximate diameter of the point marker, specified as a positive scalar. The units are in points. A marker size larger than six can reduce the rendering performance.

Background color, specified as an RGB triplet, hexadecimal color code, or a character vector that specifies a long or short color name.

Vertical axis, specified as'X','Y', or'Z'. When you reload a saved figure, any action on the figure resets the vertical axis to thez-axis.

Vertical axis direction, specified as'Up'or'Down'. When you reload a saved figure, any action on the figure resets the direction to the up direction.

Axes on which to display the visualization, specified as anAxesobject. To create anAxesobject, use theaxesfunction. To display the visualization in a new figure, leave'Parent'unspecified.

Output Arguments

collapse all

Plot axes, returned as anaxesgraphics object. Points withNaNorInfcoordinates 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 theComputer Vision Toolbox Preferences.

Tips

  • To improve performance,pcshowpairautomatically 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.

  • 观点或修改数据color display values, hover over the axes toolbar and select one of the following options.

    Feature Description
    Datatip

    ClickData Tipsto view the data point values for any point in the point cloud figure. For a normal point cloud, theData Tipsdisplays thex,y,zvalues. Additional data properties for the depth image and lidar are:

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

    Background color

    ClickRotateand then right-click in the figure for background options.

    Colormap value

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

    View

    ClickRotateto change the viewing angle of the point cloud figure to theXZ,ZX,YZ,ZY,XY, or theYXplane. ClickRestore Viewto reset the viewing angle.

  • pcshowpairsupports the'opengl'option for theRendererfigureproperty only.

Version History

Introduced in R2015b