资源简介
利用二值图像在垂直方向的投影,寻找相应阈值确定谷底。利用谷底坐标实现字符分割。
代码片段和文件信息
clear;
PA=imread(‘定位以后的车牌.jpg‘);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%横向边框切除
PA=uint16(PA);
[mn]=size(PA);
row(m1)=0;
for i=1:m
for j=1:n
row(i)=row(i)+PA(ij);
end
end
x=1:m;
y=row;
plot(xy);
b=ones(1m/4);
for i=1: m/4
b(i)=row(i);
end
f=min(b);
g=1;
if f<8000
for i=1 : m/4
if b(i)==f
g=i
end
end
end
s=3*m/4;
for i=1: m/4
k=round(i+s);
b(i)=row(k);
end
f=min(b);
h=m;
if f<8000
for i=1 : m/4
if b(i)==f
k=round(i+s);
h=k;
end
end
end
PA=imread(‘定位以后的车牌.jpg‘);
PA=PA(g:h:);
imwrite(PA‘横向切割后的车牌.jpg‘‘jpg‘);
imshow(PA);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- 上一篇:lms-nlms-rls-matlab
- 下一篇:FCMKFCM图像分割系统
评论
共有 条评论