@@ -146,6 +146,10 @@ func (sb *KalmanBlobie) GetCenter() image.Point {
146146 return sb .Center
147147}
148148
149+ func (sb * KalmanBlobie ) GetCurrentRect () image.Rectange {
150+ return sb .CurrentRect
151+ }
152+
149153func (sb * KalmanBlobie ) GetDiagonal () float64 {
150154 return sb .Diagonal
151155}
@@ -177,3 +181,38 @@ func (sb *KalmanBlobie) IncrementNoMatchTimes() {
177181func (sb * KalmanBlobie ) SetExists (isExists bool ) {
178182 sb .isExists = isExists
179183}
184+
185+ // GetClassID Returns class identifier [KalmanBlobie]
186+ func (b * KalmanBlobie ) GetClassID () int {
187+ return b .classID
188+ }
189+
190+ // GetClassName Returns class name [KalmanBlobie]
191+ func (b * KalmanBlobie ) GetClassName () string {
192+ return b .className
193+ }
194+
195+ // SetDraw Sets options for drawing [KalmanBlobie]
196+ func (b * KalmanBlobie ) SetDraw (drawOptions * DrawOptions ) {
197+ b .drawingOptions = drawOptions
198+ }
199+
200+ // DrawTrack Draws blob's track [KalmanBlobie]
201+ func (b * KalmanBlobie ) DrawTrack (mat * gocv.Mat , optionalText string ) {
202+ if b .drawingOptions == nil {
203+ b .drawingOptions = NewDrawOptionsDefault ()
204+ }
205+ gocv .Rectangle (mat , b .CurrentRect , b .drawingOptions .BBoxColor .Color , b .drawingOptions .BBoxColor .Thickness )
206+ if b .isStillBeingTracked {
207+ for i := range b .Track {
208+ gocv .Circle (mat , b .Track [i ], b .drawingOptions .CentroidColor .Radius , b .drawingOptions .CentroidColor .Color , b .drawingOptions .CentroidColor .Thickness )
209+ }
210+ if optionalText != "" {
211+ pt := image .Pt (b .CurrentRect .Min .X , b .CurrentRect .Min .Y )
212+ textSize := gocv .GetTextSize (optionalText , b .drawingOptions .TextColor .Font , b .drawingOptions .TextColor .Scale , b .drawingOptions .TextColor .Thickness )
213+ textRect := image.Rectangle {Min : image.Point {X : pt .X , Y : pt .Y - textSize .Y }, Max : image.Point {X : pt .X + textSize .X , Y : pt .Y }}
214+ gocv .Rectangle (mat , textRect , b .drawingOptions .BBoxColor .Color , b .drawingOptions .BBoxColor .Thickness )
215+ gocv .PutText (mat , optionalText , pt , b .drawingOptions .TextColor .Font , b .drawingOptions .TextColor .Scale , b .drawingOptions .TextColor .Color , b .drawingOptions .TextColor .Thickness )
216+ }
217+ }
218+ }
0 commit comments