从牌照中删除额外的像素/线条 [英] Removing extra pixels/lines from license plate
问题描述
我正在使用基于SVM分类的HOG特征检测器。我可以成功提取车牌,但提取的车牌除了许可证号外还有一些不必要的像素/线。我的图像处理管道如下:
I am using HOG feature detector based on SVM classification. I can successfully extract license plate, but the extracted number plate have some unnecessary pixels/lines apart from license number. My image processing pipeline is as follows:
- 在灰度图像上应用HOG检测器
- 检测到裁剪区域
- 重新调整裁剪的图像大小
-
应用自适应阈值以突出显示板块数量&使用以下 Opencv 代码过滤背景
cvAdaptiveThreshold(cropped_plate, thresholded_plate, 255,CV_ADAPTIVE_THRESH_GAUSSIAN_C, CV_THRESH_BINARY_INV,11, 9);
去偏斜板图像
De-skewing plate image
由于这些不必要的信息, Tesseract-OCR 软件对于正确识别数字感到困惑。提取的车牌图像如下所示。
Due to this unnecessary information, Tesseract-OCR software is getting confused to recognize numbers correctly. The extracted number plates images look like the following.
如何从图像中过滤掉这些不必要的像素/线条?任何帮助将不胜感激。
How can i filter these unnecessary pixels/lines from the images? Any help will be appreciated.
推荐答案
您想要删除图像中的所有非文本对象。为此,我建议按边界框(maxy - miny)*(maxx - minx)的区域对blob进行排序。做一些统计分析;你知道你正在寻找类似大小的物体。识别出字符的大致大小后,请创建一个估计整个文本的较大边界框。保留其中的小斑点,因此对于您的图片,将保留破折号。
You want to remove all non-text objects in the image. To do that, I suggest sorting the blobs by area of their bounding box (maxy - miny)*(maxx - minx). Do some statistical analysis; you know you are looking for objects of a similar size. Once you identify the approximate size of a character, make a larger bounding box that estimates the whole text. Keep the small blobs inside it, so for your picture, the dash sign will be preserved.
这篇关于从牌照中删除额外的像素/线条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!