Different answer using inbuilt function and own code for entropy
조회 수: 4 (최근 30일)
이전 댓글 표시
When I use the inbuilt function and my own code for entropy, the answer is different.
E = -sum(Rarray(Rarray>0) .* log2(Rarray(Rarray>0)));
E2 = entropy(Rarray);
Entropy with Writen code = -768.0522
Entropy wth Function = 1.7366
댓글 수: 0
채택된 답변
Image Analyst
2017년 10월 19일
Simply edit entropy.m and you'll see exactly how they do it:
% calculate histogram counts
p = imhist(I(:));
% remove zero entries in p
p(p==0) = [];
% normalize p so that sum(p) is one.
p = p ./ numel(I);
E = -sum(p.*log2(p));
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!