车牌识别国家(军车牌识别)

 胡来网   2023-02-13 00:38   96 views 人阅读  0 条评论
摘要:

车牌识别中模板是怎么制作的用matlab来做车牌识?车牌识别中模08,’both’);figure(3),imshow(I2);title(‘robert算子边缘检测’)se=[1;1;1];I

  车牌识别中模板是怎么制作的用matlab来做车牌识?车牌识别中模

  08,'both');

  figure(3),imshow(I2);title('robert算子边缘检测')

  se=[1;1;1];

  I3=imerode(I2,se);

  figure(4),imshow(I3);title('腐蚀后图像');

  se=strel('rectangle',[40,40]);

  I4=imclose(I3,se);

  figure(5),imshow(I4);title('平滑图像的轮廓');

  I5=bwareaopen(I4,2000);

  figure(6),imshow(I5);title('从对象中移除小对象');

  [y,x,z]=size(I5);

  myI=double(I5);

  %begin横向扫描

  Blue_y=zeros(y,1);

  for i=1:y

  for j=1:x

  if(myI(i,j,1)==1)

  %如果myI(i,j,1)即myI图像中坐标为(i,j)的点为蓝色

  %则Blue_y的相应行的元素white_y(i,1)值加1

  Blue_y(i,1)=Blue_y(i,1)+1;%蓝色像素点统计

  end

  end

  [temp MaxY]=max(Blue_y);%temp为向量white_y的元素中的最大值,MaxY为该值的索引( 在向量中的位置)

  PY1=MaxY;

  while ((Blue_y(PY1,1)>=120)&&(PY1>1))

  PY1=PY1-1;

  end

  PY2=MaxY;

  while ((Blue_y(PY2,1)>=40)&&(PY2PX1))

  PX2=PX2-1;

  end

  %end纵向扫描

  PX1=PX1-2;%对车牌区域的校正

  PX2=PX2+2;

  dw=I(PY1:PY2,:,:);

  t=toc;

  figure(7),subplot(1,2,1),imshow(IY),title('行方向合理区域');

  figure(7),subplot(1,2,2),imshow(dw),title('定位剪切后的彩色车牌图像')。

  车牌识别中模板是怎么制作的用matlab来做车牌识?车牌识别中模

  08,'both');

  figure(3),imshow(I2);title('robert算子边缘检测')

  se=[1;1;1];

  I3=imerode(I2,se);

  figure(4),imshow(I3);title('腐蚀后图像');

  se=strel('rectangle',[40,40]);

  I4=imclose(I3,se);

  figure(5),imshow(I4);title('平滑图像的轮廓');

  I5=bwareaopen(I4,2000);

  figure(6),imshow(I5);title('从对象中移除小对象');

  [y,x,z]=size(I5);

  myI=double(I5);

  %begin横向扫描

  Blue_y=zeros(y,1);

  for i=1:y

  for j=1:x

  if(myI(i,j,1)==1)

  %如果myI(i,j,1)即myI图像中坐标为(i,j)的点为蓝色

  %则Blue_y的相应行的元素white_y(i,1)值加1

  Blue_y(i,1)=Blue_y(i,1)+1;%蓝色像素点统计

  end

  end

  [temp MaxY]=max(Blue_y);%temp为向量white_y的元素中的最大值,MaxY为该值的索引( 在向量中的位置)

  PY1=MaxY;

  while ((Blue_y(PY1,1)>=120)&&(PY1>1))

  PY1=PY1-1;

  end

  PY2=MaxY;

  while ((Blue_y(PY2,1)>=40)&&(PY2PX1))

  PX2=PX2-1;

  end

  %end纵向扫描

  PX1=PX1-2;%对车牌区域的校正

  PX2=PX2+2;

  dw=I(PY1:PY2,:,:);

  t=toc;

  figure(7),subplot(1,2,1),imshow(IY),title('行方向合理区域');

  figure(7),subplot(1,2,2),imshow(dw),title('定位剪切后的彩色车牌图像')。

本文地址:http://www.hzdgpx.com/17983.html
版权声明:本文为转载文章,由 胡来网编辑整理 ,版权归原作者所有,欢迎分享本文,转载请保留出处!

 发表评论


表情