python setup.py install
- [Grey Level Co-occurance Matrix](# Grey Level Co-occurance Matrix)
- [glcm](# glcm.glcm)
- xglcm
- GLCM Features
glcm.glcm(array, dists, dirs, mode, symmetric=True, bins=256, normalized=True, check=True)
Generates a GLCM.
array : array_like Input image, either 2D or 3D. |
|
dists : array_like Array of desired integer distances [d1, d2, ..., dn]. |
|
dirs : array_like
Array of desired integer directions [d1, d2, ..., dn]. 1 Corresponds to N, 2 to NE, 3 to E, ... and 8 to NW. Caution! Directions will be reordered ascendingly. To avoid confused outputs, please make sure to provide an ordered array. |
|
mode : string Operation mode of the glcm. Features "sum" and "raw". In raw-mode a glcm is generated for every combination of distances and directions. In sum-mode all desired directions are added together so only one glcm per distance is generated. This is far more efficient than summing up afterwards. |
|
symmetric : boolean, optional Caution! Running in symmetric mode will remove opposing directions and will replace directions 5 to 8 with their corresponding counterparts! To avoid confusing outputs please make sure only to use directions 1 to 4 in symmetric mode! |
|
bins : int, optional Number of bins. When input checking is enabled, the input image is binned to this number if the maximum image value exceeds the number of bins. This happens aswell if the input image is not of integer type. |
|
normalized : boolean, optional Determines if the output shall be normalized or not. Caution! The normalization will fail if the input image has more than 10^15 pixels. |
|
check : boolean, optional Determines if the input should be checked for correctness. |
|
Returns: |
glcm : ndarray Array of glcm(s) with the following shape: [distances][directions][channels][bins][bins] |
glcm.xglcm(array, dists, dirs, mode, symmetric=True, bins=256, normalized=True, check=True)
Generates a GLCM for every channel combination.
**Parameters:** |
**array** : _array_like_
Input image with three dimensions with shape [dimx, dimy, channels] |
**dists** : _array_like_
Array of desired integer distances [d1, d2, ..., dn]. |
|
**dirs** : _array_like_
Array of desired integer directions [d1, d2, ..., dn]. 1 Corresponds to N, 2 to NE, 3 to E, ... and 8 to NW. Caution! Directions will be reordered ascendingly. To avoid confused outputs, please make sure to provide an ordered array. |
|
**mode** : _string_
Operation mode of the glcm. Features "sum" and "raw". In raw-mode a glcm is generated for every combination of distances and directions. In sum-mode all desired directions are added together so only one glcm per distance is generated. This is far more efficient than summing up afterwards. |
|
**symmetric** : _boolean, optional_
Caution! Running in symmetric mode will remove opposing directions and will replace directions 5 to 8 with their corresponding counterparts! To avoid confusing outputs please make sure only to use directions 1 to 4 in symmetric mode! |
|
**bins** : _int, optional_
Number of bins. When input checking is enabled, the input image is binned to this number if the maximum image value exceeds the number of bins. This happens aswell if the input image is not of integer type. |
|
**normalized** : _boolean, optional_
Determines if the output shall be normalized or not.
Caution! The normalization will fail if the input image has more than 10^15 pixels. |
|
**check** : _boolean, optional_ Determines if the input should be checked for correctness. | |
**Returns:** |
**glcm** : _ndarray_
Array of glcm(s) with the following shape: [distances][directions][source channels][target channels][bins][bins] |
glcm.glcm_features(array, features, symmetric=True, normalized=True)
Calculates features from a given set of GLCMs
**Parameters:** |
**array** : _array_like_
Array of glcms with shape where the last two axes covering the glcm entries. |
**features** : _int_
Binary input that determines the desired features. See below. |
|
**symmetric** : _boolean, optional_
Indicates if the input GLCM(s) are symmetric or not. |
|
**normalized** : _boolean, optional_ Determines if the input is normalized. | |
**Returns:** |
**glcm** : _dict_
Dictionary of features. |
glcm.asm, dictionary: "ASM"
Measurement of homogeneous patterns in the image.
glcm.contrast, dictionary: "Contrast"
glcm.correl, dictionary: "Correlation"
Not implemented yet
glcm.autocorrel, dictionary: "Auto Correlation"
glcm.ssq, dictionary: "SSQ"
Not implemented yet
glcm.idm, dictionary: "IDM"
glcm.idf, dictionary: "IDF"
glcm.sumavg, dictionary: "Sum Average"
glcm.sumvar, dictionary: "Sum Variance"
glcm.sumentrp, dictionary: "Sum Entropy"
glcm.diffavg, dictionary: "Diff Average"
glcm.diffvar, dictionary: "Diff Variance"
Not implemented yet
glcm.diffentrp, dictionary: "Diff Entropy"
glcm.clusterprom, dictionary: "Cluster Prominence"
glcm.clustershade, dictionary: "Cluster Shade"
glcm.clustertend, dictionary: "Cluster Tendency"
glcm.Dissim, dictionary: "Dissimilarity"