Class ConvexHullUtilities
Object
ConvexHullUtilities
Utility methods for calculating convex hulls on 2D points.
Strongly influenced by http://rsb.info.nih.gov/ij/macros/ConvexHull.txt
-
Method Summary
Modifier and TypeMethodDescriptionconvexHull2D
(List<Point2i> points) Apply a convex-hull algorithm to filter a set of points using the default minimum number of points.convexHull2D
(List<Point2i> points, int minNumberPoints) Apply a convex-hull algorithm to filter a set of points.pointsOnAllOutlines
(ObjectCollection objects) Get points on all outlines of a collection of objects.pointsOnOutline
(ObjectMask object) Get points on the outline of a single object.
-
Method Details
-
convexHull2D
Apply a convex-hull algorithm to filter a set of points using the default minimum number of points.- Parameters:
points
- points to filter- Returns:
- the filtered points on convex-hull if the minimum number of points exists, otherwise the input points unchanged
- Throws:
OperationFailedException
- if the count variable becomes too high during calculation
-
convexHull2D
public static List<Point2i> convexHull2D(List<Point2i> points, int minNumberPoints) throws OperationFailedException Apply a convex-hull algorithm to filter a set of points.Note the algorithm will return the input-points if there are too few points.
- Parameters:
points
- points to filterminNumberPoints
- a minimum of number of points (before any convex hull filtering) that must be found- Returns:
- the filtered points on convex-hull if the minimum number of points exists, otherwise the input points unchanged
- Throws:
OperationFailedException
- if the count variable becomes too high during calculation
-
pointsOnAllOutlines
Get points on all outlines of a collection of objects.- Parameters:
objects
- the collection of objects- Returns:
- a list of
Point2i
representing points on all outlines
-
pointsOnOutline
Get points on the outline of a single object.- Parameters:
object
- the object mask- Returns:
- a list of
Point2i
representing points on the outline - Throws:
CreateException
- if there's an error creating the point list
-