Added angle checking so that text areas with vertical angles are rejected

This commit is contained in:
Matt Hill
2014-10-17 11:34:13 -04:00
parent 4bfef05b9a
commit 3964ffa49f

View File

@@ -157,8 +157,18 @@ vector<Point> LineFinder::getBestLine(const TextContours contours, vector<Point>
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);
}
}
}