How do you find circle points in Fortune's algorithm? - algorithm

I know that when your sweepline encounters three centers of your array, you have to check if there is something called "circle points".
I understand that circle points are the poles of the circle that goes through the other 3 points, but my questions is, which is the efficient way to do this, because what you really want is the center of the circle which is the vertex of three Voronoi poligons, so what came to my head is to find the three mediatrices and the intersection of the three will be the center, but it seems to me that if I do that the algorithm will be mor closely to a brute force algorithm, I hope you could help me with this, thanks in advance
EDIT: I think it's worth saying that I'm working on Julia, and that I've already done two brute force algorithms, one aproximate and one exact

There is a rather good and detailed description of this algorithm in this course book:
https://www.springer.com/gp/book/9783540779735
They explain how efficiency is obtained by adding pointers between the status tree and the parts of the diagram being constructed.
Maybe it can help. I have not implemented the algorithm myself.

Related

Algorithm to move points to get given distance

I am working on a tool which modifies geometries. One task is to move points that their (Euclidian) distances among each other are bigger than a given distance by considering that the sum of the moved ways is a minimum. A non-iterative solution which does not measure distances in between is preferred.
I need a algorithm in 3d, but a 1d or 2d explanation as a starting point would be very welcome.
The later coding will be in Python. In case a solution already exists I would use it.
A link to a book or paper related to this problem would be also helpful.
Thanks Hans G

opencv: Best way to detect corners on chessboard

BACKGROUND
So I'm creating a program that recognizes chess moves. So far, I have implemented a fair number of algorithms to come up with the best results possible. What I've found so far is that the combination of undistorting an image (using undistort ), then applying a histogram equalization algorithm, and finally the goodFeaturesToTrack algorithm (I've found this to be better than the harris corner detection) yields pretty decent results. The goal here is to have every corner of every square accounted for with a point. That way, when I apply canny edge detection, I can process individual squares.
EXAMPLE
WHAT I'VE CONSIDERED
http://www.nandanbanerjee.com/index.php?option=com_content&view=article&id=71:buttercup-chess-robot&catid=78&Itemid=470
To summarize the link above, the idea is to find the upper-leftmost, upper-rightmost, lower-leftmost, and lower-rightmost points and divide the distance between them by eight. From there you would come up with probable points and compare them to the points that are actually on the board. If one of the points doesn't match, simply replace the point.
I've also considered some sort of mode, like finding the distance between neighboring points and storing them in a list. Then I would perform a mode operation to figure out the most probable distance and use that to draw points.
QUESTION
As you can see, the points are fairly accurate over most of the squares (though there are random points that do not do what I want). My question is what do you think the best way to find all corners on the chessboard (I'm open to all ideas) and could you give me a somewhat detailed description (just enough to steer me in the right direction or more if you choose :)? Also, (and this is a secondary question) do you have any recommendations on how to proceed in order to best recognize a move? I'm attempting to implement multiple ways of doing so and am going to compare methods to obtain best results! Thank you.
Please read these two links:
http://www.aishack.in/tutorials/sudoku-grabber-opencv-plot/
How to remove convexity defects in a Sudoku square?

Algorithm for polygon intersection

In my code, I'm generating a polygon for the description of a region.
This polygon is created by a semplification of a 34000-vertices polygon, given at the beginning of the code.
But in the semplification I have to use, I've found this problem: sometimes it generates intersections of sides. I'm asking for algorithm useful to detect intersections.
All the algorithms for polygons....
http://geomalgorithms.com/a09-_intersect-3.html
Hope could be helpful for someone else!

How to partially cover a given shape with fixed number of circles?

I am not sure if it is proper to ask for help on algorithm here, but could anyone give me some guide, or just tell me where I could find such a kind of guide? Thanks a lot!
The problem is like this: given a fixed number of circles, I need an algorithm to find an optimal set of positions and radius of these circles to cover a given shape, so the error area (the parts of the circles outside the given shape + the parts of the shape not covered by these circles) is minimal? Circles could overlap.
This is not a trivial problem and there is certainly no simple analytic solution. For example: even the simplest version - one circle and one simple connected area isn't necessarily easy to solve depending on the shape of the area. There will also typically be numerous false minimums.
I would suggest that simulated annealing would be a suitable technique to find a good (if not the optimal) solution. Effectively, with n circles you are exploring a wildly varying function of 3n variables (x, y, and r for each circle) and simulated annealing is a fairly efficient way of exploring such an environment.

Reverse Rectangle Packing

I have a connected shape that consists of squares put together, e.g. take a squared paper and draw a line along the existing lines that ends at its beginning and does not cross itself.
The goal is now to find an algorithm (not brute-force) that fills this shape with as few, non-overlapping rectangles as possible.
I'm looking for the optimal solution. As can be seen in the images, the naive greedy approach (take the largest rectangle) does not work.
(Optimal)
(Greedy)
My scenario is vertices reduction, but I'm sure there are other use-cases as well.
Note: This problem seems basic, but I was not able to find a solution elsewhere. Also, is this problem NP-hard?
Edit: I just realized that, in my scenario, filling the shape with as few non-overlapping triangles as possible, would give an even better result.
I've spend a lot of time researching this, since I asked the initial question. For the first problem (optimally filling the shape with rectangles), I've written the solution here under the header "Optimal Greedy Meshing":
http://blackflux.wordpress.com/2014/03/01/meshing-in-voxel-engines-part-2/
The complexity is actually better (faster) than for optimally triangulating a polygon without holes. The slowest part is the Hopcroft-Karp algorithm.
Treating the shape as a polygon is also discussed in the linked blog post. Note that I'm also considering holes.
The first problem is harder than the one with triangles; for triangles, see the algorithms in
http://en.wikipedia.org/wiki/Polygon_triangulation
which can do it without any extra vertices.

Resources