> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Contextualize point clouds

> Contextualize point clouds manually or using automated segmentation and object detection in CDF.

You can contextualize point clouds in two ways: by manually creating each object you want to contextualize or by leveraging the point cloud's segmentation. You must use both services to achieve a fully contextualized point cloud.

## Before you start

Make sure you have already uploaded the point cloud you want to contextualize.
For more information on uploading point clouds, see [Upload 3D models](/cdf/3d/guides/3dmodels_upload) or [Upload point clouds with Python SDK](/dev/3d/api_asset_centric/upload_pointcloud).

## Get started

Before contextualizing, you should filter and index the point cloud to generate tiles that you can use for object detection and accelerate the contextualization process.

It's an automated process triggered by selecting the filter icon in your model's action column.

<Steps>
  <Step title="Filter and index the point cloud">
    1. Select the point cloud model and select `...` > <Icon icon="funnel" /> **Filtering and indexing**.

    2. In the wizard, select the check box to generate tiles.

    3. Select **OK** to start the process.

    Once the filtering and indexing are processed, trigger the object detection. The **Run classification** <Icon icon="wand-sparkles" /> icon will now be enabled.
  </Step>

  <Step title="Run the point cloud object detection">
    1. Select `...` > **Run classification**.
    2. Enable both **Classification** and **Pipe detection**.
    3. Select **Run**.

    Classification will perform semantic segmentation of the point cloud, while pipe detection will detect segments in the point clouds that resemble pipes.
  </Step>
</Steps>

Once an object is detected, you will see an orange tag on the right, *suggested annotations* indicating how many objects were detected.

## Contextualize

Once the filtering and detecting objects are ready, select the point cloud file, and select **Open** to start the contextualization process. This opens the point cloud, and you can contextualize within the 3D environment window.

### Tools in contextualization

In the top navigation bar, there is a drop-down menu for all the suggestions. These are suggestions for classifications and pipes. After contextualizing, you will see a drop-down for all the contextualized objects.

Use slicing <Icon icon="slice" /> to get a better overview of the model you are contextualizing. For example, you can slice your viewpoint below ceiling height.

* You can turn on and off the highlights of the different suggestions of object types from the drop-down. To focus on contextualizing one object type at a time, select **Toggle annotation visibility** <Icon icon="box" /> in the toolbar on the left to turn off the highlight for all other suggestions.

* Select the crop box icon to create crop boxes and slice planes. You can create:
  * A vertical slice along the X and Y direction.
  * A vertical slice by selecting two points.
  * A horizontal slice by selecting a point.
  * A crop box by selecting four points.

* Turn on and off X, Y, and Z axis directions using **Show or hide axis** in the toolbar.

* Use the **Settings** <Icon icon="settings" /> icon to adjust the coloring of the points in the model.

* You can also color the model by classification. Use the filter <Icon icon="funnel" /> icon from the left toolbar. Enable **View classification** to view all or a selection of the classifications.

* Select **Fit to view** <Icon icon="expand" /> to reorient yourself and reposition the camera view outside the model.

* When you start the contextualization, you will see that the cursor <Icon icon="mouse-pointer" /> icon is activated and blue. Use **Select Annotation** to select any detected object and annotations.

* Select **+** (**Add annotation**) to add an annotation in the point cloud.

* After adding an annotation, in the resource selector, use the <Icon icon="funnel" /> **Filters** to refine the results. Use <Icon icon="columns-2" /> to sort and select columns. You can sort by name, object type, location and more. See [Search](/cdf/explore/search) for more information.

* To zoom an annotation, select **Zoom to annotation**.

## Contextualize automatically detected objects

To link an object to another asset:

<Steps>
  <Step title="Find the object you want to contextualize">
    Navigate to **Suggestions** in the top bar and select an object.
  </Step>

  <Step title="Relink the object">
    In the resource selector on the top right, select **Relink**.
  </Step>

  <Step title="Find the asset you want to map to the selected object">
    Use the search bar in the resource selector.
  </Step>

  <Step title="Link the asset">
    Select the asset, verify it is correct, and select **+ Add**.

    You have contextualized the object. The annotation count and contextualization count show how many objects you annotated.
  </Step>
</Steps>

## Contextualize undetected objects

Point clouds are sets of data points in a three-dimensional coordinate system. Each point in the cloud represents a specific position in space and can contain additional information like color or intensity. This means a point is not related to nearby points, and some objects might not be recognized. To contextualize a group of points as an object, you draw a shape around the points and contextualize that shape.

To contextualize an undetected object:

<Steps>
  <Step title="Add an annotation in the point cloud">
    1. Use the <Icon icon="box" /> icon to add an annotation in the point cloud.

    2. Select **+** (**Add annotation**) from the toolbar on the left.
  </Step>

  <Step title="Select the location">
    In the model, select where you want to contextualize the object.
  </Step>

  <Step title="Adjust the cube to fit the object">
    A blue cube will appear in the 3D view. To adjust the cube, use either:

    * **Translate (T)** will move the cube in the x, y, and z directions.
    * **Rotate (R)** will rotate the cube.
    * **Scale (G)** will scale the size of the box.
  </Step>

  <Step title="Find the asset you want to map to the selected object">
    After creating the shape, you can use the resource selector on the right to map an asset to the selected object. Use the search bar to find an existing asset.
  </Step>

  <Step title="Link the asset">
    Select the asset, verify it is correct, and select **+ Add**.
  </Step>

  <Step title="Create the annotation">
    Select **Create annotation** in the toolbar at the bottom of the screen.
  </Step>
</Steps>

## Update or delete annotation

In point clouds, you have a 1:1 relationship between assets and objects. This means you can only link one asset to a detected object. You can relink, update, or delete an annotation.

### Relink the object to a different asset

<Steps>
  <Step title="Select the annotated object">
    Use the cursor tool and select the annotated object.
  </Step>

  <Step title="Start relinking">
    Select **Relink** in the top right of the resource selector.
  </Step>

  <Step title="Search for the asset">
    Search for the asset you want to map to the selected object.
  </Step>

  <Step title="Link the asset">
    Select **+ Add**.

    You have updated the annotation.
  </Step>
</Steps>

### Delete annotation

To delete the annotation using **Annotations**:

<Steps>
  <Step title="Open Annotations">
    Open the **Annotations** dropdown.
  </Step>

  <Step title="Find the asset to delete">
    Search for the asset you want to delete. Hover over each annotation to see the highlighted objects.
  </Step>

  <Step title="Delete the annotation">
    Select <Icon icon="trash-2" /> to delete the annotation.

    You have deleted the annotation.
  </Step>
</Steps>
