Main Content

pcread

Read 3-D point cloud from PLY or PCD file

Description

example

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

Examples

collapse all

ptcloud = pcread('teapot.ply'); pcshow(ptCloud);

Figure contains an axes object. The axes object contains an object of type scatter.

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)坐标,正常和颜色。文件格式具有两个子形式:ASCII表示和一个用于紧凑存储以及快速节省和加载的二进制版本。ASCII和二进制文件的标题是ASCII文本。在两个版本之间,仅遵循标题的数字数据有所不同。看The PLY Formatfor 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. SeeThe PCD (Point Cloud Data) file format.

Note

This function only supports PCD file formats saved in version 0.7 (PCD_V7). It also only supports the header entries with theCOUNTentry set to1. It does not support theCOUNTentry set to a feature descriptor.

Output Arguments

collapse all

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

  • Locationproperty, stores thex,y, andzvalues.

  • Colorproperty, stores the red, green, and blue values.

  • Normalproperty, stores the normal vectors for each point.

  • Intensityproperty, stores the grayscale intensity for each point.

在R2015a中引入