Usage (GLCM Cross)¶
Given that ar
is an np.ndarray
.
OOP GLCM Cross Transform
>>> from glcm_cupy import GLCMCross
>>> g = GLCMCross(...).run(ar)
Functional GLCM Cross Transform
>>> from glcm_cupy import glcm_cross
>>> g = glcm_cross(ar, ...)
I/O¶
For a np.ndarray
or cp.ndarray
input, the algorithm will output a
np.ndarray
or cp.ndarray
respectively.
Input Array Requirements¶
Shape: \(B\times H\times W\times C\) or \(H\times W\times C\)
Non-negative, integer array
Must be large enough for
radius
Must have at least 2 channels to cross
Output Array¶
Shape: \(B\times H^*\times W^*\times C_{combo}\times F\) or \(H\times W\times C_{combo}\times F\)
0 to 1 if
normalize_features
, else it depends on feature.
Combinations¶
The pair combination order is dependent on itertools.combinations
.
For example, for an image with 4 channels:
>>> from itertools import combinations
>>> n_channels = 4
>>> pair_combinations = combinations(range(n_channels), 2)
>>> print(pair_combinations)
[(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)]
We see that the 1st channel crosses Channel 0 and Channel 1.
Arguments¶
Argument |
Description |
Default |
---|---|---|
List of |
|
|
List of pair combinations to use |
|
|
Radius of GLCM Windows |
|
|
Maximum Value + 1 of the array. |
|
|
Maximum Value + 1 of the array |
|
|
Whether to scale features to |
|
|
verbose |
Whether |
|
max_partition_size1 |
No. of windows parsed per GLCM Matrix |
|
max_threads1 |
No. of threads per CUDA block |
|
See also
Learn how to use glcm-cupy
from the examples in the sidebar on the left!