首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

基于MATLAB的车牌识别实现车牌定位系统【含界面GUI】.zip

移动开发 71.51KB 11 需要积分: 1
立即下载

资源介绍:

matlab图像处理
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 % 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 mainfc; 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; clc; warning off all; axes(handles.axes1); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes2); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes3); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes4); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes5); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes6); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes7); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes8); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); handles.Img=[]; % 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; function edit1_Callback(hObject, eventdata, handles) % hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit1 as text % str2double(get(hObject,'String')) returns contents of edit1 as a double % --- Executes during object creation, after setting all properties. function edit1_CreateFcn(hObject, eventdata, handles) % hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit 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) % 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) axes(handles.axes1); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes2); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes3); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes4); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes5); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes6); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes7); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes8); cla reset; box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); [filename, pathname] = uigetfile({'*.jpg;*.tif;*.png;*.gif', 'All Image Files';... '*.*', '所有文件' }, '选择图像文件', fullfile(pwd, 'images/川F1A666.jpg')); if filename == 0 return; end % 文件名 file = fullfile(pathname, filename); % 图像矩阵 Img = imread(file); %激活第一个轴对象 axes(handles.axes1); imshow(Img, []); %激活第二个轴对象 axes(handles.axes2); imshow(Img, []); %保存为全局变量 handles.Img = Img; guidata(hObject, handles); % --- 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) Img=handles.Img; %对图像I进行灰度处理 I_gray=rgb2gray(Img); axes(handles.axes3); imshow(I_gray); title('灰度图像'); %利用Sobel算子进行边缘检测 I_edge=edge(I_gray,'sobel'); axes(handles.axes4); imshow(I_edge) title('边缘检测后图像'); se=[1;1;1]; %对边缘图像进行腐蚀 I_erode=imerode(I_edge,se); axes(handles.axes5); imshow(I_erode); title('腐蚀后边缘图像'); se=strel('rectangle',[25,25]); %填充图像 I_close=imclose(I_erode,se); axes(handles.axes6); imshow(I_close) title('填充后图像'); %去除聚团灰度值小于1500的部分 I_final=bwareaopen(I_close,1500); axes(handles.axes7); 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; %寻找所有白点中,x坐标与y坐标的和最大,最小的两个点的位置 for i=1:size(location_of_1,1) temp=location_of_1(i,1)+location_of_1(i,2); if tempmaxi maxi=temp; b=i; end end %和最小的点为车牌的左上角 first_point=location_of_1(a,:); %和最大的点为车牌的右下角 last_point=location_of_1(b,:); %坐标值修正 x1=first_point(1)+10; x2=last_point(1)-4; y1=first_point(2)+10; y2=last_point(2)-4; I_plate=Img(x1:x2,y1:y2); g_max=double(max(max(I_plate))); g_min=double(min(min(I_plate))); % T为二值化的阈值 T=round(g_max-(g_max-g_min)/3); I_plate =im2bw (I_plate,T/256); I_plate=bwareaopen(I_plate,20); I_plate(: ,y2)=0; axes(handles.axes8); I_plate=bwareaopen(I_plate,100); %画出最终车牌 imshow(I_plate) title('车牌提取') % --- 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) close(handles.figure1) function edit2_Callback(hObject, eventda

资源文件列表:

基于MATLAB的车牌识别实现车牌定位系统【含界面GUI】.zip 大约有6个文件
  1. 基于MATLAB的车牌识别实现车牌定位系统【含界面GUI】/main.fig 18.29KB
  2. 基于MATLAB的车牌识别实现车牌定位系统【含界面GUI】/main.m 8.67KB
  3. 基于MATLAB的车牌识别实现车牌定位系统【含界面GUI】/mainfc.p 202B
  4. 基于MATLAB的车牌识别实现车牌定位系统【含界面GUI】/川F1A666.jpg 37.1KB
  5. 基于MATLAB的车牌识别实现车牌定位系统【含界面GUI】/鄂K9M555.jpg 29.27KB
  6. 基于MATLAB的车牌识别实现车牌定位系统【含界面GUI】/
0评论
提交 加载更多评论
其他资源 541892063156416贪吃蛇大作战.zip
541892063156416贪吃蛇大作战.zip
VSCode+Qt+MSVC配置
VSCode功能强大,使用也很舒服,但总是遇到各种坑;我在配置VSCode+Qt+MSVC时,网上也找了一堆资料,总是零零散散,好在配置成功了,希望大家以后少走弯路。 环境为win10 x64,vscode配置qt+msvc,调试器为CDB。
SAP GUI 800版本SAPscript Legacy Text Editor控件
ABAP SMARTFORMS在创建文本的时候,报错CSapEditorCtrl::GetObject: Object XX does not exist
2652500826HC-12资料包.zip
2652500826HC-12资料包.zip
KEIL5-51单片机
KEIL5-51单片机
KEIL5-51单片机 KEIL5-51单片机 KEIL5-51单片机
NodeJS旅游景点分享网站[编号:CS_03796](1).zip
NodeJS旅游景点分享网站[编号:CS_03796](1).zip
国科大-2024数据挖掘课程-试题回忆-刘莹老师
好课,好老师,从头认真听到尾的一门,也超级适合跨专业的同学! 包含2024试题回忆,2024课件提纲,以及学长学姐传下来的题。
国科大-2024数据挖掘课程-试题回忆-刘莹老师
只需要更改路径就可以使用的yolov11官方模型
只需要更改路径就可以使用的yolov11官方模型
只需要更改路径就可以使用的yolov11官方模型 只需要更改路径就可以使用的yolov11官方模型 只需要更改路径就可以使用的yolov11官方模型