diff --git a/src/classify/normmatch.cpp b/src/classify/normmatch.cpp index 7b132f27..6ea75b99 100644 --- a/src/classify/normmatch.cpp +++ b/src/classify/normmatch.cpp @@ -52,17 +52,17 @@ struct NORM_PROTOS { * normalization adjustment. The equation that represents the transform is: * 1 / (1 + (NormAdj / midpoint) ^ curl) */ -static double NormEvidenceOf(double NormAdj) { - NormAdj /= classify_norm_adj_midpoint; +static float NormEvidenceOf(float NormAdj) { + NormAdj /= static_cast(classify_norm_adj_midpoint); if (classify_norm_adj_curl == 3) { NormAdj = NormAdj * NormAdj * NormAdj; } else if (classify_norm_adj_curl == 2) { NormAdj = NormAdj * NormAdj; } else { - NormAdj = pow(NormAdj, classify_norm_adj_curl); + NormAdj = std::pow(NormAdj, static_cast(classify_norm_adj_curl)); } - return (1.0 / (1.0 + NormAdj)); + return (1 / (1 + NormAdj)); } /*---------------------------------------------------------------------------- @@ -73,7 +73,7 @@ static double NormEvidenceOf(double NormAdj) { double_VAR(classify_norm_adj_midpoint, 32.0, "Norm adjust midpoint ..."); double_VAR(classify_norm_adj_curl, 2.0, "Norm adjust curl ..."); /** Weight of width variance against height and vertical position. */ -const double kWidthErrorWeighting = 0.125; +const float kWidthErrorWeighting = 0.125f; /*---------------------------------------------------------------------------- Public Code @@ -102,7 +102,7 @@ float Classify::ComputeNormMatch(CLASS_ID ClassId, const FEATURE_STRUCT &feature float Match = (feature.Params[CharNormLength] * feature.Params[CharNormLength] * 500.0f + feature.Params[CharNormRx] * feature.Params[CharNormRx] * 8000.0f + feature.Params[CharNormRy] * feature.Params[CharNormRy] * 8000.0f); - return (1.0f - NormEvidenceOf(Match)); + return (1 - NormEvidenceOf(Match)); } float BestMatch = FLT_MAX; @@ -145,7 +145,7 @@ float Classify::ComputeNormMatch(CLASS_ID ClassId, const FEATURE_STRUCT &feature BestMatch = Match; } } - return 1.0 - NormEvidenceOf(BestMatch); + return 1 - NormEvidenceOf(BestMatch); } /* ComputeNormMatch */ void Classify::FreeNormProtos() {