Get Score

This code snippet shows how to get the score of a text line.

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);

// Get the score of the first ETextLine of the first returned EText
float lineScore = texts[0].GetLines()[0].GetScore();

// Get the score of the EText object itself
float textScore = texts[0].GetScore();

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);

// Get the score of the first ETextLine of the first returned EText
float lineScore = texts[0].Lines[0].Score;

// Get the score of the EText object itself
float textScore = texts[0].Score;

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)

# Get the score of the first ETextLine of the first returned EText
lineScore = texts[0].Lines[0].Score

# Get the score of the EText object itself
textScore = texts[0].Score