53static 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++)
#define double_VAR(name, val, comment)
DLLSYM void tprintf(const char *format,...)
void FreeProtoList(LIST *ProtoList)
void FreePrototype(void *arg)
uint16_t ReadSampleSize(TFile *fp)
PARAM_DESC * ReadParamDesc(TFile *fp, uint16_t N)
PROTOTYPE * ReadPrototype(TFile *fp, uint16_t N)
const double kWidthErrorWeighting
double classify_norm_adj_midpoint
double classify_norm_adj_curl
LIST push_last(LIST list, void *item)
char * FGets(char *buffer, int buffer_size)
bool contains_unichar(const char *const unichar_repr) const
const char * id_to_unichar(UNICHAR_ID id) const
UNICHAR_ID unichar_to_id(const char *const unichar_repr) const
float ComputeNormMatch(CLASS_ID ClassId, const FEATURE_STRUCT &feature, bool DebugMatch)
NORM_PROTOS * ReadNormProtos(TFile *fp)