资源简介

MATLAB运行代码 可实现对四种动物图像的分类识别 提取特征进行分类识别

资源截图

代码片段和文件信息

function tfeat = get_features(colorimg mask)
% 特征提取函数
 hsvimg = rgb2hsv(colorimg);
 h = hsvimg(::1);
 mask1 = mask(:);
 index = mask1>0;
[countsx] = imhist(h(index));                      %绘制直方图
Hue = find(counts == max(counts)); 

% ShapeValue = regionprops(mask ‘majoraxislength‘‘minoraxislength‘);
% Shape = ShapeValue.MajorAxisLength/ShapeValue.MinorAxisLength;
ShapeValue = regionprops(mask ‘eccentricity‘);
Shape = ShapeValue.Eccentricity;
tfeat = [Hue Shape ];
%tfeat = [feat1 feat2 f.Orientation f2.Eccentricity f1.Extent];

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        564  2012-11-29 20:47  the4th\get_features.m

     文件        413  2012-11-29 21:45  the4th\recognition.m

     文件        299  2012-11-30 00:04  the4th\RGB2bw.m

     文件      47751  2016-09-04 15:05  the4th\test1.jpg

     文件      27724  2016-09-04 15:29  the4th\the4th.fig

     文件      12382  2016-09-04 15:29  the4th\the4th.m

     文件      19293  2016-09-04 14:58  the4th\大象.jpg

     文件     217560  2016-09-04 12:23  the4th\狗.jpg

     文件       6430  2016-09-04 12:15  the4th\猫.jpg

     文件      43544  2016-09-04 15:00  the4th\马.jpg

     目录          0  2017-02-11 17:37  the4th

----------- ---------  ---------- -----  ----

               375960                    11


评论

共有 条评论