From 214a8083c3a4e794c0d88b939606a263dc045563 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 19 Sep 2013 18:30:04 +0200 Subject: ewma: fix filter lack of idempotence Bug introduced by self in c4f6c12187ed423edc17501b0f6bda129d192bca --- ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp index 69d18d9b..6bf2396a 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp @@ -115,7 +115,7 @@ void FTNoIR_Filter::FilterHeadPoseData(const double *target_camera_position, //NB: larger alpha = *less* lag (opposite to what you'd expect) float largest_alpha=0.0f; for (int i=0;i<6;i++) { - largest_alpha=std::max(largest_alpha, alpha[i]); + largest_alpha=std::min(largest_alpha, alpha[i]); } // Calculate the new camera position. -- cgit v1.2.3