I'm trying to find some information threshold that is required for performing detection of objects in images. However, I'm not sure how exactly to quantify the amount of information contained within an image.


I imagine that looking at the gradients/edges of the image would be a good idea, but simply counting the number of edge pixels doesn't seem enough. Maybe looking for patterns within the edge image?

Perhaps I should look at the image in the frequency domain?

I don't think I can just use Shannon's entropy because it doesn't really "look" at the big picture.

Any help/guidance would be appreciated.

My problem with Shannon's entropy is that it is calculated without considering spatial structures. For example, the following two image have the same entropy score:

enter image description here

  • 1
    $\begingroup$ What, if not Shannon Entropy, would quantify Information content? Why do you think it doesn't look at the big picture? Note that you might be the one thinking it's only the sum of information per isolated pixel, and that all pixels have the same probabilistic properties independently, but that's not the case: correlation within a class of images reduces the info per pixel. $\endgroup$ Jul 14, 2019 at 10:38
  • 1
    $\begingroup$ I've updated the question to explain my problem with Shannon's entropy. $\endgroup$
    – Mark.F
    Jul 15, 2019 at 5:56

2 Answers 2


My problem with Shannon's entropy is that it is calculated without considering spatial structures.

That's not true!

Entropy is the expectation of Information, which is the negative logarithm of probability.

So, if you have correlated pixels (for example, in pictures of the first kind, say, a pixel in anything but the top row always has the same value as the pixel above), then that pixel's info drops to zero.

So, your statement is only true if you assume all pixels to be independent, which they aren't.


Shannon entropy calculated using the pixel intensities would not make sense, like you said, because you are essentially treating the image as a flattened array. This could give you some measure of information but that would not be a bound as tight as Shannon entropy. Such a measurement of entropy can only reduce if you take spatial patterns into consideration.

The main problem is that there is no fixed notion of image entropy and can be defined as one wishes, as long as it makes sense and satisfies some nice properties that are expected from an entropy measure. Different works have come up with their own ways of measuring (their definition of) entropy of an image.

In this work, image entropy is calculated based on the distribution of gradients, instead of pixel intensities. Here is an answer written on CrossValidated by the author of the earlier mentioned work.

But this work is not final that it accurately quantifies the information in the image, but it is better than directly using the pixel intensities. Given an image $I$, whose entropy you want to calculate, if you can create a useless image with similar distribution of gradients, both the images would have similar entropy measures, according to this work. Of course, you could then at look at the distribution of the second derivatives of the image, and so on.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.