87 if (Length < 0) Length = 0;
94 if (Evidence < WorstEvidence)
95 WorstEvidence = Evidence;
106 if (Evidence < WorstEvidence)
107 WorstEvidence = Evidence;
114 return (WorstEvidence);
140 TotalWeight = w1 + w2;
144 MergedProto->
X = p1->
X * w1 + p2->
X * w2;
145 MergedProto->
Y = p1->
Y * w1 + p2->
Y * w2;
175 FLOAT32 Match, OldMatch, NewMatch;
181 for (Pid = 0; Pid < Class->
NumProtos; Pid++) {
184 (
FLOAT32) NumMerged[Pid], 1.0, &MergedProto);
187 Match =
MIN(OldMatch, NewMatch);
188 if (Match > BestMatch) {
228 if (Dangle < -0.5) Dangle += 1.0;
229 if (Dangle > 0.5) Dangle -= 1.0;
236 return (
EvidenceOf (Distance * Distance + Dangle * Dangle));
252 Similarity = Similarity * Similarity * Similarity;
254 Similarity = Similarity * Similarity;
258 return (1.0 / (1.0 + Similarity));
286 if (AngleError > 0.5)
287 AngleError = 1.0 - AngleError;
289 if (AngleError > MaxAngleError)
321 FLOAT32 CosOfAngle, SinOfAngle;
323 Length = Proto->
Length / 2.0 + TangentPad;
324 Angle = Proto->
Angle * 2.0 *
PI;
325 CosOfAngle = fabs(cos(Angle));
326 SinOfAngle = fabs(sin(Angle));
328 Pad =
MAX (CosOfAngle * Length, SinOfAngle * OrthogonalPad);
329 BoundingBox->
MinX = Proto->
X - Pad;
330 BoundingBox->
MaxX = Proto->
X + Pad;
332 Pad =
MAX(SinOfAngle * Length, CosOfAngle * OrthogonalPad);
333 BoundingBox->
MinY = Proto->
Y - Pad;
334 BoundingBox->
MaxY = Proto->
Y + Pad;
348 if (X < Rectangle->MinX)
return (
FALSE);
350 if (Y < Rectangle->MinY)
return (
FALSE);