From 65f1c89ff2220eb828dcec312da11dbc620449bc Mon Sep 17 00:00:00 2001 From: Ella Pietraroia Date: Tue, 31 Dec 2019 15:18:06 +1030 Subject: [PATCH] adding constants for the integer arguments --- revid/revid.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/revid/revid.go b/revid/revid.go index 5f4df7d8..fd3f83cf 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -76,6 +76,15 @@ const ( rtmpConnectionTimeout = 10 ) +// KNN filter properties +const ( + knnMinArea = 25.0 + knnThreshold = 300 + knnHistory = 300 + knnKernel = 9 + knnShowWindows = true +) + const pkg = "revid: " type Logger interface { @@ -336,7 +345,7 @@ func (r *Revid) setupPipeline(mtsEnc func(dst io.WriteCloser, rate float64) (io. case config.FilterVariableFPS: r.filter = filter.NewVariableFPSFilter(r.encoders, 1.0, filter.NewMOGFilter(r.encoders, 25, 20, 500, 3, true)) case config.FilterKNN: - r.filter = filter.NewKNNFilter(r.encoders, 25, 300, 300, 9, true) + r.filter = filter.NewKNNFilter(r.encoders, knnMinArea, knnThreshold, knnHistory, knnKernel, knnShowWindows) default: panic("Undefined Filter") }