I am seeking help. I would like to measure in MATLAB one feature extraction type, which is "color moments", but unfortunately, I could not find it. Can I get this code? Many thanks.

답변 (1개)

Shrikanth
Shrikanth 2015년 11월 13일
편집: Image Analyst 2015년 11월 13일

1 개 추천

% Extract RGB Channel
R=I(:,:,1);
G=I(:,:,2);
B=I(:,:,3);
% Extract Statistical features
% 1] MEAN
meanR=mean2(R);
meanG=mean2(G);
meanB=mean2(B);
% 2] Standard Deviation
stdR=std2(R);
stdG=std2(G);
stdB=std2(B);
A=[meanR meanG meanB stdR stdG stdB];
I think this will help you to find color moments in a color image.

댓글 수: 4

Nur Sholehah binti Said
Nur Sholehah binti Said 2018년 10월 8일
Can you help me with the code for skewness of the color moments?
Vittorio
Vittorio 2023년 11월 6일
skR = skewness(R);
skG = skewness(G);
skB = skewness(B);
skews = squeeze(skewness(I, 1, [1 2]));
then skews(1) for R, skews(2) for G, skews(3) for B
Image Analyst
Image Analyst 2023년 11월 6일
편집: Image Analyst 2023년 11월 6일
Note that these statistics are based purely on the pixel intensity alone. They are not spatial moments (like moment of inertia) that depends on where the pixels are located. If you want spatial moments, see my attached demo on spatial moments.
So mean, std, and skewness would give you the same answer if all the pixels were in an intensity ramp, or if they were distributed in a donut shape, or any other shape. The spatial moments would give you different values for those two images. I just want to make sure you know what you're measuring, and what is possible, so you can make the right choice for your situation.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

질문:

2015년 10월 26일

편집:

2023년 11월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by