mirror of https://bitbucket.org/ausocean/av.git
Bugfix
This commit is contained in:
parent
bd8922b475
commit
f628c4243e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue