function varargout = chepaishibie(varargin)
% 开始初始化代码 - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @chepaishibie_OpeningFcn, ...
'gui_OutputFcn', @chepaishibie_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% 结束初始化代码
pause(1);
% 执行之前主要是可见的。
function chepaishibie_OpeningFcn(hObject, eventdata, handles, varargin)
axes(handles.axes1);
imshow([255]);
axes(handles.axes2);
imshow([255]);
axes(handles.axes3);
imshow([255]);
axes(handles.axes4);
imshow([255]);
axes(handles.axes5);
imshow([255]);
axes(handles.axes6);
imshow([255]);
axes(handles.axes7);
imshow([255]);
axes(handles.axes8);
imshow([255]);
axes(handles.axes9);
imshow([255]);
axes(handles.axes10);
imshow([255]);
set(handles.text5,'String','');
% 此函数没有输出参数,见 OutputFcn.
% main的选择默认的命令行输出
handles.output = hObject;
% 更新handles 结构
guidata(hObject, handles);
% UIWAIT 等待用户响应 (see UIRESUME)
% uiwait(handles.figure1);
% --- 这个函数的输出返回到命令行。
function varargout = chepaishibie_OutputFcn(hObject, eventdata, handles)
tic
% 获得缺省命令行输出的把手结构
varargout{1} = handles.output;
% --- 执行按钮在pushbutton1。
function pushbutton1_Callback(hObject, eventdata, handles)
[filename pathname]=uigetfile({'*.jpg';'*.bmp'}, 'File Selector');
I = imread([pathname '\' filename]);
handles.I = I;
% 更新处理结构
guidata(hObject, handles);
axes(handles.axes1);
imshow(I);title('原始图片')
set(handles.process,'enable','on')
% --- 执行过程中按下按钮。
function process_Callback(hObject, eventdata, handles)
function pushbutton6_Callback(hObject, eventdata, handles)
close(gcf);
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
axes(handles.axes1);
imshow([255]);
axes(handles.axes2);
imshow([255]);
axes(handles.axes3);
imshow([255]);
axes(handles.axes4);
imshow([255]);
axes(handles.axes5);
imshow([255]);
axes(handles.axes6);
imshow([255]);
axes(handles.axes7);
imshow([255]);
axes(handles.axes8);
imshow([255]);
axes(handles.axes9);
imshow([255]);
axes(handles.axes10);
imshow([255]);
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
[filename pathname]=uigetfile({'*.*'}, 'File Selector');
I = imread([pathname '\' filename]);
handles.I = I;
% 更新处理结构
guidata(hObject, handles);
axes(handles.axes1);
imshow(I);title('原始图片')
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
I = handles.I;
I = qingxiejiaozheng(I);
I1=rgb2gray(I);%rgb2gray转换成灰度图
guidata(hObject, handles);
axes(handles.axes2);
imshow(I1);title('灰度图');
axes(handles.axes3);
imhist(I1);title('灰度图直方图');
ifpause = 1;
%继续
if ifpause == 1
pause(2);
end
[chase,erzhi,zuizhong,guiyitu]=biaozhifengeB(I);
se = strel('disk',10);
erzhi = imclose(erzhi,se);
erzhi = bwareaopen(erzhi,200,8);
[l,m] = bwlabel(erzhi,8);
status=regionprops(l,'BoundingBox');
dw = imcrop(I,status(1).BoundingBox);
axes(handles.axes3);
imshow(dw),title('定位剪切后的彩色车牌图像');
a = dw;
b=rgb2gray(a);%对定位后的车牌灰度化
g_max=double(max(max(b)));
g_min=double(min(min(b)));
T=round(g_max-(g_max-g_min)/2); %T 为二值化的阈值
[m,n]=size(b);
d=(double(b)>=T); % d:二值图像
h=fspecial('average',3); %均值滤波器
d=im2bw(round(filter2(h,d)));
[dheight,dwidth] = size(d);
top = fix(0.15 * dheight);
bottom = fix(0.9 * dheight);
dwidth2 = dwidth * 0.15;
dheight2 = dheight * 0.8;
d1 = imcrop(d,[1,top,dwidth2,dheight2]);
d2 = imcrop(d,[fix(0.14 * dwidth),top,dwidth2,dheight2]);
d3 = imcrop(d,[fix(0.33 * dwidth),top,dwidth2,dheight2]);
d4 = imcrop(d,[fix(0.45 * dwidth),top,dwidth2,dheight2]);
d5 = imcrop(d,[fix(0.59 * dwidth),top,dwidth2,dheight2]);
d6 = imcrop(d,[fix(0.74 * dwidth),top,dwidth2,dheight2]);
d7 = imcrop(d,[fix(0.87 * dwidth),top,dwidth2,dheight2]);
words{1} = d1;
words{2} = d2
words{3} = d3;
words{4} = d4;
words{5} = d5;
words{6} = d6;
words{7} = d7;
for i = 1:7
words{i} = guiyi(words{i},words{i});
words{i} = imresize(words{i},[40 20]);
imwrite(words{i},strcat(num2str(i),'.bmp'));
end
if ifpause == 1
pause(1);
end
guidata(hObject, handles);
axes(handles.axes4);imshow(words{1}),title('1');
guidata(hObject, handles);
axes(handles.axes5);imshow(words{2}),title('2');
guidata(hObject, handles);
axes(handles.axes6);imshow(words{3}),title('3');
guidata(hObject, handles);
axes(handles.axes7);imshow(words{4}),title('4');
guidata(hObject, handles);
axes(handles.axes8);imshow(words{5}),title('5');
guidata(hObject, handles);
axes(handles.axes9);imshow(words{6}),title('6');
guidata(hObject, handles);
axes(handles.axes10);imshow(words{7}),title('7');
if ifpause == 1
pause(1);
end
liccode=char(['0':'9' 'A':'Z' '苏京粤鲁桂闽浙豫吉']); %建立自动识别字符代码表
result = '';
for zifu = 1:7
xiangsidu = zeros(1,length(liccode));
U=length(find(words{zifu})~=0);
for i = 1:length(liccode)
lujing = strcat('模板库\',liccode(i),'\');
imgDir = dir([lujing '*.bmp']); % 遍历所有jpg格式文件
if length(imgDir) > 0
Y=zeros(1,length(imgDir));
end
for j = 1:length(imgDir) % 遍历结构体就可以一一处理图片了
img = imread([lujing imgDir(j).name]); %读取每张图片
T=length(find(img)~=0);
tempV=words{zifu}& img;
V=length(find(tempV)~=0);
tempW=xor(tempV,img);
W=length(find(tempW)~=0);
tempX=xor(tempV,words{zifu});
X=length(find(tempX)~=0);
TUV=(T+U+V)/3;
tempSum=sqrt(((T-TUV)*(T-TUV)+(U-TUV)*(U-TUV)+(V-TUV)*(V-TUV))/2);
Y(j)=V/(W/T*X/U*tempSum);
end
% [MAX,indexMax]=max(Y);
if length(imgDir) > 0
xiangsidu(i) = max(Y);
end
end
[MAX,indexMax]=max(xiangsidu);
result = strcat(result,liccode(indexMax));
end
set(handles.text5,'String',result);
%
% guidata(hObject, handles);
% axes(handles.axes3);
% imshow(dw),title (['车牌识别号码:', Code],'Color','b');
% set(handles.text5,'String',Code);
% hObject handle to pushbutton10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton11.
function pushbutton11_Callback(hObject, eventdata, handles)
axes(handles.axes1);
imshow([255]);
axes(handles.axes2);
imshow([255]);
axes(handles.axes3);
imshow([255]);
axes(handles.axes4);
imshow([255]);
axes(handles.axes5);
imshow([255]);
axes(handles.axes6);
imshow([255]);
axes(handles.axes7);
imshow([255]);
axes(handles.axes8);
imshow([255]);
axes(handles.axes9);
imshow([255]);
axes(handles.axes10);
imshow([255]);
set(handles.text5,'String','');
% hObject handle to pushbutton11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user dat
没有合适的资源?快使用搜索试试~ 我知道了~
2021040602_基于MATLAB的车牌识别系统.rar
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共155个文件
bmp:127个
jpg:17个
m:9个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
需积分: 5 0 下载量 120 浏览量
2024-05-25
20:23:21
上传
评论
收藏 64.28MB RAR 举报
温馨提示
2021040602_基于MATLAB的车牌识别系统
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
共 155 条
- 1
- 2
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/fbf5e934a1d24626a0b17f9cff935a19_ashlee61.jpg!1)
会上树的考拉
- 粉丝: 474
- 资源: 217
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)