Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [entropy, bytes_image, bytes_coding] = entropy_single_pixels(im)
- im = double(im);
- histg = hist(im);
- histg(histg==0) = [];
- nzhist = histg ./ numel(im);
- entropy = -sum(nzhist.*log2(nzhist));
- bytes_image = (entropy*(numel(im))/8);
- bytes_coding = 2*numel(unique(im));
- fprintf('ENTROPY_VALUE:%sn',num2str(entropy));
- fprintf('BYTES_IMAGE:%sn',num2str(bytes_image));
- fprintf('BYTES_CODING:%sn',num2str(bytes_coding));
- end
Add Comment
Please, Sign In to add comment