下载资源后端资源详情
车牌识别实现车牌定位程序系统实现.zip
大小:71.33KB
价格:50积分
下载量:0
评分:
5.0
上传者:2401_86539719
更新日期:2024-08-30

车牌识别实现车牌定位程序系统实现.zip

资源文件列表(大概)

文件名
大小
车牌识别实现车牌定位程序系统实现/
-
车牌识别实现车牌定位程序系统实现/main.fig
18.29KB
车牌识别实现车牌定位程序系统实现/main.m
8.67KB
车牌识别实现车牌定位程序系统实现/mainfc.p
202B
车牌识别实现车牌定位程序系统实现/川F1A666.jpg
37.1KB
车牌识别实现车牌定位程序系统实现/鄂K9M555.jpg
29.27KB

资源内容介绍

车牌识别实现车牌定位程序系统实现.zip
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 EDITgui_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});endmainfc;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 mainhandles.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 structureguidata(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 structurevarargout{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 endendmini=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 temp<mini mini=temp; a=i; end if temp>maxi maxi=temp; b=i; endend%和最小的点为车牌的左上角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

用户评论 (0)

发表评论

captcha

相关资源

第二阶段:机器学习经典算法-01回归算法-3..线性回归误差原理推导

该视频主要讲述了误差分布和似然函数在机器学习中的应用。视频首先介绍了误差分布的概念,即误差是独立同分布的,并服从高斯分布。接着,视频引入了似然函数的概念,通过最大化似然函数来找到最佳参数,使模型预测结果与真实值最接近。最后,视频强调了数学在机器学习中的重要性,掌握数学基础知识对于机器学习从业者非常重要。线性回归误差的基本概念1.预测值与真实值之间的差异称为误差,是评估模型准确性的关键指标。2.误差的存在是不可避免的,但通过合理的模型设计和调校,可以将其控制在可接受的范围内。02:41误差的独立同分布假设1.误差被假设为独立同分布,意味着每个样本的误差都是独立的,且遵循相同的分布规律。2.独立同分布的假设是基于对样本数据的独立性以及对误差范围的统一认识。07:19线性回归的似然函数1.似然函数用于评估参数θ(西塔)的好坏,目标是最大化似然函数值。2.似然函数的构建基于误差的分布假设,即高斯分布。3.通过最大化似然函数,可以找到使模型预测值与真实值最接近的参数θ。

28.74MB14积分

第二阶段:机器学习经典算法-01回归算法-4.目标函数求解

该视频主要讲述了利用对数自然函数求解最大值的方法。视频开头引入了对数自然函数,将其作为工具来求解最大值。接着,通过化简对数函数的表达式,得到一个累加和的形式,从而更容易地求出最大值。此外,视频还提到了如何利用对数函数将乘法转换为加法,从而更容易地进行计算。视频中还通过比较预测值和真实值之间的差异平方项,得到一个更小的差异值,从而使得求解的结果更加准确。这些方法在数学、统计学、经济学等领域都有广泛的应用。总之,该视频详细讲解了对数自然函数的应用和求解方法,对于想要深入了解最大值求解的观众有很大的帮助。00:27目标函数求解概述1.将累乘转换为累加简化求解过程。2.引入对数自然函数,通过求对数将乘法转换为加法。3.目标函数转换为求对数后的累加和形式。06:14目标函数化简与求解1.通过取对数将累乘转换为累加和。2.将乘法操作转换为加法操作,简化求解过程。3.化简过程中,将常数项和与西塔无关的项移至等式一侧。4.最终目标函数形式为西塔的线性函数,通过求导找到极值点。10:20线性回归模型求解1.线性回归模型中,西塔的求解转换为优化目标函数的问题。2.通过求导和设

27.03MB44积分

第二阶段:机器学习经典算法-01回归算法-5.逻辑回归原理

该视频主要讲述了逻辑回归中的Sigmoid函数。首先介绍了Sigmoid函数是一个S型函数,其输入是任意的实数,输出是0到1之间的值,可以看作是一个概率值。然后提到了在回归问题中,可以通过某种方式得到一个预测值,如果想要将这个预测值转化为分类任务的结果,就可以使用Sigmoid函数。将预测值传入Sigmoid函数后,会得到一个0到1之间的值,这个值可以解释为某个事件发生的概率。此外还强调了Sigmoid函数的取值范围和作用,以及它在神经网络中的应用。逻辑回归原理与Sigmoid函数1.逻辑回归通过Sigmoid函数进行概率转换,实现从连续值到概率的映射。2.Sigmoid函数将任意实数值映射到0到1的区间,可用于将输出转换为概率。3.逻辑回归虽名为回归,但实际上是一种分类算法,适用于二分类问题。04:30逻辑回归的数学表达与推导1.逻辑回归的数学表达式包括Sigmoid函数,用于预测值的计算。2.预测值通过逻辑回归模型的参数(如西塔和x)计算得出,反映属于正类的概率。3.逻辑回归的推导与线性回归相似,涉及求导等数学运算。

13.65MB39积分

第二阶段:机器学习经典算法-01回归算法-6.梯度下降实例

该视频主要讲述了梯度下降算法在机器学习中的应用。首先介绍了如何通过计算损失函数值和偏导数来优化模型参数,然后详细讲解了如何计算目标函数对参数的偏导数以及如何设置合适的学习率。视频强调了学习率的重要性,并介绍了梯度下降算法的迭代求解过程,最后通过具体例子展示了梯度下降算法的应用。该视频对于理解梯度下降算法的基本原理和应用具有一定的帮助,对于初学者来说是一个很好的学习资源。梯度下降实例分析与代码解释1.通过分析PGA数据,使用梯度下降法寻找最佳参数组合以接近y与distance之间的关系。09:44梯度下降法的实现细节1.迭代求解和损失函数的打印、存储及收敛值的控制方法,通过定义收敛值来控制迭代过程。2.梯度下降法的应用,包括计算方法和参数调整过程。10:34梯度下降算法介绍1.梯度下降是一种优化算法,用于找到函数的最小值。2.在梯度下降中,通过计算函数梯度并朝着梯度相反的方向更新参数,以逐步降低函数值。3.梯度下降常用于机器学习和深度学习中,用于优化模型参数。

38.43MB47积分