diff --git a/src/algorithms/tracking/libs/exponential_smoother.cc b/src/algorithms/tracking/libs/exponential_smoother.cc index 53fe43b02..b02471946 100644 --- a/src/algorithms/tracking/libs/exponential_smoother.cc +++ b/src/algorithms/tracking/libs/exponential_smoother.cc @@ -63,7 +63,6 @@ void Exponential_Smoother::reset() { initializing_ = true; init_counter_ = 0; - init_attempts_ = 0; init_buffer_.clear(); } @@ -93,10 +92,9 @@ float Exponential_Smoother::smooth(float raw) if (init_counter_ >= samples_for_initialization_) { old_value_ = std::accumulate(std::begin(init_buffer_), std::end(init_buffer_), 0.0F) / static_cast(init_buffer_.size()); - if (old_value_ < (min_value_ + offset_) && init_attempts_ < max_init_attempts_) + if (old_value_ < (min_value_ + offset_)) { // flush buffer and start again - init_attempts_++; init_counter_ = 0; init_buffer_.clear(); } diff --git a/src/algorithms/tracking/libs/exponential_smoother.h b/src/algorithms/tracking/libs/exponential_smoother.h index 1cadc2cff..9804c8697 100644 --- a/src/algorithms/tracking/libs/exponential_smoother.h +++ b/src/algorithms/tracking/libs/exponential_smoother.h @@ -35,12 +35,6 @@ * * The length of the initialization can be controlled with * set_samples_for_initialization(int num_samples) - * - * If the average of an initialization window falls below - * min_value + offset, the window is discarded and initialization - * starts again, up to a maximum number of attempts; after that, the - * smoother engages with the last window average so that weak but valid - * signals still get smoothed. */ class Exponential_Smoother { @@ -68,8 +62,6 @@ private: float offset_{12.0}; int samples_for_initialization_{200}; int init_counter_{0}; - int init_attempts_{0}; - int max_init_attempts_{3}; bool initializing_{true}; };