Hi, The scikit-image implementation of GLCM computes the grey level co-occurrence matrix for entire images or image patches. For some image labeling problems it is preferred to calculate GLCM features for each individual pixel using a sliding window approach as described in http://www.fp.ucalgary.ca/mhallbey/texture_calculations.htm. This approach can be implemented in scikit-image using a combination of view_as_windows, greycomatrix and greycoprops although I found it to be too slow for practical use. To overcome this I extended scikit-image with a function that performs the sliding window as fast cython code. It takes an image, distance, angle and window size and generates a texture image with the GLCM features ['mean','variance','contrast','dissimilarity','homogeneity','ASM','entropy','correlation'] calculated at every pixel. Would this be something people are interested in including as part of scikit-image? Regards, Willem
Hi Willem On 2014-12-05 01:08:04, Willem Olding <willemolding@gmail.com> wrote:
To overcome this I extended scikit-image with a function that performs the sliding window as fast cython code. It takes an image, distance, angle and window size and generates a texture image with the GLCM features ['mean','variance','contrast','dissimilarity','homogeneity','ASM','entropy','correlation'] calculated at every pixel.
We had a request for something very similar a while ago! Also, I think we need to think about the API for the current GLCM functionality--it seems it is more natural to specify specific offsets, rather than the current angle/radius. What do you think?
Would this be something people are interested in including as part of scikit-image?
Absolutely! Please file a pull request, and then we can work on it there. Regards Stéfan
Great news. I will tidy up my current code and post a pull request in the next couple of days. Regards, Willem
participants (2)
-
Stefan van der Walt
-
Willem Olding