Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1.  
  2. figure;
  3. normalized_hist = imhist(uint8(output_image),16)./numel(output_image)
  4. horz = linspace(0,255,16);
  5. stem(horz, normalized_hist, 'markersize', 0)
  6. axis([0 255 0 max(normalized_hist + 0.005)]);
  7. grid on;
  8.  
  9. entropy = 0;
  10.  
  11. for i = 1:length(normalized_hist)
  12. if (normalized_hist(i) > 0)
  13. entropy = entropy + normalized_hist(i) * log2(normalized_hist(i));
  14. end
  15. end
  16. entropy = -entropy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement