去歪斜二值图像中的字符 [英] De-skew characters in binary image

查看:28
本文介绍了去歪斜二值图像中的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究车牌识别.问题是我必须对二值图像中的字符进行去倾斜以提高模板匹配的准确性.

我已经做了很多预处理来去除图像中不必要的像素,我可以将字符分割出来.但不幸的是,它们是倾斜的.

从...转换为灰度到二进制

然后..预处理技术..

分割后..

正如在最后一张图片中所观察到的,字符是倾斜的,这将导致模板匹配不准确以执行识别目的.

大多数研究人员正在使用霍夫变换来执行去歪斜操作,但有没有更简单的方法来做到这一点?

解决方案

有很多方法可以解决这个问题.一些在匹配部分避免unskew操作本身像这样:

  • 现在旋转/不倾斜的图像仍然会以低得多的速率倾斜

    所以你也可以在水平轴上应用#1,#2,但这次你只需要unskew(不要使用旋转).通常残余偏斜率很小,所以这一步不是必须的.

  • [注释]

    您可以通过过滤掉错误的点或仔细选择扫描线的起点来提高精度,使它们命中字符的正确位置(您显然知道字符数).

    [edit1] 小例子

    这是您的图像输出的小示例(否定,因为我的功能需要白纸和黑色字体):

    如您所见,旋转和倾斜要小得多.

    I'm working on number plate recognition. The problem is that I have to de-skew the characters in a binary image to increase the accuracy of template matching.

    I have done a lot of pre-processing to remove unnecessary pixels of the image and I could segment the characters out. But unfortunately they are skewed.

    From... converting to greyscale to binary

    Then.. pre-processing techniques..

    After segmentation..

    As can be observed in the last image, the characters are skewed and this will lead to inaccuracy for template matching to perform recognition purposes.

    Most of the researchers are using Hough transform to perform the de-skew operation but is there an easier way to do this?

    解决方案

    There are ways to deal with this. Some on the matching part to avoid the unskew operation itself like this:

    But you want to unskew so:

    1. detect the rotation angle/skew slope

      Obtain bounding box, then cast vertical scan lines and remember first hit point and last regress line through all of them

    2. rotate/skew back by it

      So either use atan2 to obtain the angle or directly construct 2D homogenous 3x3 transform matrix based on basis vectors (one is the line and second is its perpendicular vector). For more info see:

    3. Now the rotated/unskew image will be still skewed bud in much much lower rate

      so you can apply #1,#2 in the horizontal axis too but this time you need to unskew only (do not use rotation). Usually the remnant skew ratio is small so this step is not necessary.

    [notes]

    You can boost the precision by filtering out wrong points or by carefully selecting the start point of scan lines so they hit in the right place of characters (you obviously know the characters count).

    [edit1] small example

    Here small example of output for your image (Negative as my functions are expecting white paper and black font):

    As you can see the rotation and skew is much much smaller.

    这篇关于去歪斜二值图像中的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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