endrov.unsortedImageFilters
Class ConvexHull

java.lang.Object
  extended by endrov.unsortedImageFilters.ConvexHull

public class ConvexHull
extends java.lang.Object

Convex hulls


Constructor Summary
ConvexHull()
           
 
Method Summary
static java.util.List<javax.vecmath.Vector2d> convexHull(java.util.List<javax.vecmath.Vector2d> points)
          Convex hull.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvexHull

public ConvexHull()
Method Detail

convexHull

public static java.util.List<javax.vecmath.Vector2d> convexHull(java.util.List<javax.vecmath.Vector2d> points)
Convex hull. General case, allowing repetition of points. O(n log n). graham scan. For pixels I suspect one can write a special O(n) taking into account that pixels are on a grid, they are presorted. All Atan2 would disappear and the special class would disappear. Most inner points could be ignored by only looking for the outermost pixels. it would be *a lot* faster. atan2 can be replaced by comparing slope, which can be done in integer with rewrites to multiplication UNTESTED