From 12febf18f4b2ac974f9957fe9b9654ad89a7e9bb Mon Sep 17 00:00:00 2001 From: Scott Date: Mon, 3 Feb 2020 10:10:01 +1030 Subject: [PATCH] =?UTF-8?q?filter:=20downscalingFactor=20=E2=86=92=20scale?= =?UTF-8?q?Factor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filter/filters_circleci.go | 4 ++-- filter/knn.go | 4 ++-- filter/mog.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/filter/filters_circleci.go b/filter/filters_circleci.go index bb49d712..2e119fe5 100644 --- a/filter/filters_circleci.go +++ b/filter/filters_circleci.go @@ -32,12 +32,12 @@ import ( ) // NewMOG returns a pointer to a new NoOp struct for testing purposes only. -func NewMOG(dst io.WriteCloser, area, threshold float64, history int, debug bool, hf int, downscalingFactor int) *NoOp { +func NewMOG(dst io.WriteCloser, area, threshold float64, history int, debug bool, hf int, scaleFactor int) *NoOp { return &NoOp{dst: dst} } // NewKNN returns a pointer to a new NoOp struct for testing purposes only. -func NewKNN(dst io.WriteCloser, area, threshold float64, history, kernelSize int, debug bool, hf int, downscalingFactor int) *NoOp { +func NewKNN(dst io.WriteCloser, area, threshold float64, history, kernelSize int, debug bool, hf int, scaleFactor int) *NoOp { return &NoOp{dst: dst} } diff --git a/filter/knn.go b/filter/knn.go index 0009ce7d..fdb01937 100644 --- a/filter/knn.go +++ b/filter/knn.go @@ -53,14 +53,14 @@ type KNN struct { } // NewKNN returns a pointer to a new KNN filter struct. -func NewKNN(dst io.WriteCloser, area, threshold float64, history, kernelSize int, debug bool, hf int, downscalingFactor int) *KNN { +func NewKNN(dst io.WriteCloser, area, threshold float64, history, kernelSize int, debug bool, hf int, scaleFactor int) *KNN { bs := gocv.NewBackgroundSubtractorKNNWithParams(history, threshold, false) k := gocv.GetStructuringElement(gocv.MorphRect, image.Pt(kernelSize, kernelSize)) var windows []*gocv.Window if debug { windows = []*gocv.Window{gocv.NewWindow("KNN: Bounding boxes"), gocv.NewWindow("KNN: Motion")} } - return &KNN{dst, area, &bs, k, debug, windows, make([][]byte, hf-1), hf, 0, 1 / float64(downscalingFactor)} + return &KNN{dst, area, &bs, k, debug, windows, make([][]byte, hf-1), hf, 0, 1 / float64(scaleFactor)} } // Implements io.Closer. diff --git a/filter/mog.go b/filter/mog.go index d951823a..7971452c 100644 --- a/filter/mog.go +++ b/filter/mog.go @@ -53,14 +53,14 @@ type MOG struct { } // NewMOG returns a pointer to a new MOG filter struct. -func NewMOG(dst io.WriteCloser, area, threshold float64, history int, debug bool, hf int, downscalingFactor int) *MOG { +func NewMOG(dst io.WriteCloser, area, threshold float64, history int, debug bool, hf int, scaleFactor int) *MOG { bs := gocv.NewBackgroundSubtractorMOG2WithParams(history, threshold, false) k := gocv.GetStructuringElement(gocv.MorphRect, image.Pt(3, 3)) var windows []*gocv.Window if debug { windows = []*gocv.Window{gocv.NewWindow("MOG: Bounding boxes"), gocv.NewWindow("MOG: Motion")} } - return &MOG{dst, area, &bs, k, debug, windows, make([][]byte, hf-1), hf, 0, 1 / float64(downscalingFactor)} + return &MOG{dst, area, &bs, k, debug, windows, make([][]byte, hf-1), hf, 0, 1 / float64(scaleFactor)} } // Implements io.Closer.