Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

pctransform

Rigid transform of 3-D point cloud

Syntax

ptCloudOut = pctransform(ptCloudIn,tform)

Description

example

ptCloudOut = pctransform(ptCloudIn,tform) applies the specified forward rigid transform to the input point cloud.

Examples

collapse all

Read a point cloud.

ptCloud = pcread('teapot.ply');

Plot the original data.

figure
pcshow(ptCloud); 
xlabel('X');
ylabel('Y');
zlabel('Z');

Create a transform object with a 45 degrees rotation along the z -axis.

A = [cos(pi/4) sin(pi/4) 0 0; ...
     -sin(pi/4) cos(pi/4) 0 0; ...
     0 0 1 0; ...
     0 0 0 1];
tform = affine3d(A);

Transform the point cloud.

ptCloudOut = pctransform(ptCloud,tform);

Plot the transformed point cloud.

figure
pcshow(ptCloudOut);
xlabel('X');
ylabel('Y');
zlabel('Z');

Input Arguments

collapse all

Point cloud, specified as a pointCloud object.

3-D affine geometric transformation, specified as a rigid transform affine3d object. The tform input must be a valid rigid transform (rotation and translation only). See Using a Transformation Matrix (Image Processing Toolbox), for details on how to set up the tform object.

Output Arguments

collapse all

Transformed point cloud, returned as a pointCloud object. The transformation applies to the coordinates of points and their normal vectors.

Introduced in R2015a