hi i have mean and standard deviation in one image now i want to find entropy for RGB color and skewness..

조회 수: 4 (최근 30일)
how to find entropy and skewness for RGB in one image?

채택된 답변

Youssef  Khmou
Youssef Khmou 2014년 5월 16일
To find the entropy, you have two ways, using predefined function or by programming :
H=imread('autumn.tif'); % RGB sample
E1=entropy(H)
Using program here is way :
H=im2double(H(:));
P=hist(H,length(H));
P(P==0)=[];
P=P/sum(P);
E2=-sum(P.*log2(P));
  댓글 수: 9

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

추가 답변 (1개)

Image Analyst
Image Analyst 2014년 5월 16일
편집: Image Analyst 2014년 5월 16일
For entropy you can use entropy(). If you want a local entropy to give an image of how much the entropy is around the image, you can use entropyfilt(). If you want image moments, see the attached demo of mine.
A color image is three color channels. You can take the entropy of each.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
redEntropy = entropy(redChannel);
greenEntropy = entropy(greenChannel);
blueEntropy = entropy(blueChannel);
  댓글 수: 3
zack
zack 2014년 5월 16일
편집: zack 2014년 5월 16일
thanks..may i know from this code skew = sum((GLs - meanGL) .^ 3 .* pixelCounts) / ((numberOfPixels - 1) * stdDev^3);,where can i get pixelcounts and number of pixel from my image pixel..and i can still have no idea to get entropy for RGB..appreciate ur help.:)
Image Analyst
Image Analyst 2014년 5월 16일
Was this comment posted before you used Youssef's code and accepted it? He only did entropy and you accepted it so I assume that it does what you need.

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

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by