# Pattern Learning

This code snippet shows how to learn a pattern defined by a region of interest (ROI).

## C++

```cpp
#include <eVision/EasyFind/EPatternFinder.h>
```

```cpp
using namespace eVision;
// Image constructor
EImageBW8 srcImage;
// ROI constructor
EROIBW8 pattern;
// EPatternFinder constructor
EPatternFinder finder;
// ...
// Attach the ROI to the source image
// and set its position
pattern.Attach(&srcImage);
pattern.SetPlacement(214, 52, 200, 200);
// Learn the pattern
finder.Learn(&pattern);
```

#### SEE ALSO
[`EPatternFinder::Learn`](../../../../doxygen_cpp/classeVision_1_1EPatternFinder.html#aa9de4e652c3d71bc83dda008fcf9ecc1) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1EPatternFinder.html#aeee399ee9d9ba5e2d5e8b30094bd5bf3) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1EPatternFinder.html#a4c2c47cfc0bd7de1d0a02b3f03414d59)

## C#

```cs
using eVision;
```

```cs
// Image constructor
EImageBW8 srcImage = new EImageBW8();
// ROI constructor
EROIBW8 pattern = new EROIBW8();
// EPatternFinder constructor
EPatternFinder finder = new EPatternFinder();
// ...
// Attach the ROI to the source image
// and set its position
pattern.Attach(srcImage);
pattern.SetPlacement(214, 52, 200, 200);
// Learn the pattern
finder.Learn(pattern);
```

#### SEE ALSO
[`EPatternFinder.Learn`](../../../../doxygen_cs/classeVision_1_1EPatternFinder.html#aeee399ee9d9ba5e2d5e8b30094bd5bf3) [<sub>C++</sub>](../../../../doxygen_cpp/classeVision_1_1EPatternFinder.html#aa9de4e652c3d71bc83dda008fcf9ecc1) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1EPatternFinder.html#a4c2c47cfc0bd7de1d0a02b3f03414d59)

## Python

```py
import eVision
# Image constructor
src_image = eVision.EImageBW8()
# ROI constructor
pattern = eVision.EROIBW8()
# EPatternFinder constructor
finder = eVision.EPatternFinder()
# ...
# Attach the ROI to the source image
# and set its position
pattern.Attach(src_image)
pattern.SetPlacement(214, 52, 200, 200)
# Learn the pattern
finder.Learn(pattern)
```

#### SEE ALSO
[`EPatternFinder.Learn`](../../../../doxygen_python/classeVision_1_1EPatternFinder.html#a4c2c47cfc0bd7de1d0a02b3f03414d59) [<sub>C++</sub>](../../../../doxygen_cpp/classeVision_1_1EPatternFinder.html#aa9de4e652c3d71bc83dda008fcf9ecc1) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1EPatternFinder.html#aeee399ee9d9ba5e2d5e8b30094bd5bf3)
