2
votes
3answers
94 views

Divide rectangular image into fixed number of random sized rectangles + 1 fixed size rectangle

I'm trying to divide a rectangular image into a fixed number of smaller rectangular image parts (of random but bounded width / height), with the exception of 1 rectangle which is predefined in ...
5
votes
2answers
184 views

Random 2D point in rectangle, but not in a polygon

I have a static rectangle and dynamic polygon. I need to generate a random 2D point in that rectangle, but not in a polygon. This is what I mean: Green is where random point can be generated and ...
6
votes
2answers
384 views

Algorithm to reduce a bitmap mask to a list of rectangles?

Before I go spend an afternoon writing this myself, I thought I'd ask if there was an implementation already available --even just as a reference. The first image is an example of a bitmap mask that I ...