From c7fa55a993f5f94586899f06f75683dc26900732 Mon Sep 17 00:00:00 2001 From: Scott Date: Tue, 31 Dec 2019 15:41:54 +1030 Subject: [PATCH] revid/revid.go: Renamed constants to be more specific to the MOG filter --- revid/revid.go | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/revid/revid.go b/revid/revid.go index 075034a1..4def6f2c 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -78,16 +78,15 @@ const ( // Motion filter parameters const ( - knnMinArea = 25.0 - knnThreshold = 300 - knnHistory = 300 - knnKernel = 9 - knnShowWindows = true - minArea = 25.0 - threshold = 20.0 - history = 500 - showWindows = true - minFPS = 1.0 + knnMinArea = 25.0 + knnThreshold = 300 + knnHistory = 300 + knnKernel = 9 + mogMinArea = 25.0 + mogThreshold = 20.0 + mogHistory = 500 + showWindows = true + minFPS = 1.0 ) const pkg = "revid: " @@ -346,11 +345,11 @@ func (r *Revid) setupPipeline(mtsEnc func(dst io.WriteCloser, rate float64) (io. case config.FilterNoOp: r.filter = filter.NewNoOp(r.encoders) case config.FilterMOG: - r.filter = filter.NewMOGFilter(r.encoders, minArea, threshold, history, showWindows) + r.filter = filter.NewMOGFilter(r.encoders, mogMinArea, mogThreshold, mogHistory, showWindows) case config.FilterVariableFPS: - r.filter = filter.NewVariableFPSFilter(r.encoders, minFPS, filter.NewMOGFilter(r.encoders, minArea, threshold, history, showWindows)) + r.filter = filter.NewVariableFPSFilter(r.encoders, minFPS, filter.NewMOGFilter(r.encoders, mogMinArea, mogThreshold, mogHistory, showWindows)) case config.FilterKNN: - r.filter = filter.NewKNNFilter(r.encoders, knnMinArea, knnThreshold, knnHistory, knnKernel, knnShowWindows) + r.filter = filter.NewKNNFilter(r.encoders, knnMinArea, knnThreshold, knnHistory, knnKernel, showWindows) default: panic("Undefined Filter")