Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- figure;
- normalized_hist = imhist(uint8(output_image),16)./numel(output_image)
- horz = linspace(0,255,16);
- stem(horz, normalized_hist, 'markersize', 0)
- axis([0 255 0 max(normalized_hist + 0.005)]);
- grid on;
- entropy = 0;
- for i = 1:length(normalized_hist)
- if (normalized_hist(i) > 0)
- entropy = entropy + normalized_hist(i) * log2(normalized_hist(i));
- end
- end
- entropy = -entropy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement