资源简介
车牌字符分割算法的垂直投影切分matlab程序
代码片段和文件信息
I=imread(‘1.bmp‘);
imshow(I);
[xy]=size(I);
Ver=sum(I);
MeanV=0.1*mean(Ver);
PY1=1;
while (Ver(PY1) PY1=PY1+1;
end
PY2=y;
while(Ver(PY2)PY1)
PY2=PY2-1;
end
I1=I(:PY1:PY2);
%I1=imresize(I11‘bilinear‘);
figureimshow(I1);
Ver1=sum(I1);
MeanV1=0.3*mean(Ver1);
[xy]=size(I1);
CharW=round((45/409)*y);
Space=round((12/409)*y);
Point=round((34/409)*y);
spos=round(CharW*2+Space+(1/2)*Point);
k=spos;
tic
while (Ver1(k)>MeanV1)&&(k k=k+1;
end
n=2;
while(n>=1)&&(k>1)
while(Ver1(k)1)
k=k-1;
end
Rcpos(n)=k;
while (Ver1(k)>MeanV1)&&(k>1)
k=k-1;
end
Lcpos(n)=k+1;
if (Rcpos(n)-Lcpos(n))>1.5*CharW
Lcpos(n)=round(Rcpos(n)-CharW);
k=Lcpos(n)-1;
end
- 上一篇:LFM及匹配滤波的MATLAB程序
- 下一篇:matlab 圆形识别并标注
评论
共有 条评论