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