# pixels in the same image are correlated but how can I visualize it?

I am new in image processing.I know that pixels in the same image are correlated with each other but I don't know how can I draw the relationship b/w these pixels in the form of graph?.

• Can you post an image as an example and provide more information, e.g. on the type of image (gray levels, color, dynamic range, ...). And what kind of correlation do you mean (e.g. linear, non-linear, ...)? – M529 May 15 '16 at 9:12
• what do you mean by non-linear linear ,correlation and dynamic range.Can you explain these terms and their significance.Infact I have gray scaled image – Muhammad Aslam May 17 '16 at 7:08
• See the first image at en.wikipedia.org/wiki/Correlation_and_dependence for examples of linear and non-linear correlation. It is important to know the kind of correlation, since it determines the way to compute the correlation. As you can see in the wiki image, linear correlation measures can totally fail to quantify non-linear correlations. Dynamic range: Are your gray values continuous or quantized as integers? What are the min/max values, if there are any? – M529 May 17 '16 at 9:20

If you would like to show that in natural images, neighboring pixels tend to have similar values, you can use the cooccurrence matrix. The values in the matrix will be distributed mostly along the diagonal.

In the snapshot below, the second image is random and non-correlated. For that image the cooccurrence matrix is pretty much a constant. I'm not showing the matrices themselves, but a plot of their values such that white means '0'.

• What's the relationship to 2D cross-correlation? They seem similar – endolith Jun 21 '17 at 14:18

Try plotting a histogram of all the pixel intensity values in the image to understand the correaltion between the pixels

Matlab Code:

img = imread('fig.jpg');
imhist(img);


This gives u a histogram showing intensity values to understand the pixel values.. Check this: http://www.mathworks.com/help/images/ref/imhist.html

• An image histogram looses all the geometric distribution information such as the correlation of neighbouring pixels hence cannot be used to deduce the amount of correlation between pixels. – Fat32 Jun 21 '17 at 19:18