Skip to content

Commit 2dc6bba

Browse files
authored
Add GLCM texture metrics (#963) (#973)
* Add GLCM texture metrics to focal module (#963) New xrspatial.glcm module with glcm_texture() for computing Haralick texture features (contrast, dissimilarity, homogeneity, energy, correlation, entropy) over a sliding window. Supports numpy, dask+numpy, cupy, and dask+cupy backends. Dask path pre-quantizes globally for consistent gray-level mapping across chunks. * Add tests for GLCM texture metrics (#963) 29 tests covering validation, quantization, known-value checks, NaN handling, edge cases, all six metrics, angle averaging, and cross-backend consistency (numpy vs dask, cupy, dask+cupy). * Update docs and README for GLCM texture (#963) Add glcm_texture to the focal reference docs and to the README feature matrix. CuPy/Dask+CuPy marked as CPU-fallback. * Add GLCM texture user guide notebook (#963) Demonstrates single/multi metric usage, angle effects, Dask support, and parameter reference on a synthetic four-texture raster. * Rename GLCM notebook to 23 (#963) * Add interactive GLCM texture explorer (#963) Standalone script with a six-zone synthetic raster. Keyboard controls cycle through metrics, window sizes, gray levels, and angles. Clicking a pixel shows its local GLCM matrix and a bar chart of all six Haralick feature values.
1 parent ede4c44 commit 2dc6bba

File tree

8 files changed

+1337
-0
lines changed

8 files changed

+1337
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ In the GIS world, rasters are used for representing continuous phenomena (e.g. e
169169
| [Mean](xrspatial/focal.py) | Computes the mean value within a sliding neighborhood window | ✅️ | ✅️ | ✅️ | ✅️ |
170170
| [Focal Statistics](xrspatial/focal.py) | Computes summary statistics over a sliding neighborhood window | ✅️ | ✅️ | ✅️ | ✅️ |
171171
| [Bilateral](xrspatial/bilateral.py) | Feature-preserving smoothing via bilateral filtering | ✅️ | ✅️ | ✅️ | ✅️ |
172+
| [GLCM Texture](xrspatial/glcm.py) | Computes Haralick GLCM texture features over a sliding window | ✅️ | ✅️ | 🔄 | 🔄 |
172173

173174
-------
174175

docs/source/reference/focal.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ Bilateral
3333
xrspatial.bilateral.bilateral
3434

3535

36+
GLCM Texture
37+
=============
38+
.. autosummary::
39+
:toctree: _autosummary
40+
41+
xrspatial.glcm.glcm_texture
42+
43+
3644
Focal Statistics
3745
================
3846
.. autosummary::

0 commit comments

Comments
 (0)