local_mean

eolab.georastertools.processing.algo.local_mean(input_data: ndarray, kernel_size: int = 8) ndarray[source]

Computes the local means of the input data using a sliding window defined by the kernel size. Each element in the output is the mean of the pixels within the specified kernel size window.

Parameters:
  • input_data (np.ndarray) – A 3D numpy array of shape (1, number_of_lines, number_of_columns) containing the Digital Elevation Model (DEM). The function only accepts arrays with one band.

  • kernel_size (int) – The size of the sliding window used to compute the local mean.

Returns:

A numpy array of the same size as input_data containing the computed local means.

Return type:

np.ndarray

Raises:

ValueError – If input_data does not have 3 dimensions or if the first dimension is not of size 1.