Filter löschen
Filter löschen

How to use built-in entropy function

3 Ansichten (letzte 30 Tage)
Mustafa Uysal
Mustafa Uysal am 24 Dez. 2019
Kommentiert: Mustafa Uysal am 3 Feb. 2020
Hi,
i would like to calculate entropy of an image using entropy function. when use this function like this
E = entropy(uint8(output_image)
i can see a value. But when i remove uint8, i see 0 as a result. type of output_image is double. Also when i try to calculate entropy like described in this link
E = -sum(histogram_of_output_image.*log2(histogram_of_output_image));
i see NAN (not a number) as a result
  2 Kommentare
Image Analyst
Image Analyst am 24 Dez. 2019
Make sure there are no zeros in your image.
Mustafa Uysal
Mustafa Uysal am 24 Dez. 2019
But it can be zero in any image. Why it is a problem?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Subhadeep Koley
Subhadeep Koley am 1 Feb. 2020
Hi, Can you attach your "output_image" ? So that we can reproduce the issue.
Otherwise you can try the code below.
E = entropy(uint8(rescale(output_image, 0, 255)))

Weitere Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by