From f628c4243e4d092ac5a3e8e48b7939c6cdc03de4 Mon Sep 17 00:00:00 2001 From: Scott Date: Thu, 19 Dec 2019 16:51:49 +1030 Subject: [PATCH] Bugfix --- filter/mog.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/filter/mog.go b/filter/mog.go index 7cfa8356..99fe332b 100644 --- a/filter/mog.go +++ b/filter/mog.go @@ -61,7 +61,7 @@ func NewMOGFilter(dst io.WriteCloser, area, threshold float64, history, kernelSi // it using c-go. func (m *MOGFilter) Close() error { m.bs.Close() - m.kernel.Close() + m.knl.Close() for _, window := range m.windows { window.Close() } @@ -85,12 +85,12 @@ func (m *MOGFilter) Write(f []byte) (int, error) { gocv.Threshold(imgDelta, &imgDelta, 25, 255, gocv.ThresholdBinary) // Remove noise. - gocv.Erode(imgDelta, &imgDelta, m.kernel) - gocv.Dilate(imgDelta, &imgDelta, m.kernel) + gocv.Erode(imgDelta, &imgDelta, m.knl) + gocv.Dilate(imgDelta, &imgDelta, m.knl) // Fill small holes. - gocv.Dilate(imgDelta, &imgDelta, m.kernel) - gocv.Erode(imgDelta, &imgDelta, m.kernel) + gocv.Dilate(imgDelta, &imgDelta, m.knl) + gocv.Erode(imgDelta, &imgDelta, m.knl) // Find contours and reject ones with a small area. var contours [][]image.Point