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})