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++)