Reading a Text

This code snippet shows how to read texts in an image.

C++

#include <eVision/EasyOcr/EasyDeepOCR/ETextReader.h>
using namespace eVision;
namespace EDO = eVision::EasyDeepOCR;
// Create an ETextReader instance
EDO::ETextReader reader;
// Initialize the ETextReader
reader.Initialize();
// Read an image
EImageBW8 image;
image.Load("image.tif");
std::vector<EDO::EText> texts = reader.Read(image);

C#

using eVision;
using EDO = eVision.EasyDeepOCR;
// Create an ETextReader instance
EDO.ETextReader reader = new EDO.ETextReader();
// Initialize the ETextReader
reader.Initialize();
// Read an image
EImageBW8 image = new EImageBW8();
image.Load("image.tif");
EDO.EText[] texts = reader.Read(image);

Python

import eVision
from eVision import EasyDeepOCR as EDO
# Create an ETextReader instance
reader = EDO.ETextReader()
# Initialize the ETextReader
reader.Initialize()
# Read an image 
image = eVision.EImageBW8()
image.Load("image.tif")
texts = reader.Read(image)