122 tprintf(
"YMiddle: Proto=%g, Delta=%g, Var=%g, Dist=%g\n",
129 tprintf(
"Height: Proto=%g, Delta=%g, Var=%g, Dist=%g\n",
136 tprintf(
"Width: Proto=%g, Delta=%g, Var=%g\n",
144 tprintf(
"Total Dist=%g, scaled=%g, sigmoid=%g, penalty=%g\n",
149 if (Match < BestMatch)
183 NormAdj = NormAdj * NormAdj * NormAdj;
185 NormAdj = NormAdj * NormAdj;
188 return (1.0 / (1.0 + NormAdj));
213 for (i = 0, TotalMatch = 0.0; i < NumParams; i++) {
214 ParamMatch = (Feature->
Params[i] -
Mean(Proto, i)) /
217 fprintf (File,
" %6.1f", ParamMatch);
220 TotalMatch += ParamMatch * ParamMatch;
222 fprintf (File,
" --> %6.1f (%4.2f)\n",
253 for (i = 0; i < NormProtos->
NumProtos; i++)
261 while ((end_offset < 0 || ftell(File) < end_offset) &&
262 fscanf(File,
"%s %d", unichar, &NumProtos) == 2) {
265 Protos = NormProtos->
Protos[unichar_id];
266 for (i = 0; i < NumProtos; i++)
269 NormProtos->
Protos[unichar_id] = Protos;
271 cprintf(
"Error: unichar %s in normproto file is not in unichar set.\n",
273 for (i = 0; i < NumProtos; i++)
LIST push_last(LIST list, void *item)
const char *const id_to_unichar(UNICHAR_ID id) const
double NormEvidenceOf(register double NormAdj)
const UNICHAR_ID unichar_to_id(const char *const unichar_repr) const
void SkipNewline(FILE *file)
NORM_PROTOS * ReadNormProtos(FILE *File, inT64 end_offset)
double classify_norm_adj_curl
void PrintNormMatch(FILE *File, int NumParams, PROTOTYPE *Proto, FEATURE Feature)
NORM_PROTOS * ReadNormProtos(FILE *File)
const double kWidthErrorWeighting
FLOAT32 StandardDeviation(PROTOTYPE *Proto, uinT16 Dimension)
#define double_VAR(name, val, comment)
void FreePrototype(void *arg)
bool contains_unichar(const char *const unichar_repr) const
DLLSYM void tprintf(const char *format,...)
void * Emalloc(size_t Size)
void FreeProtoList(LIST *ProtoList)
FLOAT32 Mean(PROTOTYPE *Proto, uinT16 Dimension)
FLOAT32 ComputeNormMatch(CLASS_ID ClassId, const FEATURE_STRUCT &feature, BOOL8 DebugMatch)
void cprintf(const char *format,...)
double classify_norm_adj_midpoint