# How to calculate median and standard deviation from histogram?

I have a 256 bin histogram of an 8 bit image.

Is it possible to calculate the Median, Variance and Standard deviation of the image from the given histogram?

If yes, then what is the procedure?

Thank you.

-

Adding to Michaels answer: You can compute grouped mean and std.dev, but they are approximations. While there are no systematic error in the approximation to the mean, the st.dev will be underestimated in this way (since you are calculating as if all observations falling in the same bin are in fact equal, so you miss the contribution to variance from variation within bins). Long time ago corrections was developed for this, based on the fact that the variance of a uniform distribution on $[a,b]$ is $\frac{ (b-a)^2}{12}$. They are Sheppards corrections: http://mathworld.wolfram.com/SheppardsCorrection.html