其实学数字图像处理,关键的不是源代码(和一般编程还是有区别的,这个是经验之谈,其实一般博导未必会编程,但是你和他说说你的方法,他一般都能切中要害),而是你能理解基于概念及适用场所。

基于颜色、纹理、形状都属于低层特征,这些你理解就够了,关键是对你的课题适合哪种方法来映射到高层语义上面,例如:识别物体轮廓,那可能形状就比较适合等。

我之所以写上面那段话,主要是我感觉你索取代码也不说明具体要求,也就是方向不明确。

如今颜色特征提取算法有很多,诸如颜色直方图、颜色矩、颜色集、颜色聚合向量、颜色相关图等,既然你没说,我就给个IEEE CSVT 2001的一篇关于颜色直方图法的论文(源码版权归作者所有):

function colorhist = colorhist(rgb)

% CBIR_colorhist() --- color histogram calculation

% input: MxNx3 image data, in RGB

% output: 1x256 colorhistogram == (HxSxV = 16x4x4)

% as the MPEG-7 generic color histogram descriptor

% [Ref] Manjunath, B。

S。; Ohm, J。-R。; Vasudevan, V。V。; Yamada, A。, "Color and texture descriptors"

% IEEE Trans。 CSVT, Volume: 11 Issue: 6 , Page(s): 703 -715, June 2001 (section III。

B)

% check input

if size(rgb,3)~=3

error('3 components is needed for histogram');

end

% globals

H_BITS = 4; S_BITS = 2; V_BITS = 2;

%rgb2hsv可用rgb2hsi代替,见你以前的提问。

hsv = uint8(255*rgb2hsv(rgb));

imgsize = size(hsv);

% get rid of irrelevant boundaries

i0=round(0。

05*imgsize(1)); i1=round(0。95*imgsize(1));

j0=round(0。05*imgsize(2)); j1=round(0。95*imgsize(2));

hsv = hsv(i0:i1, j0:j1, :);

% histogram

for i = 1 : 2^H_BITS

for j = 1 : 2^S_BITS

for k = 1 : 2^V_BITS

colorhist(i,j,k) = sum(sum( 。

。。

bitshift(hsv(:,:,1),-(8-H_BITS))==i-1 &。。。

bitshift(hsv(:,:,2),-(8-S_BITS))==j-1 &。。。

bitshift(hsv(:,:,3),-(8-V_BITS))==k-1 ));

end

end

end

colorhist = reshape(colorhist, 1, 2^(H_BITS S_BITS V_BITS));

% normalize

colorhist = colorhist/sum(colorhist);

%基于纹理特征提取灰度共生矩阵用于纹理判断

% Calculates cooccurrence matrix

% for a given direction and distance

%

% out = cooccurrence (input, dir, dist, symmetric);

%

% INPUT:

% input: input matrix of any size

%

% dir: direction of evaluation

% "dir" value Angle

% 0 0

% 1 -45

% 2 -90

% 3 -135

% 4 -180

% 5 135

% 6 90

% 7 45

%

% dist: distance between pixels

%

% symmetric: 1 for symmetric version

% 0 for non-symmetric version

%

% eg: out = cooccurrence (input, 0, 1, 1);

% Author: Baran Aydogan (15。

07。2006)

% RGI, Tampere University of Technology

% baran。aydogan@tut。

fi

function out = cooccurrence (input, dir, dist, symmetric);

input = round(input);

[r c] = size(input);

min_intensity = min(min(input));

max_intensity = max(max(input));

out = zeros(max_intensity-min_intensity 1);

if (dir == 0)

dir_x = 0; dir_y = 1;

end

if (dir == 1)

dir_x = 1; dir_y = 1;

end

if (dir == 2)

dir_x = 1; dir_y = 0;

end

if (dir == 3)

dir_x = 1; dir_y = -1;

end

if (dir == 4)

dir_x = 0; dir_y = -1;

end

if (dir == 5)

dir_x = -1; dir_y = -1;

end

if (dir == 6)

dir_x = -1; dir_y = 0;

end

if (dir == 7)

dir_x = -1; dir_y = 1;

end

dir_x = dir_x*dist;

dir_y = dir_y*dist;

out_ind_x = 0;

out_ind_y = 0;

for intensity1 = min_intensity:max_intensity

out_ind_x = out_ind_x 1;

out_ind_y = 0;

[ind_x1 ind_y1] = find (input == intensity1);

ind_x1 = ind_x1 dir_x;

ind_y1 = ind_y1 dir_y;

for intensity2 = min_intensity:max_intensity

out_ind_y = out_ind_y 1;

[ind_x2 ind_y2] = find (input == intensity2);

count = 0;

for i = 1:size(ind_x1,1)

for j = 1:size(ind_x2,1)

if ( (ind_x1(i) == ind_x2(j)) && (ind_y1(i) == ind_y2(j)) )

count = count 1;

end

end

end

out(out_ind_x, out_ind_y) = count;

end

end

if (symmetric)

if (dir > 4)

dir = dir 4;

else

dir = mod(dir,4);

end

out = out cooccurrence (input, dir, dist, 0);

end。

全部

颜色矩特征提取matlab,求matlab彩色图片的颜色特征提取算法的代码,和纹理特征提取的? 爱问知识人...相关推荐

  1. matlab画三维实心圆柱体,怎样用matlab画水平实心圆柱体,已知圆柱体的半径和高度(悬? 爱问知识人...

    clear all r=1;%圆柱半径 n=100;%设置多少个边逼近圆 h=5;%圆柱高 [x,y,z]=cylinder(r,n);%生成标准的100个面的圆柱数据,半径为r,高为1,底面圆心0, ...

  2. 关于c语言程序的重点问题,c语言程序设计题跪求高人的复杂版~慢步不要紧主要是要对~题目:作? 爱问知识人...

    呵呵,就完了,晚上就给你答案哈,你多等等~~~ 恩,完工了,你看看吧: //注:本程序因涉及到引用即"&",所以得保存为.cpp的后缀名再用c 编译器进行编译 #inclu ...

  3. 特征提取算法(1)——纹理特征提取算法LBP

    模式识别中进行匹配识别或者分类器分类识别时,判断的依据就是图像特征.用提取的特征表示整幅图像内容,根据特征匹配或者分类图像目标. 常见的特征提取算法主要分为以下3类: 基于颜色特征:如颜色直方图.颜色 ...

  4. 利用matlab对彩色图片进行颜色变换

    最近,遇到了一个问题,我师兄的深度学习代码成功的将荞麦种子分为了三类.将左图转换为了右图,将图中的黑色,灰色,白色而且形状不一的荞麦种子分为了3类. 我要做的就是,分别将右边图中红色的部分.黄色的部分 ...

  5. matlab n阶方阵,用matlab编程设A=(aij)n*n为n阶方阵,求a从1到n? 爱问知识人

    一. matlab里和随机数有关的函数: (1) rand:产生均值为0.5.幅度在0~1之间的伪随机数 (2) randn:产生均值为0.方差为1的高斯白噪声 (3) randperm(n):产生1 ...

  6. matlab求心率变异性的程序,心率变异性及其相关算法实现_.ppt

    心率变异性及其相关算法实现_ 附加功能参考文献 附加功能 该算法除了可以计算心率变异性之外,还有以下2种附加功能: 对心率的正常与否进行判断,输出有心率正常.心动过速.心动过缓3种情况: 对心脏的早搏 ...

  7. burg算法matlab求功率谱,基于AR模型的Burg算法功率谱估计.doc

    基于AR模型的Burg算法功率谱估计 三种功率谱估计方法性能研究 1.前言: 我们已经知道一个随机信号本身的傅里叶变换并不存在,因此无法像确定性信号一样用数字表达式来精确表达它,而只能用各种统计平均量 ...

  8. 如何锁定MATLAB 图片大小,哪位亲知道怎么把图片做成固定大小啊比如200*230什么的这种? 爱问知识人...

    2018-03-30 12:43:15 打开要做的照片 点裁切工具 设定宽度和高度 1寸2.5X3.5 2寸3.5X4.8 分辨率都用254就可以了 接下鼠标拉一下裁切工具 会出现选区阴影影响到照片人 ...

  9. matlab 旅行商遗传算法,急求蚁群混合遗传算法在matlab上的实现以解决TSP旅行商的问? 爱问知识人...

    建立m文件 function [R_best,L_best,L_ave,Shortest_Route,Shortest_Length]=ACATSP(C,NC_max,m,Alpha,Beta,Rho ...

最新文章

  1. FPGA基础知识极简教程(9)七段数码管显示的Verilog简单设计
  2. vs mysql搭建_VS+mysql+EF搭建
  3. 实战SSM_O2O商铺_37【商品】商品列表之View层的实现
  4. 使用web3.js进行开发
  5. erlang精要(4)-列表及运算
  6. FPGrowth算法总结复习
  7. 0010服务器无对应信息,服务器版本对应的内存
  8. 95-190-741-源码-WindowFunction-窗口流简介
  9. easyui关闭dialog后刷新父页面_两种方法WordPress批量打开、关闭文章评论功能
  10. vue中dom元素和组件的获取
  11. java中十进制转二进制转换函数
  12. Shell:while语句、for语句、if语句
  13. 使用data attributes
  14. WPF中自定义的DataTemplate中的控件,在Window_Loaded事件中加载机制初探
  15. [转]paint,update和repaint三种awt方法
  16. 无法打开包括文件math.h
  17. 美国密歇根州立大学计算机专业,密歇根州立大学计算机科学与工程系
  18. office之转置EXCEL表格
  19. 注册gmail邮箱手机号无法验证
  20. 计算时间差 html,计算时间差的公式

热门文章

  1. 敏而好学,不耻下问。
  2. Pandas中Series和DataFrame的索引
  3. BZOJ 2738: 矩阵乘法 [整体二分]
  4. 《5》CentOS7.0+OpenStack+kvm云平台部署—配置Horizon
  5. 【原创】Js:日期处理(日期格式必须【yyyy-mm-dd】才能转成long的毫秒!其他的不是【年-月-日】的格式,结果会是【NaN】)...
  6. ubuntu 下 github 使用方法 以及异常修改
  7. 瑞芯微RK2918、全志A10和AML8726-M3方案ICS系统运行效果对比
  8. C#操作存储过程,输入参数,返回结果
  9. PaddleOCR文字识别使用
  10. python接口自动化登录_python 接口自动化--登录