Main Content


Read 3-D point cloud from PLY or PCD file



ptCloud = pcread(filename) reads a point cloud from the PLY or PCD file specified by the input filename. The function returns a pointCloud object, ptCloud.


collapse all

ptCloud = pcread('teapot.ply');

Input Arguments

collapse all

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 1. It does not support the COUNT entry set to a feature descriptor.

Output Arguments

collapse all

Object for storing point cloud, returned as a pointCloud object that contains the following PLY or PCD fields:

  • Location property, stores the x, y, and z values.

  • Color property, stores the red, green, and blue values.

  • Normal property, stores the normal vectors for each point.

  • Intensity property, stores the grayscale intensity for each point.

Version History

Introduced in R2015a