Fix grayscale images recogntion

This commit is contained in:
Serge Smelov
2016-01-11 23:26:57 +03:00
parent 28e366a16c
commit 6d5ab9c651

View File

@@ -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());
if (pipeline_data->color_deskewed.channels() > 2)
{
// Make a grayscale copy as well for faster processing downstream // Make a grayscale copy as well for faster processing downstream
cv::cvtColor(pipeline_data->color_deskewed, pipeline_data->crop_gray, CV_BGR2GRAY); cv::cvtColor(pipeline_data->color_deskewed, pipeline_data->crop_gray, CV_BGR2GRAY);
}
if (this->config->debugGeneral) if (this->config->debugGeneral)