2022-08-21 20:31:19 +00:00
|
|
|
package steering
|
|
|
|
|
|
|
|
import (
|
2022-08-22 10:06:41 +00:00
|
|
|
"gocv.io/x/gocv"
|
2022-08-21 20:31:19 +00:00
|
|
|
"image"
|
|
|
|
)
|
|
|
|
|
2022-08-21 20:46:51 +00:00
|
|
|
func GroupBBoxes(bboxes []image.Rectangle) []image.Rectangle {
|
2022-08-22 10:06:41 +00:00
|
|
|
if len(bboxes) == 0 {
|
|
|
|
return []image.Rectangle{}
|
|
|
|
}
|
|
|
|
if len(bboxes) == 1 {
|
|
|
|
return []image.Rectangle{bboxes[0]}
|
|
|
|
}
|
|
|
|
return gocv.GroupRectangles(bboxes, 1, 0.2)
|
2022-08-21 20:31:19 +00:00
|
|
|
}
|