Using absolute value for rotation referenced in issue #44

This commit is contained in:
Matt Hill
2014-11-13 22:22:26 -05:00
parent ab255209c8
commit 6941150aea

View File

@@ -842,7 +842,7 @@ namespace alpr
{ {
Mat rotated; Mat rotated;
if (top.angle > MIN_ANGLE_FOR_ROTATION) if (abs(top.angle) > MIN_ANGLE_FOR_ROTATION)
{ {
// Rotate image: // Rotate image:
rotated = Mat(thresholds[i].size(), thresholds[i].type()); rotated = Mat(thresholds[i].size(), thresholds[i].type());
@@ -913,7 +913,7 @@ namespace alpr
Mat mask = Mat::zeros(thresholds[0].size(), CV_8U); Mat mask = Mat::zeros(thresholds[0].size(), CV_8U);
rectangle(mask, Point(leftEdge, 0), Point(rightEdge, thresholds[0].rows), Scalar(255,255,255), -1); rectangle(mask, Point(leftEdge, 0), Point(rightEdge, thresholds[0].rows), Scalar(255,255,255), -1);
if (top.angle > MIN_ANGLE_FOR_ROTATION) if (abs(top.angle) > MIN_ANGLE_FOR_ROTATION)
{ {
// Rotate mask: // Rotate mask:
Mat rot_mat( 2, 3, CV_32FC1 ); Mat rot_mat( 2, 3, CV_32FC1 );