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,