续 - 车辆牌照检测 [英] Continued - Vehicle License Plate Detection

查看:214
本文介绍了续 - 车辆牌照检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

继续此主题:



什么是车牌照检测的好算法?



我开发了我的图像处理技术来强调许可证板材尽可能多,总体来说我很高兴,这里有两个样本。







现在是最困难的部分,实际上检测车牌。我知道有一些边缘检测方法,但我的数学相当差,所以我无法将一些复杂的公式转换为代码。



到目前为止,我的想法是循环遍历图像中的每个像素(for循环基于img宽度和高度)从这里比较每个像素对颜色列表,从这里检查算法以查看颜色是否保持区分在牌照白色和文本的黑色之间。如果这是真的,这些像素被内置在一个新的位图在内存中,然后一旦OCR扫描被执行一旦这种模式已停止检测。



我会赞赏



感谢

解决方案

您的查看颜色是否保持区分牌照白色和文本的黑色的方法基本上是搜索像素强度从黑色变为白色的区域,反之亦然次。边缘检测可以基本上完​​成相同的事情。但是,实现自己的方法仍然是一个好主意,因为你会在这个过程中学到很多。 heck,为什么不这样做,并将你的方法的输出与一些现成的边缘检测算法的输出进行比较?



在某些时候,你会想要一个二进制图像,例如使用对应于不是字符标签的黑色像素,以及对应于is-a-character标签的白色像素。也许最简单的方法是使用阈值函数。但是,如果字符已经以某种方式被强调,那么它将只能工作。



正如在其他线程中提到的,你可以使用黑帽操作符,其结果是这样的:





如果您使用Otsu的方法(自动确定全局阈值级别)对上述图片设置阈值,您会得到:





有几种方法来清理该图像。例如,您可以找到连接的组件,并丢弃那些太小,太大,太宽或太高以至于不能成为字符的组件:





由于您的图片中的字符相对较大,



接下来,您可以根据邻居的属性过滤剩余的组件,直到您拥有所需的组件数量(=字符数) 。如果你想识别字符,你可以计算每个字符的功能,并将它们输入到分类器,通常是用监督学习。



上述所有步骤



顺便说一句,我使用OpenCV + Python生成了上面的图像,这是一个很好的组合的计算机视觉。 / p>

Continuing from this thread:

What are good algorithms for vehicle license plate detection?

I've developed my image manipulation techniques to emphasise the license plate as much as possible, and overall I'm happy with it, here are two samples.

Now comes the most difficult part, actually detecting the license plate. I know there are a few edge detection methods, but my maths is quite poor so I'm unable to translate some of the complex formulas into code.

My idea so far is to loop through every pixel within the image (for loop based on img width & height) From this compare each pixel against a list of colours, from this an algorithm is checked to see if the colors keep differentiating between the license plate white, and the black of the text. If this happens to be true these pixels are built into a new bitmap within memory, then an OCR scan is performed once this pattern has stopped being detected.

I'd appreciate some input on this as it might be a flawed idea, too slow or intensive.

Thanks

解决方案

Your method of "see if the colors keep differentiating between the license plate white, and the black of the text" is basically searching for areas where the pixel intensity changes from black to white and vice-versa many times. Edge detection can accomplish essentially the same thing. However, implementing your own methods is still a good idea because you will learn a lot in the process. Heck, why not do both and compare the output of your method with that of some ready-made edge detection algorithm?

At some point you will want to have a binary image, say with black pixels corresponding to the "not-a-character" label, and white pixels corresponding to the "is-a-character" label. Perhaps the simplest way to do that is to use a thresholding function. But that will only work well if the characters have already been emphasized in some way.

As someone mentioned in your other thread, you can do that using the black hat operator, which results in something like this:

If you threshold the image above with, say, Otsu's method (which automatically determines a global threshold level), you get this:

There are several ways to clean that image. For instance, you can find the connected components and throw away those that are too small, too big, too wide or too tall to be a character:

Since the characters in your image are relatively large and fully connected this method works well.

Next, you could filter the remaining components based on the properties of the neighbors until you have the desired number of components (= number of characters). If you want to recognize the character, you could then calculate features for each character and input them to a classifier, which usually is built with supervised learning.

All the steps above are just one way to do it, of course.

By the way, I generated the images above using OpenCV + Python, which is a great combination for computer vision.

这篇关于续 - 车辆牌照检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆