Internal change
PiperOrigin-RevId: 510281435
This commit is contained in:
parent
5f6bbdbce5
commit
4ed9f507ad
|
@ -44,6 +44,7 @@ cc_library(
|
||||||
hdrs = ["one_euro_filter.h"],
|
hdrs = ["one_euro_filter.h"],
|
||||||
deps = [
|
deps = [
|
||||||
":low_pass_filter",
|
":low_pass_filter",
|
||||||
|
"//mediapipe/framework/port:integral_types",
|
||||||
"//mediapipe/framework/port:logging",
|
"//mediapipe/framework/port:logging",
|
||||||
"@com_google_absl//absl/memory",
|
"@com_google_absl//absl/memory",
|
||||||
"@com_google_absl//absl/time",
|
"@com_google_absl//absl/time",
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include "absl/memory/memory.h"
|
#include "absl/memory/memory.h"
|
||||||
|
#include "mediapipe/framework/port/integral_types.h"
|
||||||
#include "mediapipe/framework/port/logging.h"
|
#include "mediapipe/framework/port/logging.h"
|
||||||
#include "mediapipe/util/filtering/low_pass_filter.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);
|
SetDerivateCutoff(derivate_cutoff);
|
||||||
x_ = absl::make_unique<LowPassFilter>(GetAlpha(min_cutoff));
|
x_ = absl::make_unique<LowPassFilter>(GetAlpha(min_cutoff));
|
||||||
dx_ = absl::make_unique<LowPassFilter>(GetAlpha(derivate_cutoff));
|
dx_ = absl::make_unique<LowPassFilter>(GetAlpha(derivate_cutoff));
|
||||||
last_time_ = 0;
|
last_time_ = kint64min;
|
||||||
}
|
}
|
||||||
|
|
||||||
double OneEuroFilter::Apply(absl::Duration timestamp, double value_scale,
|
double OneEuroFilter::Apply(absl::Duration timestamp, double value_scale,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user