資源簡介
本程序是基于MATLAB語言開發和實現的。能夠實現對車牌整體的準確識別。

代碼片段和文件信息
function?[?dw?]=?cpdw(?I?)
subplot(321)imshow(I)title(‘原始圖像‘);
I1=rgb2gray(I);%轉化為灰度圖像
subplot(322)imshow(I1)title(‘灰度圖像‘);
I2=edge(I1‘roberts‘0.09‘both‘);%采用robert算子進行邊緣檢測
subplot(323)imshow(I2)title(‘邊緣檢測后圖像‘);
se=[1;1;1];
I3=imerode(I2se);????%腐蝕圖像
subplot(324)imshow(I3)title(‘腐蝕后邊緣圖像‘);
se=strel(‘rectangle‘[2525]);
I4=imclose(I3se);%圖像聚類、填充圖像
subplot(325)imshow(I4)title(‘填充后圖像‘);
I5=bwareaopen(I42000);%去除聚團灰度值小于2000的部分
subplot(326)imshow(I5)title(‘形態濾波后圖像‘);
[yxz]=size(I5);
I6=double(I5);
?Y1=zeros(y1);
?for?i=1:y
????for?j=1:x
?????????????if(I6(ij1)==1)?
????????????????Y1(i1)=?Y1(i1)+1;?
????????????end??
?????end???????
?end
?[temp?MaxY]=max(Y1);
??[temp?MaxY]=max(Y1);
?figure();
?subplot(321)plot(0:y-1Y1)title(‘行方向像素點灰度值累計和‘)xlabel(‘行值‘)ylabel(‘像素‘);?
?%%%%%%%求的車牌的行起始位置和終止位置%%%%%%%%%
?PY1=MaxY;
?while?((Y1(PY11)>=50)&&(PY1>1))
????????PY1=PY1-1;
?end????
?PY2=MaxY;
?while?((Y1(PY21)>=100)&&(PY2 ????????PY2=PY2+1;
?end
?IY=I(PY1:PY2::);
?X1=zeros(1x);
?for?j=1:x
?????for?i=PY1:PY2
????????????if(I6(ij1)==1)
????????????????X1(1j)=?X1(1j)+1;???????????????
????????????end??
?????end???????
?end
?subplot(322)plot(0:x-1X1)title(‘列方向像素點灰度值累計和‘)xlabel(‘列值‘)ylabel(‘像數‘);
?%%%%%求的車牌的列起始位置和終止位置%%%%%%
?PX1=1;
?while?((X1(1PX1)<3)&&(PX1 ???????PX1=PX1+1;
?end????
?PX2=x;
?while?((X1(1PX2)<3)&&(PX2>PX1))
????????PX2=PX2-1;
?end
?PX1=PX1-1;
?PX2=PX2+1;
?%%分割出車牌圖像%%
dw=I(PY1:PY2PX1:PX2:);
subplot(323)imshow(dw)title(‘定位剪切后的彩色車牌圖像‘)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-03-25?21:00??BP車牌檢測\
?????文件?????1504827??2018-07-02?20:34??BP車牌檢測\1.JPG
?????文件???????22626??2018-03-27?16:16??BP車牌檢測\11.jpg
?????文件????????1749??2018-04-23?13:02??BP車牌檢測\cpdw.m
?????文件?????????333??2018-05-03?16:19??BP車牌檢測\pretreatment.m
?????文件????????1893??2018-04-23?13:36??BP車牌檢測\zffg.m
?????文件????????4661??2018-07-02?20:37??BP車牌檢測\zhuchengxu.m
?????目錄???????????0??2019-03-25?21:00??BP車牌檢測\臨時庫\
?????文件????????1170??2018-04-19?15:17??BP車牌檢測\臨時庫\0-0.jpg
?????文件?????????989??2018-05-02?11:40??BP車牌檢測\臨時庫\0-1.jpg
?????文件?????????689??2018-04-19?15:16??BP車牌檢測\臨時庫\1-0.jpg
?????文件?????????907??2018-05-02?11:40??BP車牌檢測\臨時庫\1-1.jpg
?????文件????????1508??2018-04-19?15:16??BP車牌檢測\臨時庫\2-0.jpg
?????文件????????1495??2018-05-02?12:50??BP車牌檢測\臨時庫\2-1.jpg
?????文件????????1479??2018-04-19?15:16??BP車牌檢測\臨時庫\3-0.jpg
?????文件????????1077??2018-05-02?11:40??BP車牌檢測\臨時庫\3-1.jpg
?????文件????????1331??2018-04-19?15:16??BP車牌檢測\臨時庫\4-0.jpg
?????文件?????????989??2018-05-02?11:40??BP車牌檢測\臨時庫\4-1.jpg
?????文件????????1432??2018-04-19?15:16??BP車牌檢測\臨時庫\5-0.jpg
?????文件????????1089??2018-05-02?11:40??BP車牌檢測\臨時庫\5-1.jpg
?????文件????????1600??2018-04-19?15:17??BP車牌檢測\臨時庫\6-0.jpg
?????文件????????1034??2018-05-02?11:40??BP車牌檢測\臨時庫\6-1.jpg
?????文件????????1136??2018-04-19?15:17??BP車牌檢測\臨時庫\7-0.jpg
?????文件?????????886??2018-05-02?11:40??BP車牌檢測\臨時庫\7-1.jpg
?????文件????????1830??2018-04-19?15:17??BP車牌檢測\臨時庫\8-0.jpg
?????文件????????1692??2018-05-02?11:21??BP車牌檢測\臨時庫\8-1.jpg
?????文件????????1054??2018-05-02?11:40??BP車牌檢測\臨時庫\8-2.jpg
?????文件????????1270??2018-04-19?15:17??BP車牌檢測\臨時庫\9-0.jpg
?????文件?????????997??2018-05-02?11:40??BP車牌檢測\臨時庫\9-1.jpg
?????文件????????1444??2018-04-19?15:18??BP車牌檢測\臨時庫\A-0.jpg
?????文件????????1035??2018-05-02?11:40??BP車牌檢測\臨時庫\A-1.jpg
............此處省略132個文件信息
評論
共有 條評論