#include "blobclass.h"
#include "extract.h"
#include "efio.h"
#include "featdefs.h"
#include "callcpp.h"
#include "chartoname.h"
#include <math.h>
#include <stdio.h>
#include <signal.h>
Go to the source code of this file.
Include Files and Type Defines
Definition at line 33 of file blobclass.cpp.
| #define TRAIN_SUFFIX ".tr" |
Public Code
Definition at line 52 of file blobclass.cpp.
71 #define TRAIN_SUFFIX ".tr"
72 static FILE *FeatureFile =
NULL;
77 if (CurrFontName == kUnknownFontName) {
80 const char *basename = strrchr(filename.
string(),
'/');
81 const char *firstdot = strchr(basename ? basename : filename.
string(),
'.');
82 const char *lastdot = strrchr(filename.
string(),
'.');
83 if (firstdot != lastdot && firstdot !=
NULL && lastdot !=
NULL) {
85 CurrFontName = firstdot;
86 CurrFontName[lastdot - firstdot] =
'\0';
92 if (FeatureFile ==
NULL) {
94 FeatureFile =
Efopen(Filename.string(),
"wb");
95 cprintf(
"TRAINING ... Font name = %s\n", CurrFontName.
string());
98 LearnBlob(FeatureDefs, FeatureFile, Blob, denorm, BlobText,
FILE * Efopen(const char *Name, const char *Mode)
const char * string() const
char * classify_font_name
void LearnBlob(const FEATURE_DEFS_STRUCT &FeatureDefs, const STRING &filename, TBLOB *Blob, const DENORM &denorm, const char *BlobText)
void cprintf(const char *format,...)
| void LearnBlob |
( |
const FEATURE_DEFS_STRUCT & |
FeatureDefs, |
|
|
FILE * |
FeatureFile, |
|
|
TBLOB * |
Blob, |
|
|
const DENORM & |
denorm, |
|
|
const char * |
BlobText, |
|
|
const char * |
FontName |
|
) |
| |
Definition at line 102 of file blobclass.cpp.
110 if (CharDesc ==
NULL) {
111 cprintf(
"LearnBLob: CharDesc was NULL. Aborting.\n");
117 fprintf(FeatureFile,
"\n%s %s\n", FontName, BlobText);
122 tprintf(
"Blob learned was invalid!\n");
bool ValidCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs, CHAR_DESC CharDesc)
void FreeCharDescription(CHAR_DESC CharDesc)
DLLSYM void tprintf(const char *format,...)
void cprintf(const char *format,...)
void WriteCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs, FILE *File, CHAR_DESC CharDesc)
| char* classify_font_name = kUnknownFontName |
"Default font name to be used in training"
Definition at line 39 of file blobclass.cpp.
Global Data Definitions and Declarations