From 270e7012df42fc011690c37a153ceb1577c27a20 Mon Sep 17 00:00:00 2001 From: Dimitrii Lopanov Date: Fri, 23 Apr 2021 21:11:35 +0300 Subject: [PATCH] init property map --- v2/blob/kalman_blob.go | 1 + v2/blob/simple_blob.go | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/v2/blob/kalman_blob.go b/v2/blob/kalman_blob.go index 6cb579d..6b8da8f 100644 --- a/v2/blob/kalman_blob.go +++ b/v2/blob/kalman_blob.go @@ -66,6 +66,7 @@ func NewKalmanBlobie(rect image.Rectangle, options *BlobOptions) Blobie { yMatrix: mat.NewDense(2, 1, []float64{centerX, centerY}), uMatrix: mat.NewDense(4, 1, []float64{0.0, 0.0, 0.0, 0.0}), crossedLine: false, + customProperties: make(map[string]interface{}), } kalmanBlobie.pointTracker.SetStateValue(centerX, centerY, 0, 0) if options != nil { diff --git a/v2/blob/simple_blob.go b/v2/blob/simple_blob.go index 42a4017..7332379 100644 --- a/v2/blob/simple_blob.go +++ b/v2/blob/simple_blob.go @@ -51,6 +51,7 @@ func NewSimpleBlobie(rect image.Rectangle, options *BlobOptions) Blobie { isStillBeingTracked: true, noMatchTimes: 0, crossedLine: false, + customProperties: make(map[string]interface{}), } if options != nil { blobie.TrackTime = []time.Time{options.Time} @@ -87,10 +88,10 @@ func NewBlobieDefaults(rect image.Rectangle) *SimpleBlobie { isExists: true, isStillBeingTracked: true, noMatchTimes: 0, - - classID: -1, - className: "No class", - crossedLine: false, + classID: -1, + className: "No class", + customProperties: make(map[string]interface{}), + crossedLine: false, } }