Initializing the One-Line Recognition Class
Initialize an instance of the One-Line Recognition Class and prepare it for one-line recognition.
// Setting the Pattern Object
void msetpattern(CJocrPattern* pattern);
Input:
CJocrPattern* pattern; Initialized pattern object
// Setting the Recognition Object
void msetrecognize(CJocrRecognize* pjocrrecognize);
Input:
CJocrRecognize* pjocrrecognize; Initialized recognition object
Example:
#include "ocrdef.h"
#include "ocrco.h"
#include "cjocrstock.h"
#include "cjocrdict98.h"
#include "cjocrpat98.h"
#include "cjocrrec98.h"
#include "cjocrline98.h"
#include "errcode.h"
...
....
// Creating the Pattern Class
CJocrPattern* pattern = new CJocrPattern;
int ret = pattern->mallocmemory();
if (ret < 0) {
printf("Pattern Class Memory Allocation Error");
delete pattern;
exit(1);
}
// Creating the Dictionary Class
CJocrDict* pjocrdict = new CJocrDict;
pjocrdict->msetsystemdict("c:\\dic\\feature\\system");
pjocrdict->msetsystemdict("c:\\dic\\feature\\systemfat");
pjocrdict->msetuserdict("c:\\dic\\feature\\user");
ret = pjocrdict->mloaddict();
if (ret < 0) {
printf("Error");
delete pjocrdict;
delete pattern;
exit(1);
}
// Creating the Single-Character Recognition Class
CJocrRecognize* precognize = new CJocrRecognize;
precognize->msetpatter(pattern);
precognize->msetdict(pjocrdict);
// Initializing the Single-Character Recognition Class
ret = precognize->mallocmemory();
if (ret < 0) {
printf("Error");
delete precognize;
delete pjocrdict;
delete pattern;
exit(1);
}
// Creating the One-Line Recognition Class
CJocrLine* pjocrline = new CJocrLine;
pjocrline->msetpatter(pattern);
pjocrline->msetrecognize(precognize);
....
...
..
delete pjocrline;
delete precognize;
delete pjocrdict;
delete pattern;