mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-09 17:20:11 +08:00
Fix grayscale images recogntion
This commit is contained in:
@@ -89,8 +89,11 @@ namespace alpr
|
|||||||
cv::Mat color_transmtx = cv::getPerspectiveTransform(projectedPoints, deskewed_points);
|
cv::Mat color_transmtx = cv::getPerspectiveTransform(projectedPoints, deskewed_points);
|
||||||
cv::warpPerspective(pipeline_data->colorImg, pipeline_data->color_deskewed, color_transmtx, pipeline_data->color_deskewed.size());
|
cv::warpPerspective(pipeline_data->colorImg, pipeline_data->color_deskewed, color_transmtx, pipeline_data->color_deskewed.size());
|
||||||
|
|
||||||
// Make a grayscale copy as well for faster processing downstream
|
if (pipeline_data->color_deskewed.channels() > 2)
|
||||||
cv::cvtColor(pipeline_data->color_deskewed, pipeline_data->crop_gray, CV_BGR2GRAY);
|
{
|
||||||
|
// Make a grayscale copy as well for faster processing downstream
|
||||||
|
cv::cvtColor(pipeline_data->color_deskewed, pipeline_data->crop_gray, CV_BGR2GRAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (this->config->debugGeneral)
|
if (this->config->debugGeneral)
|
||||||
@@ -102,7 +105,7 @@ namespace alpr
|
|||||||
// to match the newly deskewed license plate crop
|
// to match the newly deskewed license plate crop
|
||||||
vector<TextLine> newLines;
|
vector<TextLine> newLines;
|
||||||
for (unsigned int i = 0; i < pipeline_data->textLines.size(); i++)
|
for (unsigned int i = 0; i < pipeline_data->textLines.size(); i++)
|
||||||
{
|
{
|
||||||
vector<Point2f> textArea = imgTransform.transformSmallPointsToBigImage(pipeline_data->textLines[i].textArea);
|
vector<Point2f> textArea = imgTransform.transformSmallPointsToBigImage(pipeline_data->textLines[i].textArea);
|
||||||
vector<Point2f> linePolygon = imgTransform.transformSmallPointsToBigImage(pipeline_data->textLines[i].linePolygon);
|
vector<Point2f> linePolygon = imgTransform.transformSmallPointsToBigImage(pipeline_data->textLines[i].linePolygon);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user