资源简介
车牌的matlab连通区域的提取,以前做的,连通区域提取
代码片段和文件信息
[KNUM]= bwlabel(I58);
sumconnect=zeros(1NUM);
L=NUM;
while(L>0)
for i=1:M
for j=1:N
if K(ij)==L
sumconnect(L)=sumconnect(L)+1;
end
end
end
L=L-1;
end
avgconnect=sum(sumconnect)/NUM;
for i=1:M
for j=1:N
for k=1:NUM
if K(ij)~=0
if K(ij)==k && sumconnect(k) K(ij)=0;
end
if K(ij)==k && sumconnect(k)>avgconnect
K(ij)=1;
end
end
end
end
end
figure(9)imshow(K);
B=bwboundaries(K8‘noholes‘);
bounds=[];
for k=1:length(B)
Code{k}=[];
boundary=B{k};
[nrnc]=size(B{k});
HI=zeros(1nr);
WI=zeros(1nr);
for i=2:nr
x=B{k}(i1)-B{k}(i-11);
y=B{k}(
评论
共有 条评论