function varargout = chepaishibie(varargin)
% CHEPAISHIBIE MATLAB code for chepaishibie.fig
% CHEPAISHIBIE, by itself, creates a new CHEPAISHIBIE or raises the existing
% singleton*.
%
% H = CHEPAISHIBIE returns the handle to a new CHEPAISHIBIE or the handle to
% the existing singleton*.
%
% CHEPAISHIBIE('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CHEPAISHIBIE.M with the given input arguments.
%
% CHEPAISHIBIE('Property','Value',...) creates a new CHEPAISHIBIE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before chepaishibie_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to chepaishibie_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help chepaishibie
% Last Modified by GUIDE v2.5 27-Jun-2019 05:52:04
% Begin initialization code - 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
% End initialization code - DO NOT EDIT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% --- Executes just before chepaishibie is made visible.
function chepaishibie_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to chepaishibie (see VARARGIN)
% Choose default command line output for chepaishibie
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes chepaishibie wait for user response (see UIRESUME)
% uiwait(handles.figure1);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% --- Outputs from this function are returned to the command line.
function varargout = chepaishibie_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%这是一条华丽的分割线%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%打开图片
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global I
[filename,pathname]=uigetfile('*.jpg','选择一张图片');
I=imread([pathname,filename]);
axes(handles.axes1);
imshow(I);
%%%%%%灰度处理
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global I
I1=rgb2gray(I);
%灰度直方图
[num]=huidu_zhifangtu(I1);
%均值化
[I2]=huidu_junzhihua(num,I1);
%灰度拉伸
f=double(I1);
k1=min(min(f));
k2=max(max(f));
a=(k2-k1)/2;
b=k2-80;
c=k1-20;
[I3]=huidu_lashen(a,b,c,I2);
axes(handles.axes2);
imshow(I3);
%%%%%%二值化
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global I
I4=im2bw(I, 0.70);
axes(handles.axes3)
imshow(I4);
%%%%%%定位
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global I
[I9] =dingwei(I)
I10=rgb2gray(I9);
I11=im2bw(I10,0.7);
axes(handles.axes4);
imshow(I11);%定位剪切后的彩色车牌图像')
%%%%%%字符分割前的图像处理
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% 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)
global I11
[I12]=fengeqian(I11);
I13=cut(I12);
axes(handles.axes6);
imshow(I13);
%%%%%%字符分割
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I14=I13
[~,n]=size(I14);
% 切割出 7 个字符
% 第一个字符,
y1=n*15/440;y2=0.25;flag=0;word1=[];
while flag==0
[m,~]=size(I14);
left=1;wide=0;
while sum(I14(:,wide+1))~=0 % 找到像素和为零的列
wide=wide+1;
end
if wide<y1 % 若这一列的位置在图像左侧前10列之内则认为是左侧干扰
I14(:,(1:wide))=0;%把左侧干扰全部变为0,并将其切割掉
I14=cut(I14);
else
temp=cut(imcrop(I14,[1 1 wide m]));%将一个字符剪切下来
[m,~]=size(temp);
all=sum(sum(temp));%第一个字符的像素值总和
two_thirds=sum(sum(temp((round(m/3):2*round(m/3)),:)));%单个字符中段1/3图像的像素值总和
if two_thirds/all>y2%验证是否为字符
flag=1;word1=temp; %获取第一个字符word1
end
I14(:,(1:wide))=0;I14=cut(I14);%当提取第一个字符结束或者不满足上述条件时,将该区域变为0,并切除
end
end
[word2,I14]=fenge(I14);
[word3,I14]=fenge(I14);
[word4,I14]=fenge(I14);
[word5,I14]=fenge(I14);
[word6,I14]=fenge(I14);
[word7,I14]=fenge(I14);
[m,n]=size(word1);
%归一化大小为 40*20
word1=imresize(word1,[40 20]);
word2=imresize(word2,[40 20]);
word3=imresize(word3,[40 20]);
word4=imresize(word4,[40 20]);
word5=imresize(word5,[40 20]);
word6=imresize(word6,[40 20]);
word7=imresize(word7,[40 20]);
axes(handles.axes4);
subplot(1, 7, 1),imshow(word1),title('1');
subplot(1, 7, 2),imshow(word2),title('2');
subplot(1, 7, 3),imshow(word3),title('3');
subplot(1, 7, 4),imshow(word4),title('4');
subplot(1, 7, 5),imshow(word5),title('5');
subplot(1, 7, 6),imshow(word6),title('6');
subplot(1, 7, 7),imshow(word7),title('7');
imwrite(word1,'1.jpg');
imwrite(word2,'2.jpg');
imwrite(word3,'3.jpg');
imwrite(word4,'4.jpg');
imwrite(word5,'5.jpg');
imwrite(word6,'6.jpg');
imwrite(word7,'7.jpg');
%%%%%%识别
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[shibie] =zifushibie;
h=msgbox(shibie,'识别结果');
%修改字体
ah=get(h,'CurrentAxes');
ch=get(ah,'Children');
set(ch,'FontSize',20);
% 文本居中
th = findall(0, 'Tag
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
车牌识别.rar (93个子文件)
车牌识别
5.jpg 796B
字符模板浙.jpg 1KB
dingwei.m 2KB
字符模板Z.jpg 1KB
字符模板藏.jpg 2KB
u=4249939005,132981950&fm=26&gp=0.jpg 25KB
字符模板L.jpg 812B
字符模板鄂.jpg 1KB
字符模板U.jpg 1KB
字符模板D.jpg 1KB
字符模板沪.jpg 1KB
字符模板宁.jpg 1KB
字符模板7.jpg 1KB
zifushibie.m 1KB
字符模板X.jpg 1KB
字符模板粤.jpg 1KB
字符模板1.jpg 594B
字符模板F.jpg 995B
3.jpg 659B
字符模板琼.jpg 2KB
字符模板甘.jpg 1KB
字符模板8.jpg 1KB
字符模板5.jpg 1KB
字符模板B.jpg 1KB
u=1402464347,135750843&fm=26&gp=0.jpg 28KB
字符模板豫.jpg 2KB
fengeqian.m 1KB
字符模板津.jpg 2KB
字符模板9.jpg 1KB
字符模板4.jpg 1KB
4.jpg 798B
字符模板3.jpg 1KB
字符模板J.jpg 1023B
字符模板N.jpg 1KB
下载 (2).jpg 8KB
字符模板渝.jpg 1KB
2.jpg 803B
字符模板K.jpg 1KB
huidu_lashen.m 221B
字符模板皖.jpg 1KB
5b696dbcN48f9cb01.jpg 181KB
字符模板C.jpg 1KB
字符模板新.jpg 1KB
字符模板蒙.jpg 2KB
字符模板辽.jpg 1KB
字符模板P.jpg 1KB
字符模板青.jpg 2KB
fenge.m 620B
字符模板川.jpg 1KB
字符模板Q.jpg 1KB
chepaishibie.fig 106KB
字符模板冀.jpg 2KB
字符模板晋.jpg 2KB
字符模板闽.jpg 1KB
HUIBAOYONG.m 3KB
huidu_junzhihua.m 462B
字符模板苏.jpg 1KB
字符模板R.jpg 1KB
cut.m 392B
1.jpg 824B
字符模板陕.jpg 2KB
字符模板吉.jpg 1KB
字符模板V.jpg 1KB
字符模板G.jpg 1KB
huidu_zhifangtu.m 172B
字符模板湘.jpg 2KB
car3.jpg 74KB
字符模板Y.jpg 1KB
6.jpg 882B
字符模板云.jpg 1KB
字符模板A.jpg 1KB
字符模板京.jpg 2KB
字符模板鲁.jpg 1KB
字符模板桂.jpg 2KB
字符模板H.jpg 801B
字符模板6.jpg 1KB
字符模板黑.jpg 2KB
字符模板赣.jpg 2KB
字符模板W.jpg 1KB
车牌.jpg 59KB
下载 (3).jpg 8KB
字符模板S.jpg 2KB
字符模板M.jpg 1KB
u=2152768263,157574884&fm=26&gp=0.jpg 27KB
car_2.jpg 24KB
字符模板0.jpg 1KB
下载 (5).jpg 10KB
字符模板T.jpg 822B
7.jpg 593B
字符模板E.jpg 1KB
chepaishibie.m 8KB
字符模板贵.jpg 2KB
字符模板2.jpg 1KB
共 93 条
- 1
资源评论
- XU美伢2023-07-28使用这个文件,我成功地识别了多个车牌,效果表现中上。
- KerstinTongxi2023-07-28这个文件提供了一个实用的车牌识别工具,解决了我在实际应用中的许多问题。
- 三山卡夫卡2023-07-28这个文件虽然不完美,但它提供了一个有帮助的基于MATLAB的车牌识别工具,为相关研究者提供了一个良好的起点。
- 曹将2023-07-28车牌识别.rar提供了一种简便而准确的方法,解决了我在车牌识别方面的困扰。
- 石悦2023-07-28该文件给出了一个基于MATLAB的车牌识别算法,可以帮助初学者入门并快速实现识别功能。
VacillerTeeter
- 粉丝: 49
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功