mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 18:32:45 +08:00
Added angle checking so that text areas with vertical angles are rejected
This commit is contained in:
@@ -157,8 +157,18 @@ vector<Point> LineFinder::getBestLine(const TextContours contours, vector<Point>
|
|||||||
bottomRight = bottoms[i];
|
bottomRight = bottoms[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
topLines.push_back(LineSegment(topLeft, topRight));
|
|
||||||
bottomLines.push_back(LineSegment(bottomLeft, bottomRight));
|
LineSegment top(topLeft, topRight);
|
||||||
|
LineSegment bottom(bottomLeft, bottomRight);
|
||||||
|
|
||||||
|
// Only allow lines that have a sane angle
|
||||||
|
if (abs(top.angle) <= pipeline_data->config->maxPlateAngleDegrees &&
|
||||||
|
abs(bottom.angle) <= pipeline_data->config->maxPlateAngleDegrees)
|
||||||
|
{
|
||||||
|
topLines.push_back(top);
|
||||||
|
bottomLines.push_back(bottom);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user