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

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

问题描述

从这个线程继续:

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

我已经开发了我的图像处理技术来突出许可证板尽可能和整体我很高兴有了它,这里有两个样品

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.

我的想法至今遍历图像中每个像素(用于环路基于IMG宽度放大器;高度)从这个比较每个像素针对颜色列表,这个算法被检查,看看是否颜色保持车牌白色,和文本的黑色区分。如果发生这种情况是真实的这些像素内置存储器中的一个新的位图,那么一旦这种模式已经停止被检测的执行OCR扫描。

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.

感谢

推荐答案

您的看颜色保持车牌区分白,文字的黑基本上是寻找其中像素强度的变化,从黑到白,反之亦然许多领域的方法倍。边缘检测基本上可以完成同样的事情。然而,实现自己的方法仍然是一个好主意,因为你会学到很多在这个过程中。哎呀,为什么不能两者都做,你的方法的输出与一些现成的边缘检测算法的比较?

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.

顺便说一句,我产生上述使用的OpenCV + Python的,这是计算机视觉一个伟大的组合图像。

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

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

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