![]() |
IDS peak ICV v1.2.0
|
Public Member Functions | |
| None | __init__ (self) |
| Creates an instance of the MedianFilter class with a default kernel size of 3x3. | |
| int | kernel_size (self) |
| Gets the current kernel size used for the median filter. | |
| None | kernel_size (self, int kernel_size) |
| Sets the size of the kernel used for the median filter. | |
| Image | process (self, Union[Image, ids_peak_ipl.Image] image) |
| Applies the median filter to the given image and returns the filtered result. | |
Protected Attributes | |
| int | _kernel_size = 3 |
Class for applying a median filter to an image.
The MedianFilter class applies a median filter to reduce noise in an image. It replaces each pixel value with the median value of its neighboring pixels, based on a defined kernel size.
Definition at line 11 of file median_filter.py.
| None __init__ | ( | self | ) |
Creates an instance of the MedianFilter class with a default kernel size of 3x3.
Definition at line 23 of file median_filter.py.
| int kernel_size | ( | self | ) |
Gets the current kernel size used for the median filter.
Definition at line 33 of file median_filter.py.
| None kernel_size | ( | self, | |
| int | kernel_size ) |
Sets the size of the kernel used for the median filter.
| kernel_size | Size of the kernel. Must be an odd number greater than 1. Also, it has to be smaller than the image size. |
Definition at line 45 of file median_filter.py.
Applies the median filter to the given image and returns the filtered result.
This function processes the entire image and reduces noise using the specified kernel size. The output image will have the same pixel format and dimensions as the input image.
| image | The input image to which the median filter will be applied. It can be of type Image or ids_peak_ipl.Image. |
| NotSupportedException | If the input image is of an unsupported format. |
| NotPossibleException | If the KernelSize is not a valid odd number greater than 1. |
| OutOfRangeException | If the kernel size is bigger than the given image. |
Definition at line 57 of file median_filter.py.
|
protected |
Definition at line 30 of file median_filter.py.