coconut_tools.magnetogram.nonlinear_diffusion_filter¶
Nonlinear diffusion filter based on Perona-Malik edge-preserving smoothing.
Author: Jose Murteira Cleaned, modularized and refactored by: Luis
Functions
|
Apply nonlinear isotropic diffusion filtering to a 2D image using Perona-Malik method. |
- coconut_tools.magnetogram.nonlinear_diffusion_filter.nonlinearDiffusionFilter(image, dx, dy, iterations, tau=1.0, image_seq=None)[source]¶
Apply nonlinear isotropic diffusion filtering to a 2D image using Perona-Malik method.
- Parameters:
image (np.ndarray) – 2D array representing the image to be filtered.
dx (float) – Pixel spacing in x-direction.
dy (float) – Pixel spacing in y-direction.
iterations (int) – Number of iterations.
tau (float) – Time step for the iteration. Default is 1.0.
image_seq (list, optional) – If provided, saves intermediate results here.
- Returns:
Filtered image and final timestep used.
- Return type:
Tuple[np.ndarray, float]