How to calculate overlap among multi bboxes for GTs in object detection?

35 views Asked by At

In objection detection task, it's easy to calculate IoU between 2 bboxes. However, I'd like to know how to calculate overlaps among multi bbox GTs?

An example about the overlap among multi bboxes

An example is given like this: I have 5 bbox gts, and I want to calculate overlap rate of each bbox. The shadow parts is the overlap between the black box and other boxes, so the overlap rate for the black box is the shadow area / the black box area. However, I have no idea how to calculate the shadow part.

I come up with an approximate method. Supposed that the image is 100* 200 ( 20000 pixels), we can create a bool_tensor with shape 5100200(we have 5 boxes here, and can define the first chanel is about black, and then blue, yellow, green, red). For each channel we judge that whether the pixel is in the box. First calculate logical_or along channel for the rest 4 boxes, then calculate the logical_and between the result and the black box. The sum of the final results is the shadow area, and the sum of the first channel is black box area. It can be more precise by upsampling the image to a large scale.

However, it's still an approximate, and need a large amount of calculation. Is there some other method? Thanks in advance.

0

There are 0 answers