计算车牌定位的垂直梯度 [英] Compute Vertical Gradients for License Plate Localization

查看:98
本文介绍了计算车牌定位的垂直梯度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是MATLAB的新手,正在尝试实现车牌本地化的以下步骤:

I am new with MATLAB and trying to implement the following step of License Plate Localization:

到目前为止,这是我的进步.

Here's my progress so far.

代码:

[rows,cols] = size(img);
image_gradient = zeros(rows,cols);

for i =1:1:rows
    for j =1:1:cols-1
        image_gradient(i,j) = abs( img(i,j+1) - img(i,j) );
    end
end

figure,imshow(image_gradient);title('Gradient');

输出:

如果有人能指导我在这里做错了我,我将不胜感激.

I will be indeed grateful if someone can guide me what I am doing wrong here.

推荐答案

首先,您应该了解照明是背面的痛苦.而且,当您继续学习新算法时,您将了解到这一点.

Well to start off you should understand that illumination is a pain in the backside. And you shall understand that as you keep learning new algorithms.

查看第一组图像,您可以看到印版是图像的重要部分.车牌旨在使字符和背景之间形成这种对比.此外,整个背景相当流畅.当您查看底部的图像时,会出现很多伪影和尖锐的强度过渡,这应该可以解释您的渐变为何嘈杂的原因.

Looking at your first set of images you can see that the plate is a prominent part of the image. Number plates are designed to give this contrast between the characters and the background. Moreover the entire background is fairly smooth. When you look at the image on the bottom there are a lot of artifacts and sharp intensity transitions, This should explain why your gradient is noisy.

您要尝试做的是使用看起来像这样的[-1 1]的过滤器进行过滤操作(或Convolution).查找Matlab函数conv2filter.

What you are essentilly trying to do is a filtering operation ( Or Convolution ) using a filter that looks like this [-1 1]. Look up matlab functions conv2 and filter.

为减少噪声,您应该对梯度进行平均运算.这将降低对噪声的敏感性.因此,您的最终过滤器将类似于此[-1 1;-1 1;-1 1].如果您要尝试其他复杂的过滤器,请确保将过滤器值标准化.

To reduce the noise you should be performing an averaging operation along with the gradient. This will reduce the susceptibility to noise. So your final filter would look something like this [-1 1;-1 1;-1 1]. Make sure your filter values are normalized if your are trying other complex filters.

用所提出的方法检测车牌并不容易.它绝对可以帮助您入门.但是您确实需要开始阅读更多算法.

Detecting number plates is not easy with the proposed method. It should definitely get you started. But you really need to start reading up on some more algorithms.

这篇关于计算车牌定位的垂直梯度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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