File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ type Blobie interface {
18
18
GetDiagonal () float64
19
19
GetClassID () int
20
20
GetClassName () string
21
+ GetPropetry (key string ) (interface {}, bool )
22
+ SetPropetry (key string , value interface {})
21
23
Exists () bool
22
24
NoMatchTimes () int
23
25
IncrementNoMatchTimes ()
Original file line number Diff line number Diff line change @@ -31,8 +31,9 @@ type KalmanBlobie struct {
31
31
noMatchTimes int
32
32
PredictedNextPosition image.Point
33
33
34
- classID int
35
- className string
34
+ classID int
35
+ className string
36
+ customProperties map [string ]interface {}
36
37
37
38
// Kalman filter wrapping
38
39
pointTracker * kf.PointTracker
@@ -213,6 +214,15 @@ func (b *KalmanBlobie) GetClassName() string {
213
214
return b .className
214
215
}
215
216
217
+ func (b * KalmanBlobie ) GetPropetry (key string ) (interface {}, bool ) {
218
+ v , ok := b .customProperties [key ]
219
+ return v , ok
220
+ }
221
+
222
+ func (b * KalmanBlobie ) SetPropetry (key string , value interface {}) {
223
+ b .customProperties [key ] = value
224
+ }
225
+
216
226
// SetDraw Sets options for drawing [KalmanBlobie]
217
227
func (b * KalmanBlobie ) SetDraw (drawOptions * DrawOptions ) {
218
228
b .drawingOptions = drawOptions
Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ type SimpleBlobie struct {
26
26
noMatchTimes int
27
27
PredictedNextPosition image.Point
28
28
29
- classID int
30
- className string
29
+ classID int
30
+ className string
31
+ customProperties map [string ]interface {}
31
32
32
33
// For array tracker
33
34
drawingOptions * DrawOptions
@@ -201,6 +202,15 @@ func (b *SimpleBlobie) GetClassName() string {
201
202
return b .className
202
203
}
203
204
205
+ func (b * SimpleBlobie ) GetPropetry (key string ) (interface {}, bool ) {
206
+ v , ok := b .customProperties [key ]
207
+ return v , ok
208
+ }
209
+
210
+ func (b * SimpleBlobie ) SetPropetry (key string , value interface {}) {
211
+ b .customProperties [key ] = value
212
+ }
213
+
204
214
// SetDraw Sets options for drawing [SimpleBlobie]
205
215
func (b * SimpleBlobie ) SetDraw (drawOptions * DrawOptions ) {
206
216
b .drawingOptions = drawOptions
You can’t perform that action at this time.
0 commit comments