资源简介
基于聚类的路标检测(K-means)(MATLAB)(RGB)通过采用RGB的颜色特征空间,如果和YUV结合使用,识别效果更佳。

代码片段和文件信息
function varargout = K_means(varargin)
% K_MEANS M-file for K_means.fig
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name‘ mfilename ...
‘gui_Singleton‘ gui_Singleton ...
‘gui_OpeningFcn‘ @K_means_OpeningFcn ...
‘gui_OutputFcn‘ @K_means_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 K_means is made visible.
function K_means_OpeningFcn(hobject eventdata handles varargin)
handles.output = hobject;
guidata(hobject handles);
% --- Outputs from this function are returned to the command line.
function varargout = K_means_OutputFcn(hobject eventdata handles)
varargout{1} = handles.output;
% --- Executes on button press in Pushbutton_Imread.
function Pushbutton_Imread_Callback(hobject eventdata handles)
global Fig;
global Length;
global Width;
global Dim;
global Num;
global PopUp;
global xPos;
global yPos;
global R;
global G;
global B;
global R_GB;
global angle_x;
angle_x=0;
clc;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% : Initilize var
Length=0;
Width=0;
Num=0;
PopUp=0;
xPos=0;
yPos=0;
Fig=0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%显示图像和尺寸
[filenamepathname]=uigetfile({‘*.jpg‘:‘*.bmp‘:‘*.gif‘}‘选择图片‘);
str=[pathname filename];
Fig=imread(str);
[LengthWidthDim]=size(Fig);
str1=num2str(Length);
str2=‘*‘;
str3=num2str(Width);
str=strcat(str3str2str1);
set(handles.Edit_Imread‘string‘str);
axes(handles.Axes_ResultPho);
hold off
Fig_white=Fig;
Fig_white=255*ones(LengthWidthDim);
imshow(Fig_white);
axes(handles.Axes_InitPho);
hold off;
h=imshow(Fig);
set(handles.Axes_InitPho‘visible‘‘on‘);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%读取样本点数量
Str=get(handles.edit_Num‘string‘);
Num=str2num(Str);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%读取产生样本点
Fig=double(Fig);
Val=get(handles.pop_example‘Value‘);
Str=get(handles.pop_example‘String‘);
switch Str{Val}
case ‘Rand‘
PopUp=1;
for i=1:Num
xPos(i)=floor(rand*Length)+1;
yPos(i)=floor(rand*Width)+1;
R(i)=Fig(xPos(i)yPos(i)1);
G(i)=Fig(xPos(i)yPos(i)2);
B(i)=Fig(xPos(i)yPos(i)3);
R_GB(i)=R(i)/(G(i)+B(i));
% GB_R(i)=(G(i)+B(i))/R(i);
end
case ‘Rules‘
PopUp=2;
temp=round(sqrt((Num*Length)/Width));
if temp % temp=temp+1;
temp=temp;
end
LenNum=temp;
WidNum=round(temp*Width/Length);
if LenNum*WidNum WidNum=WidNum+1;
end
deta_Len=floo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-05-18 18:08 2\
文件 64512 2015-05-17 23:55 2\Kmeans.vsd
文件 22006 2010-05-11 18:23 2\K_means.fig
文件 11241 2010-05-12 19:03 2\K_means.m
文件 233120 1998-04-12 16:09 2\S3a.bmp
文件 18355 2010-04-25 19:28 2\图片1.jpg
文件 47104 2010-05-13 19:24 2\模式识别homework2.ppt
文件 140902 2010-04-21 19:59 2\照片 064.jpg
文件 188309 2010-04-21 20:03 2\照片 085.jpg
文件 131347 2010-04-21 20:03 2\照片 088.jpg
相关资源
- 基于颜色的聚类分割matlab
- matlab模式识别工具箱PRTOOLS及使用说明
- 用身高和/或体重数据进行性别分类的
- 模式识别与智能计算-Matlab技术实现(
- 模式识别与智能计算matlab实现 安装
- 西交大模式识别编程大作业报告+MAT
- K均值聚类算法,图像处理,GUI,mat
- 车牌识别_matlab_模式识别(MATLAB代码,
- 模式识别课程作业 基于svm的人脸识别
- 图形模式识别 matlab 圆 正方形
- 谱聚类算法对数据点进行分类
- 《模式识别与智能计算》MATLAB技术实
- matlab利用不变矩提取图片的形状特征
- 近邻传播聚类算法及matlab API
- 模式识别4个实验(matlab)
- 模式识别课程作业 matlab与libsvm环境
- 蚁群聚类算法
- 四种聚类算法源代码及
- 车牌识别Matlab代码
- 基于matlab的车牌识别内含matlab代码以
- BSAS顺序聚类算法matlab实现代码注释很
- 指纹识别数字图像处理+模式识别+机器
- k均值聚类算法的原理与matlab实现
- 路标识别与提取采用聚类方法C-means
- FAST角点检测算法MATLAB程序
- 基于PCA和SVM的人脸识别 matlab程序
- 模式识别与智能计算-Matlab技术实现
- 《模式识别与智能计算:MATLAB技术实
- 稀疏非负矩阵分解及模式识别
- 虹膜识别 matlab算法
评论
共有 条评论