2018-01-02:The PCD (Point Cloud Data) file format

The pcd file format are as below, this is a generated pcd file format:

# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS x y z
SIZE 4 4 4
TYPE F F F
COUNT 1 1 1
WIDTH 5
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 5
DATA ascii
0.35222197 -0.15188313 -0.10639524
-0.3974061 -0.47310591 0.29260206
-0.73189831 0.66710472 0.44130373
-0.73476553 0.85458088 -0.036173344
-0.46070004 -0.2774682 -0.91676188

Now, let’s break down it piece by piece.
1. The first part:

# .PCD v0.7 - Point Cloud Data file format

This line shows that pcd file format in PCL library should be version 0.7


2. The second part:

VERSION 0.7
FIELDS x y z
SIZE 4 4 4
TYPE F F F
COUNT 1 1 1
WIDTH 5
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 5
DATA ascii

Each PCD file contains a header that identifies and declares certain properties of the point cloud data stored in the file. The header of a PCD must be encoded in ASCII.
VERSION:specifies the PCD file version
FIELDS:specifies the name of each dimension/field that a point can have
SIZE:specifies the size of each dimension in bytes
TYPE:specifies the type of each dimension by I or U or F
COUNT:specifies how many elements does each dimension have, if COUNT is not present, all dimensions’ count is set to 1
WIDTH:specifies the width of the point cloud dataset in the number of points. WIDTH has two meanings.

  • it can specify the total number of points in the cloud (equal with POINTS) for unorganized datasets;
  • it can specify the width (total number of points in a row) of an organized point cloud dataset.

HEIGHT:specifies the height of the point cloud dataset in the number of points. HEIGHT has two meanings.

  • it can specify the height (total number of rows) of an organized point cloud dataset;
  • it is set to 1 for unorganized datasets (thus used to check whether a dataset is organized or not).

VIEWPOINT:specifies an acquisition viewpoint for the points in the dataset. The viewpoint information is specified as a translation (tx ty tz) + quaternion (qw qx qy qz). The default value is:

  • VIEWPOINT 0 0 0 1 0 0 0

POINTS:specifies the total number of points in the cloud.As of version 0.7, its purpose is a bit redundant, so we’re expecting this to be removed in future versions.
DATA:specifies the data type that the point cloud data is stored in. As of version 0.7, two data types are supported: ascii and binary.


3. The third part:

0.35222197 -0.15188313 -0.10639524
-0.3974061 -0.47310591 0.29260206
-0.73189831 0.66710472 0.44130373
-0.73476553 0.85458088 -0.036173344
-0.46070004 -0.2774682 -0.91676188

As of version 0.7, the .PCD file format uses two different modes for storing data:

  • in ASCII form, with each point on a new line:
p_1
p_2
p_3
p_4
...
p_n
  • in binary form, where the data is a complete memory copy of the pcl::PointCloud.points array or vector. On Linux systems, we use mmap or munmap operations for the fastest possible read/write access to the data.

你可能感兴趣的:(2018-01-02:The PCD (Point Cloud Data) file format)