全部版块 我的主页
论坛 计量经济学与统计论坛 五区 数据交流中心
2017 1
2019-02-26
计算模糊测度,求choquet积分的matlab程序
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2019-2-26 16:41:32
f就是你导入的rgb图片。
首先按照上面的代码建立一个.m文件,将文件存盘,命名为 colorgrad.m

然后在matlab命令窗口输入如下命令:
>>f=imread('test.jpg') %这里的test.jpg是图片文件名
>> [VG,A,PPT]=colorgrad(f,0)
>>figure; imshow(PPT);

function [VG,A,PPG]=colorgrad(f,T)
%COLORGRAD Computes the vector gradient of an RGB image.
% [VG,VA,PPG]=COLORGRAD(F,T) computes the vector gradient,VG,
% and corresponding angle array,VA,(in radians) of RGB image
% F.It also computes PPG,the per-plane composite gradient
% obtained by summing the 2-D gradients of the individual color
% planes.Input T is a threshold in the range [0,1].If it is
% included in the argument list,the values of VG and PPG are
% threshoulded by letting VG(x,y)=0 for values <= T and VG(x,y)=
% VG(x,y) otherwise.Similar comments apply to PPG.If T is not
% included in the argument list then T is set to 0.Both output
% gradients are scaled to the range [0,1].
if (ndims(f) ~= 3) | (size(f, 3) ~= 3)
error('Input image must be RGB.');
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群