开发工具:
文件大小: 4kb
下载次数: 0
上传时间: 2009-01-02
详细说明: 进行车牌定位和识别 clear; clc; close all; chos=0; possibility=5; while chos~=possibility, %%%%%%%%%%%%%%%%%%%%%%%%%制作操作栏%%%%%%%%%%%%%%%%%% chos=menu('车牌定位系统','载入图片','图象处理','图象分割','车牌号码识别','退出'); if chos==1, clc; [namefile,pathname]=uigetfile('*.jpg','Select image'); if namefile~=0 I=imread(strcat(pathname,namefile)); imshow(I); end end %二值化 if chos==2, I1=rgb2gray(I); %边缘化 I2=edge(I1,'rob ert',0.15,'both'); %腐蚀 se=[1;1;1]; I3=imerode(I2,se); %连通 se=strel('rectangle',[25,25]); I4=imclose(I3,se); %滤波 I5=bwareaopen(I4,1500); imshow(I5); [y,x,z]=size(I5); myI=I5; %定位 %%%%%%%%%%% 统计分析 %%%%%%%%%%%%%%% %%%%%%%% Y 方向 %%%%%%%%%% whitr_y=zeros(y,1); for i=1:y for j=1:x if(myI(i,j,1)==1) % 白色RGB的灰度范围 whitr_y(i,1)= whitr_y(i,1)+1; % 白色象素点统计 end end end [temp MaxY]=max(whitr_y); % Y方向车牌区域确定 PY1=MaxY; while ((whitr_y(PY1,1)>=5)&&(PY1>1)) PY1=PY1-1; end PY2=MaxY; while ((whitr_y(PY2,1)>=5)&&(PY2PX1)) PX2=PX2-1; end Plate=I(PY1-13:PY2+13,PX1-5:PX2+5,:);%预留多些利于倾斜校正 % t=toc % 读取计时 ;imshow(Plate);title('Plate'); end if chos==3, I8=rgb2gray(Plate); %%%%%%%根据直方图 %subplot(2,2,1);imshow(I8);title('原始图像'); %subplot(2,2,2);imhist(I8);title('直方图像'); bw_160=I8>160; %subplot(2,2,3);imshow(bw_160);title('取阈值160图像'); bw_210=I8>210; %subplot(2,2,4);imshow(bw_210);title('取阈值210图像'); [r,c]=find(bw_210==0); bw=bwselect(~bw_160,c,r,8); figure,imshow(bw); title('分割图像'); word1=bw(14:53,6:30); word2=bw(14:53,34:58); word3=bw(14:53,60:84); word4=bw(14:53,113:137); word5=bw(14:53,140:164); word6=bw(17:56,166:190); subplot(2,3,1);imshow(word1);title('1'); subplot(2,3,2);imshow(word2);title('2'); subplot(2,3,3);imshow(word3);title('3'); subplot(2,3,4);imshow(word4);title('4'); subplot(2,3,5);imshow(word5);title('5'); subplot(2,3,6);imshow(word6);title('6'); end if chos==4 g=uint8(word1)*255; for i=1:36 w=strcat('E:\work\moban1\',num2str(i),'.jpg');%所放的摸版位置 n=imread(w); n=rgb2gray(n); s=g-n s=sum(s) r(i)=sum(s) end m=min(r); for i=1:36 if m==r(i) q=strcat('E:\work\moban1\',num2str(i),'.jpg');%所放的摸版位置 qq=imread(q); figure,imshow(qq); end end end end ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.