车牌识别的matlab程序(程序_讲解_模板),车牌识别的matlab程序(程序,讲解,模板)

clc

clear close all

I=imread('chepai.jpg');

subplot(3,2,1);imshow(I), title('原始图像');

I_gray=rgb2gray(I);

subplot(3,2,2),imshow(I_gray),title('灰度图像');

%====================== 形态学预处理 ====================== I_edge=edge(I_gray,'sobel');

subplot(3,2,3),imshow(I_edge),title('边缘检测后图像'); se=[1;1;1];

I_erode=imerode(I_edge,se);

subplot(3,2,4),imshow(I_erode),title('腐蚀后边缘图像');

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

I_close=imclose(I_erode,se); %图像闭合、填充图像 subplot(3,2,5),imshow(I_close),title('填充后图像');

I_final=bwareaopen(I_close,2000); %去除聚团灰度值小于2000的部分 subplot(3,2,6),imshow(I_final),title('形态滤波后图像');

%========================== 车牌分割 ============================= I_new=zeros(size(I_final,1),size(I_final,2)); location_of_1=[];

for i=1:size(I_final,1) %寻找二值图像中白的点的位置 for j=1:size(I_final,2)

if I_final(i,j)==1;

newlocation=[i,j];

location_of_1=[location_of_1;newlocation]; end end end

mini=inf;maxi=0;

for i=1:size(location_of_1,1)

%寻找所有白点中,x坐标与y坐标的和最大,最小的两个点的位置 temp=location_of_1(i,1)+location_of_1(i,2); if temp

if temp>maxi maxi=temp; b=i;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值