From c1881cef3a5f15230f2fd3291c70c153c52f5ab7 Mon Sep 17 00:00:00 2001 From: Ella Pietraroia Date: Mon, 3 Feb 2020 10:52:04 +1030 Subject: [PATCH] filter: basic: comment and removing const --- filter/basic.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/filter/basic.go b/filter/basic.go index f2d7f3d2..138d106a 100644 --- a/filter/basic.go +++ b/filter/basic.go @@ -142,7 +142,7 @@ func (bf *Basic) Write(f []byte) (int, error) { } // If there are not enough motion pixels then discard the frame. - if bf.motion < pixels { + if bf.motion < bf.pix { return len(f), nil } @@ -163,12 +163,12 @@ func (bf *Basic) process(j int, wg *sync.WaitGroup) { diff := diffR + diffG + diffB - if diff > threshold { + if diff > bf.thresh { bf.motion++ } if bf.debug { - if diff > threshold { + if diff > bf.thresh { bf.bwImg.SetRGBA(i, j, color.RGBA{0xff, 0xff, 0xff, 0xff}) } else { bf.bwImg.SetRGBA(i, j, color.RGBA{0x00, 0x00, 0x00, 0xff})