# How to find bouding boxes of objects ?

6 views (last 30 days)
Saïd Aissiou on 9 Jul 2020
Commented: Saïd Aissiou on 11 Jul 2020
I'm working on a video synopsis project and i have trouble finding the bouding boxes of detected objects. I want to find which bouding boxes correspond to which object
Let's say i have three objects detected in the current frame so i have a bouding box matrix with three lines, which line corresponds to which object ?

Image Analyst on 9 Jul 2020
Not sure why a bounding box has 3 lines instead of 4, but anyway...
The boxes are assigned in a top down, left-to-right manner. So whatever blob has the left-most pixel will be box #1. From the remaining blobs, whichever one has the next left-most pixel will be box #2, and so on across the image. If you want to do tracking you will have to keep track of which blob has which box because if the blobs change location, the box number for that blob will also change index number. If you don't want that, you'll have to figure out what the right (original) box number for that blob was and then renumber the boxes.

Saïd Aissiou on 10 Jul 2020
I tried tracking them but i had the same problem, when i try to crop the objects using the positions given by the bouding boxes i end up with less objets than positions in total and with this i have no way of knowing which object corresponds to which position. And i didn't understand this part 'Not sure why a bounding box has 3 lines instead of 4, but anyway...' i thought that every line of the matrix corresponds to an object so that's why i said three objects means three lines. Anyway thanks for your answer :D
Image Analyst on 10 Jul 2020
A box has 4 lines - one on each side (top, left, bottom, right). If there are 3 objects, then each object will have it's own 4-sided bounding box, so you'll have 3 4-sided boxes.
Saïd Aissiou on 11 Jul 2020
I see, thanks man :D