【限速标志识别】基于matlab GUI形态学限速标志识别【含Matlab源码 1142期】 | 您所在的位置:网站首页 › 高速限速标志牌图片及注解视频 › 【限速标志识别】基于matlab GUI形态学限速标志识别【含Matlab源码 1142期】 |
✅博主简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,Matlab项目合作可私信。 🍎个人主页:海神之光 🏆代码获取方式: 海神之光Matlab王者学习之路—代码获取方式 ⛳️座右铭:行百里者,半于九十。 更多Matlab仿真内容点击👇 Matlab图像处理(进阶版) 路径规划(Matlab) 神经网络预测与分类(Matlab) 优化求解(Matlab) 语音处理(Matlab) 信号处理(Matlab) 车间调度(Matlab) ⛄一、SVM路标检测识别简介1 路标识别 完整的路标识别系统包括:图像的获取与预处理,图像分割(路标定位),特征提取,模式分类(路标识别)等部分。其中模式分类是系统的关键技术。较常用的模式分类方法是神经网络分类器。神经网络是目前应用最广也是最成功的学习算法之一,具有较强的容错行和自适应学习能力。然而神经网络采用的经验风险最小化准则(empirical risk minimization, ERM),虽然可使训练误差最小化,但并不能最小化学习过程的泛化误差。实际应用中神经网络常出现的问题:1) 更易出现局部最小值;2) 其输出的假设规模经常可能大到不切实际;3) 如果训练样本的数目有限,过大的假设函数类将导致过拟合;4) 常受到大量参数的控制,参数的选择往往是通过启发式的参数调节过程。 2 支持向量机 2.1 两类模式问题 SVM基于SRM准则构造最优超平面,使每类数据之间间隔最大,同时保持分类误差尽可能小。Cover定理指出:一个复杂的模式识别分类问题,在高维空间比低维空间更容易线性可分。实际上SVM实现了这样的思想:通过某种非线性映射(可以是未知的)将样本特征向量x映射到一个高维特征空间,然后在这个空间中构造最优分类超平面。 对简单的两模式分类,SVM算法可归结为: 通过非线性变换φ:x→φ (x) ,将模式数据映射到高维特征空间,构造分类超平面,表示为决策面: 在one-against-all方法中,一个k类问题被分解为k个 (子) 两类问题。第i个两类问题训练集包含原训练集中的所有样本,来自第i类样本的类标被重新定义为+1,其余样本的类标被重新定义为-1 one-against-one方法将一个k类问题分解为k (k-1) /2个 (子) 两类问题。每个两类问题的训练集由原训练集中的2个类别的样本组成,其中一个类别的样本的类标被重新定义为+1,另一个类别的样本的类标被重新定义为-1 有向无环图支持向量机(Directed Acyclic Graph Support Vector Machines, DAGSVM)将所有的两类支持向量机组合为一个二叉有向无环图。对于一个k类问题,这种方法将产生一个包含k个叶结点和k (k-1) /2个中间结点的三角形,叶结点对应着样本类别,中间结点对应着所有的两类分类器。 3 基于SVM的路标识别系统 3.1 图标提取 系统从移动机器人的图像采集卡获取路标彩色图像后,首先对源图像进行基于RGB空间模型的路标颜色初次分割,如图2 (b) 。针对光照的影响,考虑到分割的精度和灵敏度,经大量图像进行统计,确定相符的分割改进模型为: 红色路标的分割模型![]() ![]() ![]() 最后,将提取到的特征样本送入SVM分类器,进行路标样本的训练和识别。 ⛄二、部分源代码function varargout = Mat5_2(varargin) % MAT5_2 MATLAB code for Mat5_2.fig % MAT5_2, by itself, creates a new MAT5_2 or raises the existing % singleton*. % % H = MAT5_2 returns the handle to a new MAT5_2 or the handle to % the existing singleton*. % % MAT5_2(‘CALLBACK’,hObject,eventData,handles,…) calls the local % function named CALLBACK in MAT5_2.M with the given input arguments. % % MAT5_2(‘Property’,‘Value’,…) creates a new MAT5_2 or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before Mat5_2_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to Mat5_2_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 Mat5_2 % Last Modified by GUIDE v2.5 21-Jul-2021 15:09:04 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct(‘gui_Name’, mfilename, … ‘gui_Singleton’, gui_Singleton, … ‘gui_OpeningFcn’, @Mat5_2_OpeningFcn, … ‘gui_OutputFcn’, @Mat5_2_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 Mat5_2 is made visible. function Mat5_2_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 Mat5_2 (see VARARGIN) % Choose default command line output for Mat5_2 handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes Mat5_2 wait for user response (see UIRESUME) % uiwait(handles.figure1); % — Outputs from this function are returned to the command line. function varargout = Mat5_2_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 Image [filename,pathname]=uigetfile({‘.jpg’;'.bmp’;‘.gif’},‘选择图片’); str=[pathname filename]; Image1 = imread(str); Image=Image1; axes(handles.axes1); imshow(Image1); 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 function BW = imbinarize(I,varargin) %#codegen %imbinarize Binarize image by thresholding. % Copyright 2015-2018 The MathWorks, Inc. % Syntax % ------ % % BW = imbinarize(I) % BW = imbinarize(I,method) % BW = imbinarize(I,‘adaptive’,Param,Value,…) % BW = imbinarize(I,t) % % Input Specs % ----------- % % I: % real % non-sparse % 2d % uint8, uint16, uint32, int8, int16, int32, single or double % % method: % string with value: ‘global’ or ‘adaptive’ % default: ‘global’ % % Sensitivity: % numeric % real % non-sparse % scalar % non-negative % |
CopyRight 2018-2019 实验室设备网 版权所有 |