I want to partition an array of bounding boxes (with coordinates [ymin, xmin, ymax, xmax]
) as it is described in this paper [https://arxiv.org/pdf/1710.06677.pdf][1]. My threshold will be intersection over union for grouping two bounding boxes together.
I understood the Union-Find data structure, and tested it with some easy list examples. However, those lists contain just integers as list elements as opposed to bounding boxes, and my bounding box partitioning implementation does not work.
I think the problem is with creating the set. Because with a simple list, I can assign an integer to a list index. But I can't do this with bounding boxes, hence the examples don't work for my case.
Is there anyone who could help me implement a Union-Find data structure for bounding boxes?
Sources I got help:
https://medium.com/100-days-of-algorithms/day-41-union-find-d0027148376d
https://www.geeksforgeeks.org/union-find/