53 static double NormEvidenceOf(
double NormAdj) {
57 NormAdj = NormAdj * NormAdj * NormAdj;
59 NormAdj = NormAdj * NormAdj;
63 return (1.0 / (1.0 + NormAdj));
117 return (1.0 - NormEvidenceOf(Match));
133 tprintf(
"YMiddle: Proto=%g, Delta=%g, Var=%g, Dist=%g\n",
140 tprintf(
"Height: Proto=%g, Delta=%g, Var=%g, Dist=%g\n",
147 tprintf(
"Width: Proto=%g, Delta=%g, Var=%g\n",
155 tprintf(
"Total Dist=%g, scaled=%g, sigmoid=%g, penalty=%g\n",
157 NormEvidenceOf(Match), 256 * (1 - NormEvidenceOf(Match)));
160 if (Match < BestMatch)
165 return 1.0 - NormEvidenceOf(BestMatch);
210 const int kMaxLineSize = 100;
211 char line[kMaxLineSize];
212 while (fp->FGets(line, kMaxLineSize) !=
nullptr) {
213 std::istringstream stream(line);
214 stream >> unichar >> NumProtos;
221 for (i = 0; i < NumProtos; i++)
225 tprintf(
"Error: unichar %s in normproto file is not in unichar set.\n",
227 for (i = 0; i < NumProtos; i++)