# Reading Using EOCR2 Model File

This code snippet shows how to:

* Load a pre-made model file
* Read the text in an image

## C++

```cpp
#include <eVision/EasyOcr/EasyOCR2/EOCR2.h>
```

```cpp
using namespace eVision;
// Load an image
EImageBW8 image;
image.Load("image.tif");
// Attach an ROI
EROIBW8 roi;
roi.Attach(&image, 50, 224, 340, 96);
// Create an EOCR2 instance
EOCR2 ocr2;
// Load a pre-made model file, this will:
// - (re)set all parameters
// - add the character database in the model file to the EOCR2 instance
ocr2.Load("myModel.o2m");
// Read text from the image
EOCR2Text result = ocr2.Read2(roi);
```

## C#

```cs
using eVision;
```

```cs
// Load an image
EImageBW8 image = new EImageBW8();
image.Load("image.tif");
// Attach an ROI
EROIBW8 roi = new EROIBW8();
roi.Attach(image, 50, 224, 340, 96);
// Create an EOCR2 instance
EOCR2 ocr2 = new EOCR2();
// Load a pre-made model file, this will:
// - (re)set all parameters
// - add the character database in the model file to the EOCR2 instance
ocr2.Load("myModel.o2m");
// Read text from the image
EOCR2Text result = ocr2.Read2(roi);
```

## Python

```py
import eVision
# Load an image
image = eVision.EImageBW8()
image.Load("image.tif")
# Attach an ROI
roi = eVision.EROIBW8()
roi.Attach(image, 50, 224, 340, 96)
# Create an EOCR2 instance
ocr2 = eVision.EOCR2()
# Load a pre-made model file, this will:
# - (re)set all parameters
# - add the character database in the model file to the EOCR2 instance
ocr2.Load("myModel.o2m")
# Read text from the image
result = ocr2.Read2(roi)
```
