I have an algorithm that outputs gray scale images (not normalized). These images often contain a lot of random noise and sometimes also contain spatial structures.
I would like to have some kind of measurement to compute how random an image is. Random images should have a low score whereas images with structures should score higher. Ideally the score should be in an range so that I can compare images with each other. Something like:
- 0 = image consists purely of random noise
- 1 = image contains clear and sharp structures (whatever that would mean)
The first thing that came into my mind was computing the Shannon entropy of each image but I ended up with a lot of questions:
What is the correct way to normalize the images or more specifically, how many gray levels should the image have? 8 or 256 or something else?
Which base of the logarithm should I use? Common is 2 but also $e$ and 10.
Do I compute the entropy for the whole image or do I compute the entropy of patches of size $m \times m$ around a pixel $(i,j)$ and sum up the entropy afterwards?
Does Shannon's entropy really take spatial structures into account? It seems to me, that the definition only looks locally at a single pixel. Is that right?
In some articles about Shannon's entropy the co-occurrence matrix was mentioned which can measure the texture of the image.
Is that a better way to go for my problem? How can I use this for my purpose?
I read that this method provides some statistics I have problems to understand. Articles about co-occurrence matrices mentioned Contrast, Correlation, Energy and Homogeneity as a tool to analyze an image. Which one should I consider for a distinction between images that with a lot of random noise and images with sharp structures?