mirror of https://bitbucket.org/ausocean/av.git
filter: downscalingFactor → scaleFactor
This commit is contained in:
parent
72a5c31588
commit
12febf18f4
|
@ -32,12 +32,12 @@ import (
|
|||
)
|
||||
|
||||
// NewMOG returns a pointer to a new NoOp struct for testing purposes only.
|
||||
func NewMOG(dst io.WriteCloser, area, threshold float64, history int, debug bool, hf int, downscalingFactor int) *NoOp {
|
||||
func NewMOG(dst io.WriteCloser, area, threshold float64, history int, debug bool, hf int, scaleFactor int) *NoOp {
|
||||
return &NoOp{dst: dst}
|
||||
}
|
||||
|
||||
// NewKNN returns a pointer to a new NoOp struct for testing purposes only.
|
||||
func NewKNN(dst io.WriteCloser, area, threshold float64, history, kernelSize int, debug bool, hf int, downscalingFactor int) *NoOp {
|
||||
func NewKNN(dst io.WriteCloser, area, threshold float64, history, kernelSize int, debug bool, hf int, scaleFactor int) *NoOp {
|
||||
return &NoOp{dst: dst}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,14 +53,14 @@ type KNN struct {
|
|||
}
|
||||
|
||||
// NewKNN returns a pointer to a new KNN filter struct.
|
||||
func NewKNN(dst io.WriteCloser, area, threshold float64, history, kernelSize int, debug bool, hf int, downscalingFactor int) *KNN {
|
||||
func NewKNN(dst io.WriteCloser, area, threshold float64, history, kernelSize int, debug bool, hf int, scaleFactor int) *KNN {
|
||||
bs := gocv.NewBackgroundSubtractorKNNWithParams(history, threshold, false)
|
||||
k := gocv.GetStructuringElement(gocv.MorphRect, image.Pt(kernelSize, kernelSize))
|
||||
var windows []*gocv.Window
|
||||
if debug {
|
||||
windows = []*gocv.Window{gocv.NewWindow("KNN: Bounding boxes"), gocv.NewWindow("KNN: Motion")}
|
||||
}
|
||||
return &KNN{dst, area, &bs, k, debug, windows, make([][]byte, hf-1), hf, 0, 1 / float64(downscalingFactor)}
|
||||
return &KNN{dst, area, &bs, k, debug, windows, make([][]byte, hf-1), hf, 0, 1 / float64(scaleFactor)}
|
||||
}
|
||||
|
||||
// Implements io.Closer.
|
||||
|
|
|
@ -53,14 +53,14 @@ type MOG struct {
|
|||
}
|
||||
|
||||
// NewMOG returns a pointer to a new MOG filter struct.
|
||||
func NewMOG(dst io.WriteCloser, area, threshold float64, history int, debug bool, hf int, downscalingFactor int) *MOG {
|
||||
func NewMOG(dst io.WriteCloser, area, threshold float64, history int, debug bool, hf int, scaleFactor int) *MOG {
|
||||
bs := gocv.NewBackgroundSubtractorMOG2WithParams(history, threshold, false)
|
||||
k := gocv.GetStructuringElement(gocv.MorphRect, image.Pt(3, 3))
|
||||
var windows []*gocv.Window
|
||||
if debug {
|
||||
windows = []*gocv.Window{gocv.NewWindow("MOG: Bounding boxes"), gocv.NewWindow("MOG: Motion")}
|
||||
}
|
||||
return &MOG{dst, area, &bs, k, debug, windows, make([][]byte, hf-1), hf, 0, 1 / float64(downscalingFactor)}
|
||||
return &MOG{dst, area, &bs, k, debug, windows, make([][]byte, hf-1), hf, 0, 1 / float64(scaleFactor)}
|
||||
}
|
||||
|
||||
// Implements io.Closer.
|
||||
|
|
Loading…
Reference in New Issue