【发布时间】:2018-05-13 06:45:00
【问题描述】:
我目前正在开发一个 ALPR 系统。为了首先检测板块,我使用here描述的方法。
问题来自某些图像。使用 findHomography 和 warpPerspective 后,它给了我旋转的车牌图像。
这是给我带来问题的原始图像。
这是检测到的板块轮廓
这是扭曲的图像
如您所见,它旋转了 90 度。在其他示例中,检测效果惊人。
具体的一段代码
cv::Mat warpped_plate( PLATE_HEIGHT, PLATE_WIDTH, CV_8UC3 );
vector< cv::Point> real_plate_polygons;
real_plate_polygons = {cv::Point(PLATE_WIDTH, PLATE_HEIGHT), cv::Point(0, PLATE_HEIGHT), cv::Point(0, 0), cv::Point(PLATE_WIDTH, 0)};
cv::Mat homography = cv::findHomography( plate_polygons, real_plate_polygons );
cv::warpPerspective(source_img, warpped_plate, homography, cv::Size(PLATE_WIDTH, PLATE_HEIGHT));
其中 plate_polygons 包含板块的四个点(并且是正确的,因为用于绘制蒙版中的白色框)。
有什么想法吗?提前致谢!
【问题讨论】:
-
那么,
plate_polygon的顺序显然是错误的。循环输入以达到您在real_plate_polygons中的角顺序。
标签: c++ opencv computer-vision