<p>You can find an <a href="https://github.com/google-research-datasets/Objectron/blob/master/objectron/dataset/iou.py" rel="nofollow noreferrer">implementation</a> for 3D-oriented bounding boxes accompanying the objectron benchmark. Their IoU metric takes two boxes as input and calculates the intersection volume based on the <a href="https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm" rel="nofollow noreferrer">Sutherland-Hodgman Polygon clipping algorithm</a>. A detailed answer is also described in the in the <a href="https://arxiv.org/pdf/2012.09988.pdf" rel="nofollow noreferrer">paper</a>.</p>
Calculation/ Implementation of the real 3D Intersection over Union (IoU) of two Bounding Boxes with 9 Degrees of Freedom
<p>I have two 3D bounding boxes with 9 degrees of freedom (3 translation, 3 dimensions, 3 rotations). Now I want to calculate the Intersection over Union (IoU) also known as <a href="https://en.wikipedia.org/wiki/Jaccard_index" rel="nofollow noreferrer">Jaccard Index</a> of them:</p>
<p><a href="https://i.stack.imgur.com/ETH2Q.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ETH2Q.gif" alt="Intersection Volume divided by Union Volume" /></a></p>
<p>I know this has <a href="https://www.researchgate.net/profile/Dingfu_Zhou/publication/335135103_IoU_Loss_for_2D3D_Object_Detection/links/5d662370299bf1f70b124e0d/IoU-Loss-for-2D-3D-Object-Detection.pdf" rel="nofollow noreferrer">already</a> <a href="http://www.cvlibs.net/publications/Geiger2012CVPR.pdf" rel="nofollow noreferrer">been</a> <a href="https://varunagrawal.github.io/bbox/bbox.html#bbox.metrics.jaccard_index_3d" rel="nofollow noreferrer">implemented</a> for the case of a single rotation (around the z-axis) using the bird's eye view, however I am looking for a solution, where the 3D bounding boxes can be rotated around all axes (x, y, z).</p>
<p>So far I did not find any approaches. I would probably start by calculating all intersection points and then try to calculate volumes using tetrahedrons. Any links or hints are welcome!</p>