资源简介

淘宝上花钱买的车牌识别MATLAB代码,能够很好的识别车牌字母,有GUI和脚本两类。

资源截图

代码片段和文件信息

function [PY2PY1PX2PX1]=caitu_fenge(I)
[yxz]=size(I);
myI=double(I);
Y_threshlow=5;%这个数值很重要。决定了提取的彩图的质量
X_firrectify=5;%ganrao transaction
%====================== Y 方向============================
Blue_y=zeros(y1);
for i=1:y
    for j=1:x
       %if (myI(ij1)<=48)&&(myI(ij2)>=40)&&(myI(ij2)<=90)&&(myI(ij3)<=220)&&(myI(ij3)>=80)    
        if((myI(ij1)<=48)&&((myI(ij2)<=100)&&(myI(ij2)>=40))&&((myI(ij3)<=200)&&(myI(ij3)>=80)))  
        %if ((myI(ij1)<=0.7)&&(myI(ij1)>=0.6)&&((myI(ij2)<=1.8)&&(myI(ij2)>=0.6))&&((myI(ij3)<=1.7)&&(myI(ij3)>=0.45)))
           Blue_y(i1)= Blue_y(i1)+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(PY11)>=Y_threshlow)&&(PY1>1))%找到图片上边界
            PY1=PY1-1;
        end 
       
        %PY1:存储车牌上边界值
        PY2=MaxY;
        while ((Blue_y(PY21)>=Y_threshlow)&&(PY2             PY2=PY2+1;
        end
        PY1 PY2
 
%==============X 方向===============================
        X_threshhigh=(PY2-PY1)/11;%这个数值很重要。决定了提取的彩图的质量适当提高可抗干扰,但是小图会照成剪裁太多
        Blue_x=zeros(1x);             % 进一步确定X方向的车牌区域
        for j=1:x
            for i=PY1:PY2
              %  if((myI(ij1)<=48)&&((myI(ij2)<=90)&&(myI(ij2)>=30))&&((myI(ij3)<=160)&&(myI(ij3)>=80)))      
                if((myI(ij1)<=65)&&((myI(ij2)<=100)&&(myI(ij2)>=40))&&((myI(ij3)<=160)&&(myI(ij3)>=90)))%这里由82修改成90.因为图片20090504809   
               %  if ((myI(ij1)<=0.7)&&(myI(ij1)>=0.6)&&((myI(ij2)<=1.8)&&(myI(ij2)>=0.6))&&((myI(ij3)<=1.7)&&(myI(ij3)>=0.45)))
                 Blue_x(1j)= Blue_x(1j)+1;               
                end  
            end       
        end
        [temp MaxX]=max(Blue_x);
        PX1=MaxX-6*(PY2-PY1);
        if  PX1<=1
            PX1=1;
        end
        while ((Blue_x(1PX1)<=X_threshhigh)&&(PX1              PX1=PX1+1;
        end %确定出X方向车牌起点   
        PX2=MaxX+6*(PY2-PY1);
        if  PX2>=x
            PX2=x;
        end
        while ((Blue_x(1PX2)<=X_threshhigh)&&(PX2>PX1))%阈值
               PX2=PX2-1;
        end%确定出X方向车牌终点
        
%         PX1=1;
%         while ((Blue_x(1PX1)<=X_threshhigh)&&(PX1%              PX1=PX1+1;
%         end %确定出X方向车牌起点   
%         PX2=x;
%         while ((Blue_x(1PX2)PX1))%阈值
%             PX2=PX2-1;
%        end%确定出X方向车牌终点
        PX1 PX2

%=========================================================       
        a=PY2-PY1+1;b=P

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-04-10 16:51  China_Vehicle number plate recognition\
     目录           0  2016-04-10 16:51  China_Vehicle number plate recognition\车牌识别程序\
     文件       34710  2009-05-03 06:30  China_Vehicle number plate recognition\车牌识别程序\0.BMP
     文件       18630  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\1.BMP
     文件       47574  2009-05-03 06:30  China_Vehicle number plate recognition\车牌识别程序\10.BMP
     文件       68934  2009-05-03 06:30  China_Vehicle number plate recognition\车牌识别程序\11.BMP
     文件       39114  2009-05-03 06:30  China_Vehicle number plate recognition\车牌识别程序\12.BMP
     文件       72762  2009-05-03 06:30  China_Vehicle number plate recognition\车牌识别程序\13.BMP
     文件       33342  2009-05-03 06:30  China_Vehicle number plate recognition\车牌识别程序\14.BMP
     文件       45198  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\15.BMP
     文件       41502  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\16.BMP
     文件        4278  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\17.BMP
     文件        3750  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\18.BMP
     文件       51574  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\19.BMP
     文件       19494  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\2.BMP
     文件       47222  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\20.BMP
     文件       17254  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\21.BMP
     文件        4278  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\22.BMP
     文件       59088  2013-12-14 14:24  China_Vehicle number plate recognition\车牌识别程序\222.jpg
     文件       53198  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\23.BMP
     文件       48366  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\24.BMP
     文件        4278  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\25.BMP
     文件       78018  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\26.BMP
     文件       44390  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\27.BMP
     文件        4278  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\28.BMP
     文件        4806  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\29.BMP
     文件       18534  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\3.BMP
     文件        4806  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\30.BMP
     文件        4278  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\31.BMP
     文件       50838  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\32.BMP
     文件       32430  2009-05-03 06:31  China_Vehicle number plate recognition\车牌识别程序\33.BMP
............此处省略72个文件信息

评论

共有 条评论