資源簡(jiǎn)介
車牌識(shí)別,MATLAB源代碼,夜間車牌識(shí)別程序
代碼片段和文件信息
clear?all
clc
PS=imread(‘1.jpg‘);
subplot(121);
imshow(PS)
title(‘原圖‘)
p=rgb2gray(PS);
subplot(122)
imshow(p)
title(‘原灰度圖‘)
[mn]=size(p);
GP=zeros(1256);
for?k=0:255
GP(k+1)=length(find(p==k))/(m*n);
end
figure
subplot(121);
bar(0:255GP‘g‘)
title(‘原灰度直方圖‘)
max_index=[];
for?i=3:length(GP)-2
if((GP(i)>=GP(i+1))&(GP(i)>=GP(i-1)))&((GP(i+1)>=GP(i+2))&(GP(i-1)>=GP(i-2)))
max_index(end+1)=i-1;
end
end
possible=GP(max_index);
[max_valueindex]=max(possible);
TT=max_index(index)-2;
[mn]=size(p);
R=zeros(mn);
for?i=1:m
????for?j=1:n
????????if?p(ij)???????????R(ij)=0;
????????else?R(ij)=256;
????????end
????end
end
subplot(122);
imshow(R);
title(‘二值圖‘);
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????37069??2009-03-05?09:25??1.jpg
?????文件?????????737??2020-03-10?21:43??chepai.m
評(píng)論
共有 條評(píng)論