median
- eolab.georastertools.processing.algo.median(input_data: ndarray, kernel_size: int) ndarray[source]
Applies a Median Filter to the input data using scipy.ndimage.median_filter. The filter computes the median of the values contained within a sliding window determined by the kernel size.
- 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 (kernel) used to compute the median.
- Returns:
A numpy array of the same shape as input_data, containing the filtered data with the median values computed in the specified kernel.
- Return type:
np.ndarray
- Raises:
ValueError – If input_data does not have 3 dimensions or if the first dimension is not of size 1, or if kernel_size is not a positive odd integer.