From 4ed9f507ad656d44f5c18f5a1a02faac3d2ff4e8 Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Thu, 16 Feb 2023 16:59:40 -0800 Subject: [PATCH] Internal change PiperOrigin-RevId: 510281435 --- mediapipe/util/filtering/BUILD | 1 + mediapipe/util/filtering/one_euro_filter.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mediapipe/util/filtering/BUILD b/mediapipe/util/filtering/BUILD index e167a3333..6bd6bc363 100644 --- a/mediapipe/util/filtering/BUILD +++ b/mediapipe/util/filtering/BUILD @@ -44,6 +44,7 @@ cc_library( hdrs = ["one_euro_filter.h"], deps = [ ":low_pass_filter", + "//mediapipe/framework/port:integral_types", "//mediapipe/framework/port:logging", "@com_google_absl//absl/memory", "@com_google_absl//absl/time", diff --git a/mediapipe/util/filtering/one_euro_filter.cc b/mediapipe/util/filtering/one_euro_filter.cc index 154236991..e7893edfe 100644 --- a/mediapipe/util/filtering/one_euro_filter.cc +++ b/mediapipe/util/filtering/one_euro_filter.cc @@ -3,6 +3,7 @@ #include #include "absl/memory/memory.h" +#include "mediapipe/framework/port/integral_types.h" #include "mediapipe/framework/port/logging.h" #include "mediapipe/util/filtering/low_pass_filter.h" @@ -18,7 +19,7 @@ OneEuroFilter::OneEuroFilter(double frequency, double min_cutoff, double beta, SetDerivateCutoff(derivate_cutoff); x_ = absl::make_unique(GetAlpha(min_cutoff)); dx_ = absl::make_unique(GetAlpha(derivate_cutoff)); - last_time_ = 0; + last_time_ = kint64min; } double OneEuroFilter::Apply(absl::Duration timestamp, double value_scale,