필터 지우기
필터 지우기

How to use built-in entropy function

조회 수: 4 (최근 30일)
Mustafa Uysal
Mustafa Uysal 2019년 12월 24일
댓글: Mustafa Uysal 2020년 2월 3일
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
Image Analyst
Image Analyst 2019년 12월 24일
Make sure there are no zeros in your image.
Mustafa Uysal
Mustafa Uysal 2019년 12월 24일
But it can be zero in any image. Why it is a problem?

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

채택된 답변

Subhadeep Koley
Subhadeep Koley 2020년 2월 1일
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)))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by