Directions¶
You can specify directions from 4 directions.
East:
Direction.EASTSouth East:
Direction.SOUTH_EASTSouth:
Direction.SOUTHSouth West:
Direction.SOUTH_WEST
>>> from glcm_cupy import GLCM, Direction
>>> g = GLCM(directions=(Direction.SOUTH_WEST, Direction.SOUTH))
In a full example:
>>> from glcm_cupy import GLCM, Direction
>>> import numpy as np
>>> from PIL import Image
>>> ar = np.asarray(Image.open("image.jpg"))
>>> g = GLCM(directions=(Direction.SOUTH_WEST, Direction.SOUTH)).run(ar)
Bi-Directionality¶
This algorithm uses bi-directional algorithm in the kernel. It populates GLCM for I, J and J, I.
Note
This bi-directionality performance cost is negligible as it simply adds the transposed GLCM.