【CBIR】【Color】颜色矩(Color Moment)2

颜色矩(Color Moment)2

function colorMoments = colorMoments(image)
% input: image to be analyzed and extract 3 first moments from each R,G,B
% output: 1x9 vector containing the 3 first color momenst from each R,G,B
% channel

% extract color channels
R = double(image(:, :, 1));
G = double(image(:, :, 2));
B = double(image(:, :, 3));

% compute 2 first color moments from each channel
meanR = mean( R(:) );
stdR  = std( R(:) );
SkewR =  mean((R(:)-meanR).^3)^(1/3);

meanG = mean( G(:) );
stdG  = std( G(:) );
SkewG = mean((G(:)-meanG).^3)^(1/3);

meanB = mean( B(:) );
stdB  = std( B(:) );
SkewB = mean((B(:)-meanB).^3)^(1/3);

% construct output vector
colorMoments = zeros(1, 9);
colorMoments(1, :) = [meanR,stdR,SkewR,meanG,stdG,SkewG,meanB,stdB,SkewB];

% clear workspace
clear('R', 'G', 'B', 'meanR', 'stdR', 'SkewR' ,'meanG', 'stdG', 'SkewG' ,'meanB', 'stdB','SkewRB');

end


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值