mirror of https://bitbucket.org/ausocean/av.git
file added
This commit is contained in:
parent
85ca6014c4
commit
f076330799
|
@ -28,25 +28,6 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
const (
|
||||
motionDownscaling = 1
|
||||
motionInterval = 1
|
||||
|
||||
BasicThreshold = 45000
|
||||
BasicPixels = 1000
|
||||
|
||||
DiffThreshold = 3
|
||||
|
||||
KNNMinArea = 25.0
|
||||
KNNThreshold = 300
|
||||
KNNHistory = 300
|
||||
KNNKernel = 9
|
||||
|
||||
MOGMinArea = 25.0
|
||||
MOGThreshold = 20.0
|
||||
MOGHistory = 500
|
||||
)
|
||||
|
||||
type d struct {
|
||||
}
|
||||
|
||||
|
@ -54,6 +35,8 @@ func (d *d) Write(p []byte) (int, error) { return len(p), nil }
|
|||
func (d *d) Close() error { return nil }
|
||||
|
||||
func BenchmarkBasic(b *testing.B) {
|
||||
const BasicThreshold = 45000
|
||||
const BasicPixels = 1000
|
||||
buffer := &d{}
|
||||
f := NewBasic(buffer, BasicThreshold, BasicPixels)
|
||||
b.Log("Frames: ", len(testPackets))
|
||||
|
@ -68,6 +51,7 @@ func BenchmarkBasic(b *testing.B) {
|
|||
}
|
||||
|
||||
func BenchmarkDifference(b *testing.B) {
|
||||
const DiffThreshold = 3.0
|
||||
buffer := &d{}
|
||||
f := NewDifference(buffer, DiffThreshold)
|
||||
b.Log("Frames: ", len(testPackets))
|
||||
|
@ -82,6 +66,12 @@ func BenchmarkDifference(b *testing.B) {
|
|||
}
|
||||
|
||||
func BenchmarkKNN(b *testing.B) {
|
||||
const motionDownscaling = 1
|
||||
const motionInterval = 1
|
||||
const KNNMinArea = 25.0
|
||||
const KNNThreshold = 300.0
|
||||
const KNNHistory = 300
|
||||
const KNNKernel = 9
|
||||
buffer := &d{}
|
||||
f := NewKNN(buffer, KNNMinArea, KNNThreshold, KNNHistory, KNNKernel, motionInterval, motionDownscaling)
|
||||
b.Log("Frames: ", len(testPackets))
|
||||
|
@ -96,6 +86,11 @@ func BenchmarkKNN(b *testing.B) {
|
|||
}
|
||||
|
||||
func BenchmarkMOG(b *testing.B) {
|
||||
const motionDownscaling = 1
|
||||
const motionInterval = 1
|
||||
const MOGMinArea = 25.0
|
||||
const MOGThreshold = 20.0
|
||||
const MOGHistory = 500
|
||||
buffer := &d{}
|
||||
f := NewMOG(buffer, MOGMinArea, MOGThreshold, MOGHistory, motionInterval, motionDownscaling)
|
||||
b.Log("Frames: ", len(testPackets))
|
||||
|
|
Loading…
Reference in New Issue