Class KMeansFilamentEndpointFinder
- java.lang.Object
-
- edu.gsu.cs.dmlab.interpolation.utils.KMeansFilamentEndpointFinder
-
- All Implemented Interfaces:
ISTEndpointFinder
public class KMeansFilamentEndpointFinder extends Object implements ISTEndpointFinder
An end point finder that is used to approximately align two filament detections, this is used to initialize a more fine grained alignment performed within this object. The method being implemented is from the polygon interpolation methods described in Boubrahimi et. al, 2018.- Author:
- Soukaina Filali, updated by Dustin Kempton, Data Mining Lab, Georgia State University
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
KMeansFilamentEndpointFinder.Cluster
class
KMeansFilamentEndpointFinder.KMeans
-
Constructor Summary
Constructors Constructor Description KMeansFilamentEndpointFinder()
Constructor that assumes percentage of maximal distance coordinates from the centroid is 20 and the number of clusters to use is 2.KMeansFilamentEndpointFinder(int numClusters, double percentageCoordinate)
Constructor that takes in values for the number of clusters to use when attempting to find the end point and the percentage of the maximal distance coordinates from the centroid of a polygon should be used in those clusters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.locationtech.jts.geom.Coordinate
findBestEndpoint(org.locationtech.jts.geom.Polygon densifiedGeometry)
Returns the best end point between the end point pairs.org.apache.commons.math3.util.Pair<org.locationtech.jts.geom.Coordinate,org.locationtech.jts.geom.Coordinate>
findEndpointsfromClusters(List<KMeansFilamentEndpointFinder.Cluster> clusters)
Finds the most distant pairs of coordinates belonging to 2 different clusters
-
-
-
Constructor Detail
-
KMeansFilamentEndpointFinder
public KMeansFilamentEndpointFinder()
Constructor that assumes percentage of maximal distance coordinates from the centroid is 20 and the number of clusters to use is 2.
-
KMeansFilamentEndpointFinder
public KMeansFilamentEndpointFinder(int numClusters, double percentageCoordinate)
Constructor that takes in values for the number of clusters to use when attempting to find the end point and the percentage of the maximal distance coordinates from the centroid of a polygon should be used in those clusters- Parameters:
numClusters
- Number of clusters to use when finding the end pointpercentageCoordinate
- Percentage of points ordered by their distance from the centroid to use, where range is 0..1.
-
-
Method Detail
-
findBestEndpoint
public org.locationtech.jts.geom.Coordinate findBestEndpoint(org.locationtech.jts.geom.Polygon densifiedGeometry)
Returns the best end point between the end point pairs. A best end point is the one that has the highest y coordinate (Filaments do not tilt more than 40 degrees).- Specified by:
findBestEndpoint
in interfaceISTEndpointFinder
- Parameters:
densifiedGeometry
- The geometry object to find the best end point on- Returns:
- A coordinate that is considered to be the best based on some criteria
-
findEndpointsfromClusters
public org.apache.commons.math3.util.Pair<org.locationtech.jts.geom.Coordinate,org.locationtech.jts.geom.Coordinate> findEndpointsfromClusters(List<KMeansFilamentEndpointFinder.Cluster> clusters)
Finds the most distant pairs of coordinates belonging to 2 different clusters- Parameters:
clusters
-- Returns:
- the two endpoints of a polygon
-
-