First time here? Check out the FAQ!

Ask Your Question
2

How to combine two or more overlapping bounding boxes?

asked May 31 '13

Ali Tillawi gravatar image

Hello, How to combine two or more overlapping bounding boxes, into one region.

your help is highly appreciated :)

Preview: (hide)

2 answers

Sort by » oldest newest most voted
5

answered May 31 '13

Add your bounding boxes to a container element filled with rectangles, like a vector of rectangles and then use the function groupRectangles.

Preview: (hide)

Comments

And is it supposed to combine only the overlapped rectangles ?

Ali Tillawi gravatar imageAli Tillawi (May 31 '13)edit
1

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!

StevenPuttemans gravatar imageStevenPuttemans (May 31 '13)edit
0

answered May 31 '13

Rogeeeer gravatar image

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 ?

Preview: (hide)

Comments

exactly I want to detect the overlapping

Ali Tillawi gravatar imageAli Tillawi (May 31 '13)edit

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!

StevenPuttemans gravatar imageStevenPuttemans (Feb 6 '14)edit

Question Tools

1 follower

Stats

Asked: May 31 '13

Seen: 16,178 times

Last updated: Feb 05 '14