rectangles

OpenCV groupRectangles - getting grouped and ungrouped rectangles

邮差的信 提交于 2019-11-27 12:27:40
I'm using OpenCV and want to group together rectangles that have significant overlap. I've tried using groupRectangles for this, which takes a group threshold argument. With a threshold of 0 it doesn't do any grouping at all, and with a threshold of 1 is only returns rectangles that were the result of at least 2 rectangles. For example, given the rectangles on the left in the image below you end up with the 2 rectangles on the right: What I'd like to end up with is 3 rectangles. The 2 on the right in the image above, plus the rectangle in the top right of the image to the left that doesn't

Efficient (and well explained) implementation of a Quadtree for 2D collision detection [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 06:11:41
I've been working on adding a Quadtree to a program that I'm writing, and I can't help but notice that there are few well explained/performing tutorials for the implementation that I'm looking for. Specifically, a list of the methods and pseudocode for how to implement them (or just a description of their processes) that are commonly used in a Quadtree (retrieve, insert, remove, etc.) is what I'm looking for, along with maybe some tips to improve performance. This is for collision detection, so it'd be best to be explained with 2d rectangles in mind, as they are the objects that will be stored

Finding an axis-aligned rectangle inside a polygon

烂漫一生 提交于 2019-11-27 01:01:57
问题 I am looking for a good algorithm to find an axis-aligned rectangle inside a (not necessarily convex) polygon. A maximal rectangle would be nice, but is not necessary - any algorithm that can find a "fairly good" rectangle would be fine. The polygon may also have holes, but any pointers to algorithms that only work for convex or simple polygons would be helpful too. In my implementation, intersection testing for sides is fairly cheap, but "point in polygon" tests are expensive, so ideally

OpenCV groupRectangles - getting grouped and ungrouped rectangles

旧时模样 提交于 2019-11-26 18:11:25
问题 I'm using OpenCV and want to group together rectangles that have significant overlap. I've tried using groupRectangles for this, which takes a group threshold argument. With a threshold of 0 it doesn't do any grouping at all, and with a threshold of 1 is only returns rectangles that were the result of at least 2 rectangles. For example, given the rectangles on the left in the image below you end up with the 2 rectangles on the right: What I'd like to end up with is 3 rectangles. The 2 on the

Java ball object doesn't bounce off of drawn rectangles like it's supposed to.

六月ゝ 毕业季﹏ 提交于 2019-11-26 17:58:17
Sorry for the awful title. The purpose of the Java applet is as such: A ball is bouncing around the screen. The size and speed of this ball can be changed via scrollbars. The user can press and drag the mouse on the screen to draw rectangles. The ball will bounce off of these rectangles as well. The bounds of these rectangles are stored in a vector. When a rectangle is clicked, it (and all other rectangles at that point) are removed from the vector (and the screen). The problem I'm having is two-fold: One, when I click a rectangle to remove it, it doesn't get removed, but that can be solved

Efficient (and well explained) implementation of a Quadtree for 2D collision detection [closed]

血红的双手。 提交于 2019-11-26 11:52:52
问题 I\'ve been working on adding a Quadtree to a program that I\'m writing, and I can\'t help but notice that there are few well explained/performing tutorials for the implementation that I\'m looking for. Specifically, a list of the methods and pseudocode for how to implement them (or just a description of their processes) that are commonly used in a Quadtree (retrieve, insert, remove, etc.) is what I\'m looking for, along with maybe some tips to improve performance. This is for collision

Determine if two rectangles overlap each other?

假如想象 提交于 2019-11-26 01:21:36
问题 I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity. I\'ve tried to implement what is mentioned in this question but I am not having very much luck. My current implementation does the following: // Gets all the vertices for Rectangle 1 and stores them in an array ->

Algorithm for finding the fewest rectangles to cover a set of rectangles without overlapping

我们两清 提交于 2019-11-26 00:20:14
问题 I have a set of rectangles and I would like to \"reduce\" the set so I have the fewest number of rectangles to describe the same area as the original set. If possible, I would like it to also be fast, but I am more concerned with getting the number of rectangles as low as possible. I have an approach now which works most of the time. Currently, I start at the top-left most rectangle and see if I can expand it out right and down while keeping it a rectangle. I do that until it can\'t expand