function [PY2,PY1,PX2,PX1]=caitu_tiqu(I,I_bai)
[y,x,z]=size(I);
myI=double(I);
Y_threshlow=5;%这个数值很重要。决定了提取的彩图的质量
X_firrectify=5;%ganrao transaction
%====================== Y 方向============================
Blue_y=zeros(y,1);
for i=1:y
for j=1:x
% if (myI(i,j,1)<=48)&&(myI(i,j,2)>=40)&&(myI(i,j,2)<=90)&&(myI(i,j,3)<=220)&&(myI(i,j,3)>=80)
% if((myI(i,j,1)<=48)&&((myI(i,j,2)<=100)&&(myI(i,j,2)>=40))&&((myI(i,j,3)<=200)&&(myI(i,j,3)>=80)))
if ((myI(i,j,1)<=0.7)&&(myI(i,j,1)>=0.6)&&((myI(i,j,2)<=1.8)&&(myI(i,j,2)>=0.6))&&((myI(i,j,3)<=1.7)&&(myI(i,j,3)>=0.4)))
Blue_y(i,1)= Blue_y(i,1)+1; % 蓝色象素点统计
end
end
end
baisebili=0;changkuanbi=0;
k=0;
while(~((baisebili>=0.12)&&(baisebili<=0.5)&&(changkuanbi>=0.20)&&(changkuanbi<=0.6)))%gai shan qingxie
if (k==0)%第一次进来
[temp MaxY]=max(Blue_y);% Y方向车牌区域确定 temp(最多点数):所有行中,最多的累积像素点 MaxY(最多点所在行):该行中蓝点最多
if temp<=20%2048*1536 照相
msgbox('车牌定位出错','warning');
wavplay(wavread('车牌定位出错.wav'),22000);
pause;
end
PY1=MaxY;%有最多蓝点的行付给PY1
while ((Blue_y(PY1,1)>=Y_threshlow)&&(PY1>1))%找到图片上边界
PY1=PY1-1;
end
%PY1:存储车牌上边界值
PY2=MaxY;
while ((Blue_y(PY2,1)>=Y_threshlow)&&(PY2<y))%阈值为5
PY2=PY2+1;
end
PY1, PY2
%==============X 方向===============================
X_threshhigh=(PY2-PY1)/11;%这个数值很重要。决定了提取的彩图的质量,适当提高可抗干扰,但是小图会照成剪裁太多
Blue_x=zeros(1,x); % 进一步确定X方向的车牌区域
for j=1:x
for i=PY1:PY2
% if((myI(i,j,1)<=48)&&((myI(i,j,2)<=90)&&(myI(i,j,2)>=30))&&((myI(i,j,3)<=160)&&(myI(i,j,3)>=80)))
% if((myI(i,j,1)<=65)&&((myI(i,j,2)<=100)&&(myI(i,j,2)>=40))&&((myI(i,j,3)<=160)&&(myI(i,j,3)>=90)))%这里由82修改成90.因为图片20090504809
if ((myI(i,j,1)<=0.7)&&(myI(i,j,1)>=0.6)&&((myI(i,j,2)<=1.8)&&(myI(i,j,2)>=0.6))&&((myI(i,j,3)<=1.7)&&(myI(i,j,3)>=0.4)))
Blue_x(1,j)= Blue_x(1,j)+1;
end
end
end
[temp MaxX]=max(Blue_x);
PX1=MaxX-6*(PY2-PY1);
if PX1<=1
PX1=1;
end
while ((Blue_x(1,PX1)<=X_threshhigh)&&(PX1<x))%阈值
PX1=PX1+1;
end %确定出X方向车牌起点
PX2=MaxX+6*(PY2-PY1);
if PX2>=x
PX2=x;
end
while ((Blue_x(1,PX2)<=X_threshhigh)&&(PX2>PX1))%阈值
PX2=PX2-1;
end%确定出X方向车牌终点
% PX1=1;
% while ((Blue_x(1,PX1)<=X_threshhigh)&&(PX1<x))%阈值
% PX1=PX1+1;
% end %确定出X方向车牌起点
% PX2=x;
% while ((Blue_x(1,PX2)<X_threshhigh)&&(PX2>PX1))%阈值
% PX2=PX2-1;
% end%确定出X方向车牌终点
PX1 ,PX2
%=========================================================
a=PY2-PY1+1;b=PX2-PX1+1;
White=0;
for i=PY1:PY2
for j=PX1:PX2
if (std([I_bai(i,j,1) I_bai(i,j,2) I_bai(i,j,3)],1,2)<=22)&&(I_bai(i,j,1)>=90)&&(I_bai(i,j,1)<=255)
White= White+1; % 白色象素点统计
end
end
end
baisebili=White/(a*b)
changkuanbi=a/b
k=k+1
%===========================蓝色区域不是车牌区域=================
elseif (k~=0)
Blue_y(PY1:PY2,1)=0;
[temp MaxY]=max(Blue_y);
if temp<=20%2048*1536 照相
msgbox('车牌定位出错','warning');
wavplay(wavread('车牌定位出错.wav'),22000);
pause;
end
PY1=MaxY;
while ((Blue_y(PY1,1)>=Y_threshlow)&&(PY1>1))%找到图片上边界 %阈值为5
PY1=PY1-1;
end
%PY1:存储车牌上边界值
PY2=MaxY;
while ((Blue_y(PY2,1)>=Y_threshlow)&&(PY2<y))%阈值为5
PY2=PY2+1;
end
PY1, PY2
%==============2次寻找X方向===============================
X_threshhigh=(PY2-PY1)/15;%这个数值很重要。决定了提取的彩图的质量,适当提高可抗干扰,但是小图会照成剪裁太多,ganrao
Blue_x=zeros(1,x); % 进一步确定X方向的车牌区域
for j=1:x
for i=PY1:PY2
%if((myI(i,j,1)<=45)&&((myI(i,j,2)<=90)&&(myI(i,j,2)>=20))&&((myI(i,j,3)<=160)&&(myI(i,j,3)>=80)))
if ((myI(i,j,1)<=0.7)&&(myI(i,j,1)>=0.6)&&((myI(i,j,2)<=1.8)&&(myI(i,j,2)>=0.6))&&((myI(i,j,3)<=1.7)&&(myI(i,j,3)>=0.4)))
Blue_x(1,j)= Blue_x(1,j)+1;
end
end
end
%这里修改成了从中间向两边扩展,这个方法不好。因车牌中间某些位置可能出现断层。
%采用增强型两边往中间收缩。
[temp MaxX]=max(Blue_x);
PX1=MaxX-6*(PY2-PY1);
if PX1<=1
PX1=1;
end
while ((Blue_x(1,PX1)<=X_threshhigh)&&(PX1<x))%阈值
PX1=PX1+1;
end %确定出X方向车牌起点
PX2=MaxX+6*(PY2-PY1);
if PX2>=x
PX2=x;
end
while ((Blue_x(1,PX2)<=X_threshhigh)&&(PX2>PX1))%阈值
PX2=PX2-1;
end%确定出X方向车牌终点
% PX1=1;
% while ((Blue_x(1,PX1)<=X_threshhigh)&&(PX1<x))%阈值
% PX1=PX1+1;
% end
% PX2=x;
% while ((Blue_x(1,PX2)<X_threshhigh)&&(PX2>PX1))%阈值
% PX2=PX2-1;
% end
PX1 ,PX2
%=========================================================
a=PY2-PY1+1;b=PX2-PX1+1;
White=0;
for i=PY1:PY2
for j=PX1:PX2
if (std([I_bai(i,j,1) I_bai(i,j,2) I_bai(i,j,3)],1,2)<=16)&&(I_bai(i,j,1)>=90)&&(I_bai(i,j,1)<=255)
White= White+1; % 白色象素点统计
end
end
end
baisebili=White/(a*b)
changkuanbi=a/b
k=k+1
end
end
%========================================================
Y_firrectify=fix((PY2-PY1)/5);%适当扩大这个值可以正确旋转
PY1=PY1-Y_firrectify;%对车牌区域的修正,向上
PY2=PY2+Y_firrectify;%对车牌区域的修正,向下
% IY=I(PY1:PY2,:,:);%在Y方向对图片截取
PX1=PX1-X_firrectify;% 对车牌区域的修正
PX2=PX2+X_firrectify;% 对车牌区域的修正,
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
Matlab车牌识别源代码 (135个子文件)
26.BMP 76KB
13.BMP 71KB
11.BMP 67KB
23.BMP 52KB
CPGUI.BMP 51KB
19.BMP 50KB
32.BMP 50KB
24.BMP 47KB
10.BMP 46KB
20.BMP 46KB
9.BMP 45KB
7.BMP 44KB
15.BMP 44KB
27.BMP 43KB
16.BMP 41KB
12.BMP 38KB
0.BMP 34KB
14.BMP 33KB
33.BMP 32KB
6.BMP 31KB
5.BMP 19KB
2.BMP 19KB
4.BMP 19KB
8.BMP 19KB
1.BMP 18KB
3.BMP 18KB
21.BMP 17KB
29.BMP 5KB
30.BMP 5KB
25.BMP 4KB
22.BMP 4KB
28.BMP 4KB
31.BMP 4KB
17.BMP 4KB
18.BMP 4KB
CPYUE.BMP 2KB
CPSU.BMP 2KB
CPJING.BMP 2KB
cpguizhou.bmp 2KB
车牌识别说明文档.doc 1.08MB
20090430754.jpg 783KB
20090504806.jpg 754KB
20090430755.jpg 750KB
20090430756.jpg 749KB
20090503773.jpg 728KB
20090501762.jpg 727KB
20090505814.jpg 699KB
20090425705.jpg 697KB
20090430759.jpg 689KB
20090504805.jpg 671KB
20090425679.jpg 658KB
20090425686.jpg 656KB
20090505811.jpg 645KB
20090505813.jpg 642KB
20090504798.jpg 636KB
20090504804.jpg 634KB
20090425685.jpg 628KB
20090425706.jpg 627KB
20090425680.jpg 618KB
20090425682.jpg 616KB
20090504797.jpg 613KB
20090505809.jpg 606KB
20090425691.jpg 603KB
20090503785.jpg 593KB
20090501770.jpg 590KB
20090423671.jpg 565KB
20090425690.jpg 560KB
20090424675.jpg 543KB
20090425710.jpg 535KB
20090504794.jpg 501KB
20090423670.jpg 495KB
20090504808.jpg 474KB
20090425709.jpg 461KB
20090504801.jpg 440KB
caitu_fenge.m 6KB
main.m 6KB
duquszzm.m 3KB
duchushengyin.m 3KB
duquzimu.m 2KB
shibiezm_sz.m 2KB
shibiezimu.m 2KB
shuzifenge.m 1KB
duqushuzi.m 1KB
SEC_xiuzheng.m 805B
shibiehanzi.m 645B
touying.m 620B
duquhanzi.m 507B
rando_bianhuan.m 503B
shibieshuzi.m 378B
caitu_tiqu.m 7KB
程序运行中.wav 129KB
提取出错.wav 126KB
车牌检测.wav 118KB
检测结果.wav 115KB
车牌定位出错.wav 115KB
G.WAV 75KB
C.WAV 70KB
H.WAV 68KB
W.WAV 66KB
Q.WAV 65KB
共 135 条
- 1
- 2
朱宇阳
- 粉丝: 68
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论3