I would like to generate a texture image based on GLCM Inverse Difference Moment. After going through this site 'http://www.fp.ucalgary.ca/mhallbey/texture_calculations.htm'. If I am not wrong, it's found that we need to create a sliding window and generate the texture value(s) on each window, which then form a texture image. and below shows the code i did, which i am not sure if i'm doing it right. Could you guys please advise me on this?