# Thread: Few statistical measures for an image

1. ## Few statistical measures for an image

I'm not sure which section it belongs to, so I thought I should post in "others". The thing is I have a 3x3 matrix which represents a nine pixel square from grayscale image, so let's say the matrix can have values from 0 to 255. Now I need to make few statistical measures for the square based on this matrix, but whenever I tried to google any of them it always showed solutions that use some dedicated programs (like Matlab) or C++ libraries etc., while I only want pure mathematical formulas so I could calculate everything by myself based on the said matrix. The measures I need to calculate are:
- measure of smoothness
- measure of uniformity
- average gray level
- average contrast
- thrid moment
- entropy
Is there anyone who knows how to get these from the matrix? Any help will be apreciated.

2. I would imagine that average grey level is quite simple (take the average).
I suppose the third moment is derived once you know the mean ( is it the cube root of the sum of absolute values of the cubes of the differences of each element from the mean? )
-- sorry, I would write it as a formula rather than words if I was fluent in the code.
I don't know the formula for other variables.

3. Thank you very much, does anyone else know other formulas?

4. May be you could give us the source code in C or C++ of these functions and we could write it in pure math.