基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx

上传人:b****4 文档编号:6534189 上传时间:2023-05-06 格式:DOCX 页数:11 大小:16.77KB
下载 相关 举报
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第1页
第1页 / 共11页
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第2页
第2页 / 共11页
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第3页
第3页 / 共11页
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第4页
第4页 / 共11页
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第5页
第5页 / 共11页
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第6页
第6页 / 共11页
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第7页
第7页 / 共11页
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第8页
第8页 / 共11页
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第9页
第9页 / 共11页
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第10页
第10页 / 共11页
基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx_第11页
第11页 / 共11页
亲,该文档总共11页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx

《基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx(11页珍藏版)》请在冰点文库上搜索。

基于matlab车牌的定位与分割识别程序概要Word格式文档下载.docx

I5=bwareaopen(I4,2000);

%去除聚团灰度值小于2000的部分

subplot(3,2,6),imshow(I5),title('

形态滤波后图像'

[y,x,z]=size(I5);

I6=double(I5);

Y1=zeros(y,1);

for 

i=1:

y

j=1:

x

if(I6(i,j,1)==1)

Y1(i,1)= 

Y1(i,1)+1;

end

[temp 

MaxY]=max(Y1);

subplot(3,2,1),plot(0:

y-1,Y1),title('

行方向像素点灰度值累计和'

),

xlabel('

行值'

),ylabel('

像素'

%求的车牌的行起始位置和终止位置

PY1=MaxY;

while 

((Y1(PY1,1)>

=50)&

&

(PY1>

1))

PY1=PY1-1;

PY2=MaxY;

((Y1(PY2,1)>

(PY2<

y))

PY2=PY2+1;

IY=I(PY1:

PY2,:

:

X1=zeros(1,x);

i=PY1:

PY2

X1(1,j)= 

X1(1,j)+1;

endend

subplot(3,2,2),plot(0:

x-1,X1),title('

列方向像素点灰度值累计和'

列值'

像数'

%求的车牌的列起始位置和终止位置PX1=1;

((X1(1,PX1)<

3)&

(PX1<

x))

PX1=PX1+1;

PX2=x;

((X1(1,PX2)<

(PX2>

PX1))

PX2=PX2-1;

PX1=PX1-1;

PX2=PX2+1;

%分割出车牌图像%

dw=I(PY1:

PY2,PX1:

PX2,:

subplot(3,2,3),imshow(dw),title('

定位剪切后的彩色车牌图像'

4.2 

车牌字符分割

确定车牌位置后下一步的任务就是进行字符切分分离出车牌号

码的全部字符图像。

if 

isrgb(I)

I1 

rgb2gray(I);

%将RGB图像转化为灰度图像

elseI1=I;

end

g_max=double(max(max(I1)));

g_min=double(min(min(I1)));

T=round(g_max-(g_max-g_min)/3);

为二值化的阈值

[m,n]=size(I1);

d:

二值图像

%h=graythresh(I1);

I1=im2bw(I1,T/256);

subplot(3,2,4);

imshow(I1),title('

二值化车牌图像'

I2=bwareaopen(I1,20);

subplot(3,2,5);

imshow(I2),title('

形态学滤波后的二值化图像'

[y1,x1,z1]=size(I2);

I3=double(I2);

TT=1;

%%%%%%%去除图像顶端和底端的不感兴趣区域%%%%%

Y1=zeros(y1,1);

y1

x1

if(I3(i,j,1)==1)

Y1(i,1)+1 

;

Py1=1;

Py0=1;

((Y1(Py0,1)<

20)&

(Py0<

y1))

Py0=Py0+1;

Py1=Py0;

while((Y1(Py1,1)>

=20)&

(Py1<

Py1=Py1+1;

I2=I2(Py0:

Py1,:

subplot(3,2,6);

目标车牌区域'

分割字符按行积累量%

X1=zeros(1,x1);

figure(5);

plot(0:

x1-1,X1),title('

),xlabel('

ylabel('

累计像素量'

Px0=1;

Px1=1;

%分割字符

7

((X1(1,Px0)<

(Px0<

x1))

Px0=Px0+1;

Px1=Px0;

(((X1(1,Px1)>

=3)&

(Px1<

x1))||((Px1-Px0)<

10))

Px1=Px1+1;

Z=I2(:

Px0:

Px1,:

switch 

strcat('

Z'

num2str(i))

case 

'

Z1'

PIN0=Z;

Z2'

PIN1=Z;

Z3'

PIN2=Z;

Z4'

PIN3=Z;

Z5'

PIN4=Z;

Z6'

PIN5=Z;

otherwise

PIN6=Z;

figure(3);

subplot(1,7,i);

imshow(Z);

Px0=Px1;

End

functioninpt= 

pretreatment(I)

%YUCHULI 

Summary 

of 

this 

function 

goes 

here

%Detailed 

explanation 

else

I1=I;

I1=imresize(I1,[50 

20]);

%将图片统一划为50*20大小

I1=im2bw(I1,0.9);

inpt=zeros(1,m*n);

%将图像按列转换成一个行向量

n

m

inpt(1,m*(j-1)+i)=I1(i,j);

%神经网络进行识别。

close 

all;

clear 

%%%%归一化训练样本%%%%%%

I0=pretreatment(imread('

0.jpg'

));

I1=pretreatment(imread('

1.jpg'

I2=pretreatment(imread('

2.jpg'

I3=pretreatment(imread('

3.jpg'

I4=pretreatment(imread('

4.jpg'

I5=pretreatment(imread('

5.jpg'

I6=pretreatment(imread('

6.jpg'

I7=pretreatment(imread('

7.jpg'

I8=pretreatment(imread('

8.jpg'

I9=pretreatment(imread('

9.jpg'

I10=pretreatment(imread('

A.jpg'

I11=pretreatment(imread('

C.jpg'

I12=pretreatment(imread('

G.jpg'

I13=pretreatment(imread('

L.jpg'

I14=pretreatment(imread('

M.jpg'

I15=pretreatment(imread('

R.jpg'

I16=pretreatment(imread('

H.jpg'

I17=pretreatment(imread('

N.jpg'

P=[I0'

I1'

I2'

I3'

I4'

I5'

I6'

I7'

I8'

I9'

I10'

I11'

I12'

I13'

I14'

I15'

I16'

I1

7'

];

%输出样本%%%

T=eye(18,18);

%%bp神经网络参数设置

net=newff(minmax(P),[1000,32,18],{'

logsig'

'

},'

trainrp

net.inputWeights{1,1}.initFcn 

='

randnr'

net.layerWeights{2,1}.initFcn 

net.trainparam.epochs=5000;

net.trainparam.show=50;

%net.trainparam.lr=0.003;

net.trainparam.goal=0.0000000001;

net=init(net);

%%%训练样本%%%%

[net,tr]=train(net,P,T);

%%%%%%%测试%%%%%%%%%

%I=imread('

DSC01323.jpg'

DSC01344.jpg'

dw=location(I);

%车牌定位

[PIN0,PIN1,PIN2,PIN3,PIN4,PIN5,PIN6]=StringSplit(dw);

%字符

分割及处理

%%%%%%%%%%%测试字符,得到识别数值%%%%

PIN0=pretreatment(PIN0);

PIN1=pretreatment(PIN1);

PIN2=pretreatment(PIN2);

PIN3=pretreatment(PIN3);

PIN4=pretreatment(PIN4);

PIN5=pretreatment(PIN5);

PIN6=pretreatment(PIN6);

P0=[PIN0'

PIN1'

PIN2'

PIN3'

PIN4'

PIN5'

PIN6'

i=2:

T0= 

sim(net 

P0(:

i));

T1 

compet 

(T0) 

=find(T1 

== 

1) 

1

(d==10)

str='

A'

elseif 

(d==11)

C'

(d==12)

G'

(d==13)

L'

(d==14)

M'

(d==15)

R'

(d==16)

H'

(d==17)

N'

str=num2str(d);

i

2

str1=str;

3

str2=str;

4

str3=str;

5

str4=str;

6

str5=str;

str6=str;

%显示定位后的分割出的车牌彩图,%

%%%%%%识别结果以标题形式显示在图上%%%

s=strcat('

渝'

str1,str2,str3,str4,str5,str6);

imshow(dw),title(s);

非诚勿扰欢迎下载

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2