資源描述:
《基于matlab的車牌定位源程序及運行結(jié)果.doc》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、I=imread('E:畢業(yè)設(shè)計基于matlab的車牌定位的源程車牌識別程序Car1.jpg')[y,x,z]=size(I);myI=double(I);ticBlue_y=zeros(y,1);fori=1:yforj=1:xif((myI(i,j,1)<=30)&&((myI(i,j,2)<=62)&&(myI(i,j,2)>=51))&&((myI(i,j,3)<=142)&&(myI(i,j,3)>=119)))Blue_y(i,1)=Blue_y(i,1)+1;endendend[tempMaxY]=max(Blue_y);PY1=MaxY;w
2、hile((Blue_y(PY1,1)>=5)&&(PY1>1))PY1=PY1-1;endPY2=MaxY;while((Blue_y(PY2,1)>=5)&&(PY2=51))&&((myI(i,j,3)<=142)&&(myI(i,j,3)>=119)))Blue_x(1,j)=Blue_x(1,j)+1;end
3、endendPX1=1;while((Blue_x(1,PX1)<3)&&(PX1PX1))PX2=PX2-1;endPX1=PX1-2;PX2=PX2+2;Plate=I(PY1:PY2,PX1-2:PX2,:);t=tocfigure,imshow(I);figure,plot(Blue_y);gridfigure,plot(Blue_x);gridfigure,imshow(IY);figure,imshow(Plate);運行結(jié)果:t=0.4971