Mastering 3D Computer Vision & Point Cloud Processing-Mod 14 — ASCII vs Bin on XYZ, PCD, PLY File Formats with Code

Rajavel PM (RPM)
5 min readMay 30, 2024

--

Introduction:

Welcome to the ✍️“3D Computer Vision & Point Cloud Processing Blog Series”. This series of blogs is your “Hands-on guide to mastering 3D point cloud processing with Python.”

In this post, we’ll delve into “ASCII and BIN difference on 3D XYZ, PCD, PLY and OBJ formats”.

Topics to Be Discussed in this Blog

  1. Intro to 3D Data File Formats
  2. On Point Cloud Data
  3. On Mesh Data
  4. On voxel Grid Data
  5. Summary

For more details about 3D Data types refer my previous blog and more about commonly used 3D File formats PLY, PCD, OBJ with Code refer my previous blog.

Intro to 3D Data File Formats

Below table explores the commonly used 3D file formats.

On Point Cloud Data

Point cloud data is commonly represented in three formats: XYZ, PCD, and PLY. Each format can be stored in either ASCII or binary format. Let’s explore the differences between these formats.

1. Bunny Point Cloud Data

The image below shows 3D bunny point cloud data from a single viewpoint.

Bunny Point Cloud Data

2. ASCII VS BIN on XYZ data

  • ASCII (American Standard Code for Information Interchange): This format uses human-readable text characters to represent the X, Y, and Z coordinates of each point. It is easy to edit but results in larger file sizes.
  • Binary: This format stores data in a compact, machine-readable (not readable by humans) format using fewer bytes.

3. ASCII VS BIN on PCD data

PCD (Point Cloud Data) is a file format specifically designed for storing point cloud data. It includes additional information beyond just XYZ coordinates, such as intensity values or color information. Similar to XYZ, PCD can be stored in either ASCII or binary format.

4. ASCII VS BIN on PLY data

PLY (Polygon File Format) is a more versatile format that can store various types of 3D data, including point clouds. It offers flexibility in defining additional data properties besides XYZ coordinates. Like the previous formats, PLY can be stored in ASCII or binary format.

5. Point Cloud comparison on different File formats

We can compare point cloud data stored in different file formats (e.g., XYZ, PCD, PLY) based on factors like:

  • Information Content: Does the format store only XYZ coordinates, or does it include additional information like intensity or color?
  • File Size: Binary formats generally offer smaller file sizes compared to their ASCII counterparts.
  • Processing Speed: Reading and processing data from binary formats is often faster than ASCII due to its compact nature.

In this illustration, we are considering File Size. The plot below shows the file size of the Bunny Point Cloud data in different file formats.

Analysis:

  1. Binary (BIN) format generally has the smallest file size.
  2. File size increases in the following order: PCD, PLY, and XYZ.
  3. Therefore, XYZ format has the largest file size among the mentioned formats and PCD format is the smallest one.

On Mesh Data

Mesh is commonly represented in three formats: PLY and OBJ. Each format can be stored in either ASCII or binary format. Let’s explore the differences between these formats.

1. Bunny Mesh Data

The image below shows 3D bunny Mesh data from a single viewpoint.

Bunny Mesh Data

2. ASCII VS BIN on PLY data

3. ASCII VS BIN on OBJ data

4. Mesh comparison on different File formats

We can compare Mesh data based on factors such as content, file size, processing speed, and visual features such as smoothness. In this illustration, we are considering File Size. The plot below shows the file size of the Bunny Mesh data in different file formats.

Analysis:

  1. Binary (BIN) format generally has the smallest file size.
  2. File size increases in the following order: PLY, and OBJ.

On voxel Grid Data

1. ASCII VS BIN on PLY data

1. voxel Grid comparison on different File formats

In this illustration, we are considering File Size. The plot below shows the file size of the Bunny Mesh data in different file formats.

Analysis:

  1. Binary (BIN) format has the more space as compared to ASCII format.

Summary

In this blog, we discussed overview of various 3D data file formats, including point cloud (XYZ, PCD, PLY), mesh (PLY, OBJ), and voxel grid data. We explored the file size differences between ASCII and binary formats for each category. We observed that,

File Size:

  • Binary (BIN) format consistently offers the smallest file size across point cloud (XYZ, PCD, PLY), mesh (PLY, OBJ), and potentially voxel grid data formats.

Point Cloud Formats:

  • File size increases in the order: PCD, PLY, XYZ.
  • PCD offers the advantage of storing additional information beyond XYZ coordinates (intensity, color).

Mesh Formats:

  • File size order increases: PLY, OBJ.

✨Happy exploring! Happy learning!✨

📝Next Blog Preview:

In the upcoming post, 🚀“Mastering 3D Computer Vision & Point Cloud Processing- Mod 15 — How to download and use 3D Datasets from Open3D with Code”.

Topics to Be Discussed in the Next Blog

  1. How to download Point Cloud, Mesh and voxel Grid dataset from Open3D and other opensource resources.

Topics to Be Discussed in the Upcoming Blogs — Immediate Focus

  • Summary about the Different datasets, datatypes and file formats
  • Different Point Cloud Basic operations

--

--

Rajavel PM (RPM)

A Computer Vision Engineer, working on 2D/3D Computer vision, 2D/3D Machine & Deep Learning, AI, Generative AI. Let's learn together. Join me!