Ask Your Question
2

How to combine two or more overlapping bounding boxes?

asked 2013-05-31 04:39:39 -0600

Ali Tillawi gravatar image

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

your help is highly appreciated :)

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
5

answered 2013-05-31 05:03:56 -0600

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

edit flag offensive delete link more

Comments

And is it supposed to combine only the overlapped rectangles ?

Ali Tillawi gravatar imageAli Tillawi ( 2013-05-31 05:07:38 -0600 )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 ( 2013-05-31 06:05:10 -0600 )edit
0

answered 2013-05-31 04:54:30 -0600

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 ?

edit flag offensive delete link more

Comments

exactly I want to detect the overlapping

Ali Tillawi gravatar imageAli Tillawi ( 2013-05-31 04:59:33 -0600 )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 ( 2014-02-06 04:06:36 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-05-31 04:39:39 -0600

Seen: 16,021 times

Last updated: Feb 05 '14