mirror of https://bitbucket.org/ausocean/av.git
Merge branch 'knn' of https://bitbucket.org/ausocean/av into knn
This commit is contained in:
commit
5d6899e346
|
@ -1,6 +1,9 @@
|
||||||
/*
|
/*
|
||||||
|
<<<<<<< HEAD
|
||||||
// +build !circleci
|
// +build !circleci
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> 65f1c89ff2220eb828dcec312da11dbc620449bc
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
A filter that detects motion and discards frames without motion. The
|
A filter that detects motion and discards frames without motion. The
|
||||||
filter uses a K-Nearest Neighbours (KNN) to determine what is
|
filter uses a K-Nearest Neighbours (KNN) to determine what is
|
||||||
|
@ -29,7 +32,10 @@ LICENSE
|
||||||
package filter
|
package filter
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
<<<<<<< HEAD
|
||||||
"fmt"
|
"fmt"
|
||||||
|
=======
|
||||||
|
>>>>>>> 65f1c89ff2220eb828dcec312da11dbc620449bc
|
||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
"io"
|
"io"
|
||||||
|
@ -75,10 +81,14 @@ func (m *KNNFilter) Close() error {
|
||||||
// Write applies the motion filter to the video stream. Only frames with motion
|
// Write applies the motion filter to the video stream. Only frames with motion
|
||||||
// are written to the destination encoder, frames without are discarded.
|
// are written to the destination encoder, frames without are discarded.
|
||||||
func (m *KNNFilter) Write(f []byte) (int, error) {
|
func (m *KNNFilter) Write(f []byte) (int, error) {
|
||||||
|
<<<<<<< HEAD
|
||||||
img, err := gocv.IMDecode(f, gocv.IMReadColor)
|
img, err := gocv.IMDecode(f, gocv.IMReadColor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, fmt.Errorf("can't decode image: %w", err)
|
return 0, fmt.Errorf("can't decode image: %w", err)
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
img, _ := gocv.IMDecode(f, gocv.IMReadColor)
|
||||||
|
>>>>>>> 65f1c89ff2220eb828dcec312da11dbc620449bc
|
||||||
defer img.Close()
|
defer img.Close()
|
||||||
|
|
||||||
imgDelta := gocv.NewMat()
|
imgDelta := gocv.NewMat()
|
||||||
|
|
Loading…
Reference in New Issue