View Bitmap¶
This code snippet shows how to inspect the characters in a character database.
C++¶
#include <eVision/EasyOcr/EasyOCR2/EOCR2CharacterDatabase.h>
#include <eVision/EasyOcr/EasyOCR2/EOCR2.h>
using namespace eVision;
// Create an EOCR2 instance
EOCR2 ocr2;
// Load the character database
ocr2.AddCharactersToDatabase("database.o2d");
// Extract the character database
EOCR2CharacterDatabase db = ocr2.GetCharacterDatabase();
// Select the character that we are interested in (e.g. the third one)
EOCR2DatabaseCharacter chr = db.GetCharacter(2);
// Extract the bitmap for that character
EImageBW8 img = chr.GetBitmap();
C#¶
using eVision;
// Create an EOCR2 instance
EOCR2 ocr2 = new EOCR2();
// Load the character database
ocr2.AddCharactersToDatabase("database.o2d");
// Extract the character database
EOCR2CharacterDatabase db = ocr2.CharacterDatabase;
// Select the character that we are interested in (e.g. the third one)
EOCR2DatabaseCharacter chr = db.GetCharacter(2);
// Extract the bitmap for that character
EImageBW8 img = chr.Bitmap;
Python¶
import eVision
# Create an EOCR2 instance
ocr2 = eVision.EOCR2()
# Load the character database
ocr2.AddCharactersToDatabase("database.o2d")
# Extract the character database
db = ocr2.CharacterDatabase
# Select the character that we are interested in (e.g. the third one)
character = db.GetCharacter(2)
# Extract the bitmap for that character
img = character.Bitmap