Skip to main content

texture_features_patch

Function texture_features_patch 

Source
pub fn texture_features_patch(
    image: &Array2<f64>,
    y: usize,
    x: usize,
    patch_size: usize,
) -> NdimageResult<Array1<f64>>
Expand description

Extract a texture feature vector for a local patch centred at (y, x).

The feature vector concatenates:

  1. Mean and standard deviation of pixel intensity in the patch.
  2. Gabor magnitudes at 4 orientations and 2 frequencies (16 values).
  3. LBP histogram (8 bins, radius-1 uniform LBP).

Total feature dimensionality: 26 elements.

§Parameters

  • image – input grayscale image.
  • y, x – centre row and column of the patch.
  • patch_size – patch width/height (must be odd and ≥ 3).

§Errors

Returns NdimageError::InvalidInput for an invalid patch size or out-of-bounds centre.