一、简介
摘 要:为改进车牌识别的精确度,在 MATLAB 平台下通过 GUI 图形用户界面,调用相应算子与算法对图像进行调整与优化。通过对图像进行粗定位、灰度化、倾斜矫正、二值化处理等对车牌图像进行预处理,并利用阈值分割、形态学处理等方法进行车牌定位。对多种算法进行比较,选择适当的图像处理方法,结合投影函数分割图像,以及图像矩归一化法实现字符归一化、语音播报车牌识别结果等功能,共同组成车牌识别系统。测试结果表明,该系统对车牌识别的精确度由 95% 提高到 96.5%,识别性能较好。
0 引言 随着科技的发展与信息时代的到来,数字图像处理技术已走进人们的日常生活。数字图像处理是指将图像信号转换成数字信号并采用计算机等硬件设备进行处理的过程[1-2],其涉及的内容主要包括图像二值化与灰度化、图像变换与形态学处理等,同时车牌识别技术作为该领域的重要应用方向之一,选择合适的软件进行图像识别与处理是必不可少的。MATLAB 作为一款强大的数学软件,同时也是国际控制界公认的标准计算软件[3-4],由于其不需要定义数组维数,而且有矩阵对应的库函数,所以在图像处理领域相对其它高级语言更加简便,且效率较高。图像处理算法通常是依靠矩阵运算实现的,因此可选择 MATLAB作为图像处理工具。很多学者对此进行了研究,但相关成果仍具有一定局限性。如文献[5]只是针对车牌字符识别进行简单的图像处理实验;文献[6]对车牌图像进行字符 识别,但效果不佳。基于文献[7]研究,本文采用基于 GUI的图形操作系统,采用层层推进的方式对车牌图像进行识别与处理。同时受到文献[8]的启发,本文运用语音播报的方式对结果进行输出,并对车牌进行精确定位。
1 车牌识别系统设计 系统首先通过图片选择功能选定一幅要处理的图片,然后进行图像识别,最后对识别的车牌进行语音播报,相应流程如图 1 所示。
针对识别模块,图像识别处理流程又大致分为对图像进行粗定位、图像灰度化、倾斜矫正处理、二值化处理、形态学处理等,最后得到精准定位的图像。具体流程如图 2所示。
本系统采用 GUI 图形处理系统处理车辆图片,从中提取车牌号码,系统可显示运行时间,且界面简洁、操作简便。系统主界面如图 3 所示。 











function shengyin=fasheng(jieguoyuyin)
sound(audioread(‘结果语音 .wav’),46000);
pause(2);
3 结语 本文采用 GUI 图形处理系统进行车牌识别,并通过语音播报读出结果,可令使用者更方便地使用。测试结果表明,系统对车牌识别的精确度可由 95% 提高到 96.5%。由于字符笔划包含丰富的角点信息,后期还可采用角点字符检测方法提取出图像中的字符信息,并尝试使用神经网络算法,以期提高识别精确度至 97% 以上。
4 参考文献: [1] XU L M,LIU H J. Overview of digital image processing technology[J]. Software Guide,2016,15(3):181-182. 徐黎明,刘航江. 数字图像处理技术研究综述[J]. 软件导刊,2016, 15(3):181-182. [2] SUDHAGAR S,SAKTHIVEL M,DANIEL S A A. Application of im⁃ 孙 淳:基于 GUI图形处理系统的车牌识别 · 213 · 软 件 导 刊 2021 年 age processing to radiographic image for quantitative assessment of friction stir welding quality of aluminium 2024 alloy[J]. Measure⁃ ment,2020,152:107294. [3] ZHANG G C,WAN S P,HE J R. Digital image processing technology and application in MATLAB[J]. Software,2019,40(11):139-142. 张广才,万守鹏,何继荣. 数字图像处理技术与MATLAB应用[J]. 软件,2019,40(11):139-142. [4] CHEN F,GUAN L H. Application of modular teaching model in mat⁃ lab software course[J]. Journal of Changchun University,2019,29 (10):111-115. 陈锋,关丽红. 模块化教学模式在Matlab软件课程中的应用[J]. 长 春大学学报,2019,29(10):111-115. [5] ZHANG Y. The design and implementation of license plate image rec⁃ ognition based on MATLAB[J]. Information,2019(11):79-81. 张一. 基于MATLAB车牌图像识别的设计与实现[J]. 信息通信, 2019(11):79-81. [6] ZHANG P,LU S Q,XU H F. Research on license plate location tech⁃ nology based on MATLAB[J]. Science,2019(32):38-39. 张萍,陆淑勤,徐海峰. 基于MATLAB的车牌定位技术研究[J]. 科 技视界,2019(32):38-39. [7] SONG H,PEIYUE L. A MATLAB based graphical user interface (GUI)for quickly producing widely used hydrogeochemical diagrams [J]. Geochemistry,2019,80(4):125550. [8] LI Y,LUO Z B. Design of a smart logistics vehicle control system[J]. Journal of Jilin Teachers Institute of Engineering and Technology, 2019,35(12):107-109. 李昱,罗忠宝. 智能物流车控制系统设计[J]. 吉林工程技术师范学 院学报,2019,35(12):107-109. [9] JOSÉ M P,ERNESTO M,GERMÁN O,et al. Freezing front velocity estimation using image processing techniques[J]. Measurement,2020, 151:107085. [10] A F L. Reserch on color image grayscale based on normalized prod⁃ uct correlation matching[D]. Lanzhou:Lanzhou University,2018. 马方龙. 基于归一化积相关匹配的彩色图像灰度化研究[D]. 兰 州:兰州大学,2018. [11] HONGMEI Z,ZHIGAO Z,ZHILI P. Application and implementation of image point operation in gray scale transformation[C]. Proceed⁃ ings of the 2015 International Conference on Electronic Science and Automation Control,2015:281-284. [12] GUO L. Research on color image grayscale algorithm based on RGB color space[D]. Xi’an:Shaanxi Normal University,2017. 郭丽. 基于RGB颜色空间的彩色图像灰度化算法研究[D]. 西安: 陕西师范大学,2017. [13] PANDEY A,PATI U C. Image mosaicing:a deeper insight[J]. Im⁃ age and Vision Computing,2019,89:236-257. [14] XIAO H,LIN L,RONG L,et al. Binarization of degraded document images with global-local U-Nets[J]. Optik,2020,203:164025. [15] QIAN Y. MATLAB-based Image morphological processing technolo⁃ gy and application[J]. Journal of Neijiang Normal University,2019, 34(10):51-55. 钱月. 基于MATLAB的图像形态学处理技术与应用[J]. 内江师范 学院学报,2019,34(10):51-55. [16] ZHANG F G,LI K,DI S K,et al. Application of MATLAB in digital image processing[J]. Computer Technology and Development,2019, 29(11):216-220. 张飞鸽,李凯,翟少康,等. MATLAB在数字图像处理中的应用 [J]. 计算机技术与发展,2019,29(11):216-220. [17] GE Y,ZHAO R,GAO Z J. Research of image inpainting methods based on total variation model and dilation[J]. Information Technolo⁃ gy and Network Security,2014,33(18):39-41,44. 葛艳,赵瑞,高占江. 基于TV模型和膨胀的图像修复方法研究[J]. 微型机与应用,2014,33(18):39-41,44. [18] ZHENGMENG J,YIMENG W,LIHUA M,et al. A Retinex-based to⁃ tal variation approach for image segmentation and bias correction[J]. Applied Mathematical Modelling,2020,79:52-67. [19] WANG Q P,ZHANG Z X,ZHU X F. Comprehensive summary of Im⁃ age segmentation[J]. Information Recording Materials,2019,20(7): 12-14. 王秋萍,张志祥,朱旭芳. 图像分割方法综述[J]. 信息记录材料, 2019,20(7):12-14. [20] MIU X X,SHEN X Q,DONG M Y,et al. Design of license plate rec⁃ ognition system based on MATLAB[J]. Technology Vision,2019 (32):19-20. 缪鑫芯,沈雪琴,董梦影,等. 基于MATLAB的车牌识别系统设计 [J]. 科技视界,2019(32):19-20.
二、源代码
function varargout = Main(varargin)
% MAIN MATLAB code for Main.fig
% MAIN, by itself, creates a new MAIN or raises the existing
% singleton*.
%
% H = MAIN returns the handle to a new MAIN or the handle to
% the existing singleton*.
%
% MAIN('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MAIN.M with the given input arguments.
%
% MAIN('Property','Value',...) creates a new MAIN or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Main_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Main_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 Main
% Last Modified by GUIDE v2.5 12-May-2009 23:58:18
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Main_OpeningFcn, ...
'gui_OutputFcn', @Main_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 Main is made visible.
function Main_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 Main (see VARARGIN)
% Choose default command line output for Main
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Main wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Main_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 selection change in listbox1.
function listbox1_Callback(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns listbox1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from listbox1
% --- Executes during object creation, after setting all properties.
function listbox1_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in listbox2.
function listbox2_Callback(hObject, eventdata, handles)
% hObject handle to listbox2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns listbox2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from listbox2
% --- Executes during object creation, after setting all properties.
function listbox2_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
%----------------------入停车场-----------------------------
[filename,filepath]=uigetfile('.jpg','采集入库车牌');% 直接自动读入%
file=strcat(filepath,filename); %strcat函数:连接字符串;把filepath的字符串与filename的连接,即路径/文件名
I=imread(file);
axes(handles.axes1)
imshow(I)
title('原图')
I1=rgb2gray(I);
I2=edge(I1,'roberts',0.15,'both');
se=[1;1;1];
I3=imerode(I2,se);
se=strel('rectangle',[25,25]);
I4=imclose(I3,se);
I5=bwareaopen(I4,2000);
[y,x,z]=size(I5);
myI=double(I5);
tic
white_y=zeros(y,1);
for i=1:y
for j=1:x
if(myI(i,j,1)==1)
white_y(i,1)= white_y(i,1)+1;
end
end
end
[temp MaxY]=max(white_y);
PY1=MaxY;
while ((white_y(PY1,1)>=5)&&(PY1>1))
PY1=PY1-1;
end
PY2=MaxY;
while ((white_y(PY2,1)>=5)&&(PY2<y))
PY2=PY2+1;
end
IY=I(PY1:PY2,:,:);
white_x=zeros(1,x);
for j=1:x
for i=PY1:PY2
if(myI(i,j,1)==1)
white_x(1,j)= white_x(1,j)+1;
end
end
end
PX1=1;
while ((white_x(1,PX1)<3)&&(PX1<x))
PX1=PX1+1;
end
PX2=x;
while ((white_x(1,PX2)<3)&&(PX2>PX1))
PX2=PX2-1;
end
PX1=PX1-2;
PX2=PX2+3;
dw=I(PY1:PY2-8,PX1:PX2,:);
axes(handles.axes2)
imshow(dw)
title('车牌定位')
t=toc; %识别时间
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)/3); % T 为二值化的阈值
[m,n]=size(b);
d=(double(b)>=T); % d:二值图像
% 滤波
h=fspecial('average',3);
d=im2bw(round(filter2(h,d)));
axes(handles.axes3)
imshow(d)
title('车牌区域二值化')
三、运行结果
四、备注
版本:2014a
今天的文章【车牌识别】基于matlab GUI停车计费系统【含Matlab源码 735期】分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/20133.html