How to combine two or more overlapping bounding boxes?
Hello, How to combine two or more overlapping bounding boxes, into one region.
your help is highly appreciated :)
Add your bounding boxes to a container element filled with rectangles, like a vector of rectangles and then use the function groupRectangles.
And is it supposed to combine only the overlapped rectangles ?
Yes, you give it a parameter that defines the amount of overlap, look at the variables and explanation. It is the same principle used by the Viola&Jones framework to merge overlapping rectangles into a single bounding box!
You have multiple bounding boxes, and want to combine in one big box ?
If you take an array of boxes and detect xmin, xmax, ymin, ymax and return a cv::Rect(xmin, ymin, xmax-xmin, ymax-ymin) can't work ? Or you want to know how to detect if the boxes are overlapping ?
There is a difference in what he is doing. His solution creates a single rectangle for overlaps, my solutions requires you to define the minimal amount of overlapping rectangles to actually result in a detection. Do mind the difference there!
Asked: 2013-05-31 04:39:39 -0600
Seen: 16,151 times
Last updated: Feb 05 '14