mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 21:22:49 +08:00
Resolves issue #45 Use better angle value for edge detection
This commit is contained in:
@@ -199,6 +199,15 @@ void PlateCorners::scoreVerticals(int v1, int v2)
|
||||
|
||||
score += (verticalAngleDiff) * SCORING_BOXINESS_WEIGHT;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Score angle difference from detected character box
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
float perpendicularCharAngle = charAngle - 90;
|
||||
float charanglediff = abs(perpendicularCharAngle - left.angle) + abs(perpendicularCharAngle - right.angle);
|
||||
|
||||
score += charanglediff * SCORING_ANGLE_MATCHES_LPCHARS_WEIGHT;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// SCORE the shape wrt character position and height relative to position
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -241,6 +250,10 @@ void PlateCorners::scoreVerticals(int v1, int v2)
|
||||
scorecomponent = plateDistance * SCORING_DISTANCE_WEIGHT_VERTICAL;
|
||||
cout << " -- -- Score: " << scorecomponent << " = " << scorecomponent / score * 100 << "% of score" << endl;
|
||||
|
||||
cout << " -- Char angle Score: " << charanglediff << " -- Weight (" << SCORING_ANGLE_MATCHES_LPCHARS_WEIGHT << ")" << endl;
|
||||
scorecomponent = charanglediff * SCORING_ANGLE_MATCHES_LPCHARS_WEIGHT;
|
||||
cout << " -- -- Score: " << scorecomponent << " = " << scorecomponent / score * 100 << "% of score" << endl;
|
||||
|
||||
cout << " -- Plate line confidence Score: " << confidenceDiff << " -- Weight (" << SCORING_LINE_CONFIDENCE_WEIGHT << ")" << endl;
|
||||
scorecomponent = confidenceDiff * SCORING_LINE_CONFIDENCE_WEIGHT;
|
||||
cout << " -- -- Score: " << scorecomponent << " = " << scorecomponent / score * 100 << "% of score" << endl;
|
||||
|
Reference in New Issue
Block a user