#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.
Macro Definition Documentation
Include Files and Type Defines —————————————————————————-
Definition at line 33 of file blobclass.cpp.
#define TRAIN_SUFFIX ".tr" |
Function Documentation
Public Code —————————————————————————-
Definition at line 52 of file blobclass.cpp.
{
#define TRAIN_SUFFIX ".tr"
static FILE *FeatureFile =
NULL;
if (CurrFontName == kUnknownFontName) {
const char *basename = strrchr(filename.
string(),
'/');
const char *firstdot = strchr(basename ? basename : filename.
string(),
'.');
const char *lastdot = strrchr(filename.
string(),
'.');
if (firstdot != lastdot && firstdot !=
NULL && lastdot !=
NULL) {
++firstdot;
CurrFontName = firstdot;
CurrFontName[lastdot - firstdot] = '\0';
}
}
if (FeatureFile ==
NULL) {
FeatureFile =
Efopen(Filename.string(),
"wb");
}
LearnBlob(FeatureDefs, FeatureFile, Blob, denorm, BlobText,
}
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.
{
cprintf(
"LearnBLob: CharDesc was NULL. Aborting.\n");
return;
}
fprintf(FeatureFile, "\n%s %s\n", FontName, BlobText);
} else {
tprintf(
"Blob learned was invalid!\n");
}
}
Variable Documentation
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 —————————————————————————-