# Point Clouds and Cloud Compare

Cloud Compare is a free software for working with point clouds.

{% hint style="info" %}
The following videos are edited from recordings of ABPL90422 - SI\_LAB, some of the terms will be subject-specific but should still be demonstrative to the workflow as a whole.
{% endhint %}

***

## Cloud Compare

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Cloud Compare Download</strong></td><td><a href="https://www.cloudcompare.org/">https://www.cloudcompare.org/</a></td></tr></tbody></table>

***

## Introduction, Basics & Navigation

{% embed url="<https://youtu.be/5zscbmyiGec>" %}

### Navigation

**A mouse is recommended.**

\[LMB] to rotate, \[RMB] to pan, \[Scroll] to zoom.\
Use the left-menu to assist in navigation with various views and options. \
Use the magnifying glass to focus on a selected point cloud.

\[Alt + Scroll] Change point size.

### Project Hierarchy

Entities are organised in a folder-like structure - \[RMB] to create empty folders to keep your workspace organise. Each entity has its own properties, adjust its colour-mode, display point-size and any attached scalar data.

### NO UNDO

**CloudCompare does not have an undo feature**, the trade-off being it is a fast and efficient for how large of a dataset it can handle.

### Saving

There are two save processes:

**Save Single Entity (single disc icon):** For saving or converting a single entity inside the project hierarchy.&#x20;

**Savve Multiple Entity (multiply disc icon):** For saving the whole project (select all and save as a .bin file), or for exporting combined entities.

***

## Segmentation

{% embed url="<https://youtu.be/7DOrB2kLlXc>" %}

Use the segmentation or section tools to split up your point cloud data.\
Segmentation is mainly used for cleaning your dataset. You may have to go through various segmentations to find a clean camera angle to remove data.

***

## Rendering

{% embed url="<https://youtu.be/2j3eO15eYk0>" %}

### Settings

You have limited control over the visual settings of Cloud Compare in the Display Menu, here are some of the main, but not comprehensive list:

**Display Settings:**

1. Colours and Materials: adjust the look of the background and light (limited)
2. Other Options: there is an option to Draw Rounded Points, as opposed to the default pixel points.

**Camera Settings:**

Affects the camera - adjust the field of view and clipping depths (hide closer than or farther than points).

**Lights:**

Turn off and on sunlight (fixed location).

Turn off and on a single custom light - this light can be moved around with CTRL + Right Click

### Viewports

Camera locations can be saved via Display > Save Viewport

This will create a viewport object in your hierarchy, in its properties you may apply the viewport to commit it to view, or update to overwrite it with the current camera location.

### Image Captures

Display > Render to File

Renders a high resolution screenshot of the current viewport.

Choose a save location, scaling, and whether to hide or show UI elements.

### Capturing Videos

Setup viewport objects as keyframes.

Select all viewport objects and go to Plugins > Animation.

### Importing other Assets

For a unified point cloud style, you can import common mesh formats (.ply, .obj, etc.) into Cloud Compare and subsample them:

1. Edit > Mesh > Sample Points.
2. Adjust end point count.
3. Choose your colour source to match your source data.
4. Remember to hide the mesh object afterwards.

***

## Meshing

We have a whole page dedicated to explaining this meshing process here, but the quick steps are below:

{% content-ref url="/pages/RIOaF6mQsLkzu4rHHioY" %}
[Point Clouds to Meshes](/next-lab/3d-scanning/guides/working-with-3d-scan-data/point-clouds-to-meshes.md)
{% endcontent-ref %}

### Normal Estimation

For each point cloud, calculate Normals.&#x20;

1. Edit > Normals > Compute
   1. Select the appropriate surface model:
      1. Plane is good at evening out noise, but tends to smooth our sharp corners
      2. Triangulation is good at preserving sharp corners, but will maintain noisy features
      3. Quadratic is used only for smooth curvilinear forms
   2. Use **Scan Grids** where possible
   3. Check point clouds via the 'Normals' tag in the Properties - the 'back' should appear as black when sunlight is on (toggle sunlight with F6).
2. Merge all point clouds into one.

{% embed url="<https://youtu.be/HdBwvlMo1iM>" %}

Use surface reconstruction to re-create meshes. Ensure the Density option is toggled to be use the Scalar Field to extract the final mesh.

***

## Classification

There are some plugins within Cloud Compare for classifying point clouds - the separation of its contents based on some pre-trained models, it uses statistics on geometric details to separate the point cloud into different sections, for example, vegetation and hard surfaces. They are not foolproof nor 100% accurate as it is dataset and model dependent.

#### Canupo Plugin

1. Firstly, prep, clean and merge the dataset.
2. Plugins>Canupo>Classify
3. Load a model, can be found through here:
   * [CANUPO (plugin) - CloudCompare wiki](https://www.cloudcompare.org/doc/wiki/index.php/CANUPO_\(plugin\)) &#x20;
4. There are options to use the original cloud, a subsampled cloud (for speed), and to output additional metadata from the classification.
5. Once classified, different classes (segments) are represented by an ID number in the Scalar Field properties of the cloud.
6. Filter using scalar field operations.

<figure><img src="/files/EE8Zpl3mBewlZEWD1eHk" alt=""><figcaption><p>Vegetation separation.</p></figcaption></figure>

***

## Aligning

{% embed url="<https://youtu.be/lRQtP_ndy5E>" %}

Use the transformation tools to roughly place two point clouds in space.\
Alternatively, use point pairs picking (Tools > Registration > Align (point pairs))\
\
The Fine Registration alignment algorithm (ICP), works best on datasets that overlap a lot, so you may have to extract out sections to work with.

Run ICP (Tools > Registration > Fine Registration ICP), organise carefully:

* **Reference data | YELLOW - this will not move, it is the already aligned object**
* **Data to align | RED - this will move, it is the object TO BE ALIGNED**

Use the transformation matrix provided in the result to transform the rest of your dataset.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ms-kb.msd.unimelb.edu.au/next-lab/3d-scanning/guides/working-with-3d-scan-data/point-clouds-and-cloud-compare.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
