Search code examples
image-processingcomputer-visionscikit-image

Calculating Color Moments


How can I calculate color moments with skimage? measure.moments provides some moments but I don't know how to calculate mean, variance and skewness in terms of them. For example I can use M00 returned from measure.moments and with dividing it by number of pixels I can obtain mean, but I'm not sure it's the right way.


Solution

  • You can compute sample statistics for the pixels in an image using standard NumPy functions and function in the SciPy statistics package:

    You will have to compute these per channel.