# Point Cloud Structure and Output Formats¶

## Organized point cloud¶

Zivid outputs an organized point cloud. This means that the point cloud is laid out as a 2D array of points that resembles an image like structure. An unorganized point cloud is generally stored as a list of points in a 1D array. In both cases, the XYZ data are provided for each point as well as the RGB values.

There are several advantages to this structure.

• Algorithms designed for unorganized point clouds work on organized as well, because a 2D array can be interpreted as a 1D array. This is not always true the other way around.

• Ordered point clouds have a 1:1 correlation between pixels in the 2D images (color and depth) and 3D points in the point cloud. This means that the neighboring pixels in the image are the neighboring points in the point cloud. This enables 2D operations and algorithms to be applied to the 2D image, while the result can be applied directly to the point cloud. For example, for object detection and segmentation, one can segment the 2D image and directly extract the 3D points from the desired pixels.

• The orderliness of points speeds up computation and lowering the cost of certain algorithms, especially operations using neighboring points.

## Zivid point cloud¶

Zivid cameras uses a sensor with 2.3 MP (1920 x 1200 for Zivid One+ and 1944 x 1200 for Zivid Two) to capture point clouds of a scene. Because of the 1:1 correlation between pixels and points, the generated point cloud consists of 2.3 million points. For every pixel, XYZ (mm), RGB (8-bit), and SNR can be provided, where SNR is the Signal-to-Noise Ratio. The data is stored as a matrix of shape [1920, 1200, 7] or [1944, 1200, 7] depending on the camera.

Color and depth image can be directly extracted from a Zivid point cloud. Examples of how to do this are shown in our GitHub repository.

## Zivid output formats¶

From Zivid Studio, you can save the point cloud in Zivid Data File (*.zdf). In addition, you can export the point cloud (File → Export) in the following formats:

• PLY file - Unordered points (*.ply)

• PLY file - Ordered points (*.ply)

• ASCII points (*.xyz)

• Point Cloud Data File - Unordered (*.pcd)

The Zivid Data File (*.zdf) is the native Zivid file format. If you are using the API, you can loop over the point cloud and save the X, Y, Z, R, G, B, and SNR data in whichever format you prefer. Check out our Samples to see how to read or convert Zivid data using C++, C#, Python, and MATLAB.

Tip

The easiest way to view a Zivid point cloud is to copy the ZDF file to your PC and use Zivid Studio. Alternatively, you could use the API to convert ZDF to PLY (or use our Python script) and use a 3D viewer, e.g. MeshLab or CloudCompare.

### ASCII points (*.xyz)¶

ASCII characters are used to store cartesian co-ordinates. XYZ are separated with white space. In our version, RGB values are also added for each point. Each new point is separated with a newline character. This file can be viewed in a regular text editor.