![]() |
IDS peak ICV v1.2.0
|
#include <peak_icv/algorithms/filters/peak_icv_median_filter.hpp>
Public Member Functions | |
| MedianFilter ()=default | |
| Constructs a MedianFilter with a default kernel size of 3 (3×3 neighborhood). | |
| void | SetKernelSize (size_t kernelSize) |
| size_t | GetKernelSize () const |
| Image | Process (const Image &image) const |
| Applies the median filter to the specified image. | |
Represents a class for applying a median filter to an image to reduce noise and preserve edges.
The median filter is a non-linear, spatial filter used to reduce impulsive noise in images. It replaces each pixel with the median value of the pixels in its local neighborhood, defined by the specified kernel size. The kernel size corresponds to a square neighborhood (size x size grid) around each pixel, where the median is calculated.
This process preserves edges better than linear smoothing filters while effectively removing salt-and-pepper noise and small image artifacts. A larger kernel removes more noise but also reduces image detail.
Definition at line 42 of file peak_icv_median_filter.hpp.
|
default |
Constructs a MedianFilter with a default kernel size of 3 (3×3 neighborhood).
|
inline |
Definition at line 122 of file peak_icv_median_filter.hpp.
Applies the median filter to the specified image.
| [in] | image | The image to process. |
|
See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.
| NotSupportedException | The pixel format is unsupported. |
| NotPossibleException | The kernel size must be an odd number. |
| OutOfRangeException | The kernel size exceeds the image dimensions. |
Definition at line 127 of file peak_icv_median_filter.hpp.
|
inline |
Sets the kernel size used for the median filter.
The kernel size must be an odd number greater than 1 and smaller than the image dimensions. The kernel size defines the size of the neighborhood (in a size x size grid) used to calculate the median for each pixel.
A larger kernel removes more noise but also reduces image detail.
| [in] | kernelSize | Size of the kernel used for the median filter. |
Definition at line 117 of file peak_icv_median_filter.hpp.