Error in GLCM texture analysis when loading custom parameters from file

Hello,

I am a new SNAP user and I would like to perform GLCM (Grey Level Co-occurrence Matrix) on some high-resolution SAR data using custom window size values, i.e., not necessarily the ones listed in the Parameter panel (5x5, 7x7, 9x9, 11x11). I created a .xml file with the GLCM parameters used within the GLCM module and set a 21x21 window size as a test (see attachment).

Then, in “File” I selected the option “Load Parameters” to import my .xml file and related parameter settings. However, SNAP returns the following error message:

Everything seems working fine if the window size is set as one of the values in the list, i.e., 5x5, 7x7, 9x9, 11x11. Am I doing anything wrong? Could anyone support with this please, or is there any way to change the default window size values in the source code?

I am working with a macOS Monterey, Version 12.4 and I am running the latest major version 8.0 of SNAP, all updated.

Thanks in advance for your help,
Valentina

Hello,

I have the same problem and tried to find the GLCM source code in the SNAP directories; however, I was not able to change the source code to input different window sizes rather than the default ones.

@marpet, @ABraun, It would be appreciated if you can help me to find a way to use larger window sizes than the default ones when running texture analysis module in SNAP.

Thank you for your support,

Best Regards,
Mahaa

When looking at the code the largest window size which might work is ‘17x17’
Support for other sizes needs to be implemented by @lveci or @jun_lu.

Or maybe you can adapt the code and modify it to your needs.

Relevant code locations are
snap-engine/GLCMOp.java at 9084de4c4b9fdd5c320d819631ae9c4388084116 · senbox-org/snap-engine (github.com)
snap-engine/FilterWindow.java at f4c9714ccf5f137f87874ca348728b002f2b5d49 · senbox-org/snap-engine (github.com)

A JIRA ticket ([SITBX-919] - JIRA) has been created to track the issue. We will look into it. Thank you.

GLCM operator has been modified to allow selection of larger windows. The modification will be available in the next release. Thank you.

1 Like

Dear @marpet and @jun_lu thanks a lot for your support on this! Currently, anything different from 5x5, 7x7, 9x9 and 11x11 is not working for me, including the 17x17 mentioned by @marpet.


Looking forward to the new release! @jun_lu do you know when it will be out?

Thanks a lot!

SNAP v9.0 has been released. Give it a try