• 大小: 6KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-18
  • 语言: Matlab
  • 标签: 字符分割  

资源简介

基于matlab的车牌定位、字符分割,车牌分割字符保存为7张bmp格式图片

资源截图

代码片段和文件信息

function [PY2PY1PX2PX1]=Cut_out(I)   %彩图分割

%-----------ck----------------------
% clc;
% clear all;
% close all;
% I=imread(‘car8.jpg‘);
%-----------ck----------------------

[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 ((Bl

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       6775  2015-03-28 23:34  Cut_out.m

     文件       3098  2018-04-01 20:29  main_Recog.m

     文件        709  2015-03-28 23:53  Projective_Img.m

     文件        831  2015-03-28 23:38  Revise_size.m

     文件       1532  2015-03-28 23:57  Separate_char.m

     文件       1083  2015-03-28 23:50  Tilt_Correct.m

----------- ---------  ---------- -----  ----

                14028                    6


评论

共有 条评论