Entropy of an image

26 ビュー (過去 30 日間)
Paolo Piazza
Paolo Piazza 2020 年 6 月 26 日
コメント済み: ammu v 2021 年 7 月 26 日
Hi everyone, I am new to MATLAB and I am trying to calculate and analyze the entropy of a set of images. Sometimes however, I need to crop only a certain area of a picture in order to calculate the entropy of that specific area (see attached file). The question is: does the size of an image bias the entropy value? If yes, is it possible to solve this problem?
thanks in advance
PS: I wanted to calculate the entropy of RGB pictures but I never found the code for that

回答 (2 件)

Madhav Thakker
Madhav Thakker 2020 年 8 月 21 日
Hi,
Entropy for a grayscale image is calculated as the sum(p.*log2(p)), where p contains the normalized histogram counts returned from imhist. If the resized image does not change the histogram of the original image, there shouldn’t be any change in the entropy value as well.
There is no inbuilt function to calculate entropy of RGB Images. You can refer this answer for some ways to calculate entropy of colored images. https://in.mathworks.com/matlabcentral/answers/261930-how-to-calculate-entropy-of-colored-image
Entropy documentation for better understanding - https://in.mathworks.com/help/images/ref/entropy.html
Hope this helps.
  1 件のコメント
ammu v
ammu v 2021 年 7 月 25 日
編集済み: ammu v 2021 年 7 月 25 日
this answer give a full picture.. for eg:we have to find tumor entropy, its a subject dependent size.will there be nfluence of size on entropy?

サインインしてコメントする。


Image Analyst
Image Analyst 2021 年 7 月 25 日
@ammu v, to compute the entropy of just a region of interest in an image you first have to define a binary image (mask) that is the region of interest, for example the tumor. Then you can use entropyfilt() on the whole image.
entropyImage = entropyfilt(grayImage);
Then get the mean in the masked region
meanEntropy = mean(entropyImage(mask))
  1 件のコメント
ammu v
ammu v 2021 年 7 月 26 日
Thnakyou for the answer. If i have an iamge of size 120*120, and another of size 150*150, will there be infulence of size in the entropy calculation

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by