Reputation: 189
i have an algorithm called the arnold 2-D map that just permutes the pixels of the image and doesn't change the vlaues of the pixels. but when i calculate the entropy values of the main image and the encrypted version the values are coming to be different. I am not able to understand this because since the formula for entropy just involves the probability of a pixel value in the image and that remains same after applying the cat map ,so why should the entropy change. Can somebody help
Upvotes: 0
Views: 397
Reputation: 1642
Let's take a look inside the matlab function entropy:
edit entropy
->
I = im2uint8(I);
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));
So it calculates the entropy based on the histogram of the image. All the spatial data is lost. You are right, the entropy should not change at all in any transform which does not affect the intensity values. Also note that the data type is changed to uint8 before calculating the entropy, so any possible floating point errors etc. should be truncated.
That leaves the Arnold map. I'd suggest you take a look at it, there's probably a bug, image overflow or lost pixels somewhere.
Upvotes: 2