eolearn.features.haralick

Module for computing Haralick textures in EOPatch

class eolearn.features.haralick.HaralickTask(*args, **kwargs)[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.

Parameters
  • 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'}
execute(eopatch)[source]

Implement execute function