[SciPy-user] Measuring local image contrast

Martin Spacek scipy@mspacek.mm...
Mon Apr 21 22:59:56 CDT 2008


Given a 2D numpy array of image pixel values, I'd like to get an output array whose entries describe the local contrast around each of the pixels in the input. I'm not sure exactly how this is typically done in the image processing field, but I'm guessing one way would be to take the difference between the center pixel and the mean of the surrounding 8 pixels. Is there a standard way to do this in numpy/scipy? Maybe describe the operation in a kernel somehow, and then convolve it with the image? I've looked at scipy.ndimage, but nothing pops out for me. Same goes for PIL's ImageFilter. My problem is probably lack of familiarity with the nomenclature.

Cheers,

Martin


More information about the SciPy-user mailing list