MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ magnitude_of()

template<typename T >
template<typename U >
static double MayaFlux::Kinesis::HampelFilter< T >::magnitude_of ( const U &  v)
inlinestaticprivatenoexcept

Scalar reduction used for the MAD comparison.

Plain arithmetic T reduces to its absolute value directly. glm vector T reduces to its length. This means HampelFilter screens on magnitude of change, not direction: a candidate whose magnitude is consistent with recent history is accepted even if its direction differs, which is deliberate, since a real sharp turn is a direction change with unremarkable magnitude and should not be screened out as if it were a spike.

Definition at line 194 of file HampelFilter.hpp.

195 {
196 if constexpr (requires { glm::length(v); }) {
197 return static_cast<double>(glm::length(v));
198 } else {
199 return static_cast<double>(std::abs(v));
200 }
201 }

Referenced by MayaFlux::Kinesis::HampelFilter< T >::accept().

+ Here is the caller graph for this function: