Module for computing Haralick textures in EOPatch

class eolearn.features.haralick.HaralickTask(feature, texture_feature='contrast', distance=1, angle=0, levels=8, window_size=3, stride=1)[source]

Bases: eolearn.core.eotask.EOTask

Task to compute Haralick texture images

The task compute the grey-level co-occurrence matrix (GLCM) on a sliding window over the input image and extract the texture properties.

The task uses skimage.feature.greycomatrix and skimage.feature.greycoprops to extract the texture features.

  • feature ((FeatureType, str) or (FeatureType, str, str)) –

    A feature that will be used and a new feature name where data will be saved. If new name is not specified it will be saved with name ‘<feature_name>_HARALICK’.

    Example: (FeatureType.DATA, ‘bands’) or (FeatureType.DATA, ‘bands’, ‘haralick_values’)

  • texture_feature (str) – Type of Haralick textural feature to be calculated

  • distance (int) – Distance between pairs of pixels used for GLCM

  • angle (float) – Angle between pairs of pixels used for GLCM in radians, e.g. angle=np.pi/4

  • levels (int) – Number of bins in GLCM

  • window_size (int) – Size of the moving GLCM window

  • stride (int) – How much the GLCM window moves each time

AVAILABLE_TEXTURES_SKIMAGE = {'ASM', 'contrast', 'correlation', 'dissimilarity', 'energy', 'homogeneity'}
AVAILABLE_TEXTURES = {'difference_entropy', 'difference_variance', 'inverse_difference_moment', 'sum_average', 'sum_entropy', 'sum_of_square_variance', 'sum_variance'}

Override to specify action performed by task.