Read 3-D point cloud from PLY or PCD file
Read Point Cloud from a PLY File
ptCloud = pcread('teapot.ply'); pcshow(ptCloud);
filename — File name
character vector | string scalar
File name, specified as a character vector or a string scalar. The input file type must be a PLY or a PCD format file.
The polygon (PLY) file format , also known as the Stanford triangle format stores three-dimensional data from 3-D scanners. It is a format for storing graphical objects that are described as a collection of polygons. A PLY file consists of a header, followed by a list of vertices and then, a list of polygons. The header specifies how many vertices and polygons are in the file. It also states what properties are associated with each vertex, such as (x,y,z) coordinates, normals, and color. The file format has two sub-formats: an ASCII representation and a binary version for compact storage and for rapid saving and loading. The header of both ASCII and binary files is ASCII text. Only the numeric data that follows the header is different between the two versions. See The PLY Format for details on the contents of a PLY file.
The point cloud data (PCD) file format also stores three-dimensional data. It was created by the authors of the widely used point cloud library (PCL) to accommodate additional point cloud data requirements. See The PCD (Point Cloud Data) file format.
This function only supports PCD file formats saved in version 0.7
(PCD_V7). It also only supports the header entries with the
COUNT entry set to
does not support the
COUNT entry set to a feature
ptCloud — Object for storing point cloud
Object for storing point cloud, returned as a
pointCloud object that contains
the following PLY or PCD fields:
Locationproperty, stores the x, y, and z values.
Colorproperty, stores the red, green, and blue values.
Normalproperty, stores the normal vectors for each point.
Intensityproperty, stores the grayscale intensity for each point.