# Easy3DMatchPointCloudMerger

| Support            | ![](assets/images/sample_programs/applies_to/cpp.svg) ![](assets/images/sample_programs/applies_to/cs.svg)   |
|--------------------|--------------------------------------------------------------------------------------------------------------|
| Required licenses  | **Easy3DMatch**                                                                                              |
| Recommended images | The images from the folder `Sample Images/3D/Easy3DMatch/E3DMatchPointCloudMerger`                           |
| Location           | `3D Processing/Easy3DMatchPointCloudMerger`                                                                  |

## Purpose

This sample program demonstrates how to:

- Merge several point clouds by using a calibration procedure with a specific object.

![](assets/images/sample_programs/3d_processing_easy3dmatchpointcloudmerger.webp)

## Code highlights

Use the recommended images:

- Calibration: the 4 `calibration_*` files.
- Sample: either the 4 `object2_*` or the 4 `shoe_*` files.

1. Calibrate the merger from the calibration clouds.
   * You must indicate the size of the calibration cube in the clouds.
   * A calibration error is returned.

   ```c++
   float error = merger_.Calibrate(calibrationClouds_, cubeSize, true);
   ```
2. Merge the calibration clouds in a single cloud representing the calibration object.

   #### NOTE
   This is optional and it is done in the sample program for visualization purposes.

   ```c++
   merger_.Merge(calibrationClouds_, mergedCalibration_);
   ```
3. Merge the sample clouds in a single cloud representing the sample object.
   ```c++
   merger_.Merge(sampleClouds_, mergedSamples_);
   ```
