# Loading an Unsupervised Segmenter and Segmenting an Image

This code snippet shows how to load a trained unsupervised segmenter and how to segment a new image.

## C++

```cpp
#include <eVision/EasyDeepLearning/EasySegment/EUnsupervisedSegmenterResult.h>
```

```cpp
using namespace eVision;
using namespace eVision::EasyDeepLearning;

// Image
EImageBW8 image;
image.Load("my_image_path");

// Segmenter
EUnsupervisedSegmenter segmenter;
segmenter.Load("segement_path");

// Apply the segmenter on the image
EUnsupervisedSegmenterResult r = segmenter.Apply(image);

// Retrieve the segmentation map
EImageBW8 segmentationMap = r.GetSegmentationMap();
```

## C#

```cs
using eVision;
using eVision.EasyDeepLearning;
```

```cs
// Image and segmenter constructor
EUnsupervisedSegmenter segmenter = new EUnsupervisedSegmenter();
EImageBW8 image = new EImageBW8();

// Load segmenter and image
segmenter.Load("segment_path");
image.Load("image_path");

// Apply the segmenter on the image
EUnsupervisedSegmenterResult result = segmenter.Apply(image);

// Retrieve the segmentation map
EImageBW8 segmentationMap = result.SegmentationMap;
```

## Python

```py
import eVision
from eVision import EasyDeepLearning as edl

# Image and segmenter constructor
segmenter = edl.EUnsupervisedSegmenter()
image = eVision.EImageBW8()

# Load segmenter and image
segmenter.Load("segment_path")
image.Load("image_path")

# Apply the segmenter on the image
result = segmenter.Apply(image)

# Retrieve the segmentation map
segmentation_map = result.SegmentationMap
```
