mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 11:07:00 +08:00
Added a few extra pixels to the top/bottom plate edge line guess
This commit is contained in:
@@ -243,6 +243,8 @@ namespace alpr
|
|||||||
LineSegment top;
|
LineSegment top;
|
||||||
LineSegment bottom;
|
LineSegment bottom;
|
||||||
|
|
||||||
|
// Add a few extra pixels to the guessed line, so we don't accidentally crop the characters
|
||||||
|
int extra_vertical_pixels = 3;
|
||||||
float charHeightToPlateHeightRatio = pipelineData->config->plateHeightMM / pipelineData->config->avgCharHeightMM;
|
float charHeightToPlateHeightRatio = pipelineData->config->plateHeightMM / pipelineData->config->avgCharHeightMM;
|
||||||
float idealPixelHeight = tlc.charHeight * charHeightToPlateHeightRatio;
|
float idealPixelHeight = tlc.charHeight * charHeightToPlateHeightRatio;
|
||||||
|
|
||||||
@@ -266,13 +268,13 @@ namespace alpr
|
|||||||
else if (h1 == NO_LINE && h2 != NO_LINE)
|
else if (h1 == NO_LINE && h2 != NO_LINE)
|
||||||
{
|
{
|
||||||
bottom = this->plateLines->horizontalLines[h2].line;
|
bottom = this->plateLines->horizontalLines[h2].line;
|
||||||
top = bottom.getParallelLine(idealPixelHeight);
|
top = bottom.getParallelLine(idealPixelHeight + extra_vertical_pixels);
|
||||||
missingSegmentPenalty++;
|
missingSegmentPenalty++;
|
||||||
}
|
}
|
||||||
else if (h1 != NO_LINE && h2 == NO_LINE)
|
else if (h1 != NO_LINE && h2 == NO_LINE)
|
||||||
{
|
{
|
||||||
top = this->plateLines->horizontalLines[h1].line;
|
top = this->plateLines->horizontalLines[h1].line;
|
||||||
bottom = top.getParallelLine(-1 * idealPixelHeight);
|
bottom = top.getParallelLine(-1 * idealPixelHeight + extra_vertical_pixels);
|
||||||
missingSegmentPenalty++;
|
missingSegmentPenalty++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user