![]() |
WPILibC++ 2026.2.1
|
A class that implements a moving-window median filter. More...
#include <frc/filter/MedianFilter.h>
Public Member Functions | |
| constexpr | MedianFilter (size_t size) |
| Creates a new MedianFilter. | |
| constexpr T | Calculate (T next) |
| Calculates the moving-window median for the next value of the input stream. | |
| constexpr T | LastValue () const |
| Returns the last value calculated by the MedianFilter. | |
| constexpr void | Reset () |
| Resets the filter, clearing the window of all elements. | |
A class that implements a moving-window median filter.
Useful for reducing measurement noise, especially with processes that generate occasional, extreme outliers (such as values from vision processing, LIDAR, or ultrasonic sensors).
|
inlineexplicitconstexpr |
Creates a new MedianFilter.
| size | The number of samples in the moving window. |
|
inlineconstexpr |
Calculates the moving-window median for the next value of the input stream.
| next | The next input value. |
|
inlineconstexpr |
Returns the last value calculated by the MedianFilter.
|
inlineconstexpr |
Resets the filter, clearing the window of all elements.