public class UtilCalibrationGrid
extends java.lang.Object
Constructor and Description |
---|
UtilCalibrationGrid() |
Modifier and Type | Method and Description |
---|---|
static int |
distanceCircle(int i0,
int i1,
int size)
Distance between two elements in a circular list.
|
static int |
distanceCircle(int i0,
int i1,
int dir,
int size)
dist = (dir > 0 ) i1-i0 ? i0-i1;
if( dist < 0 )
distance = size+distance;
|
static Point2D_I32 |
findAverage(java.util.List<Point2D_I32> contour)
Find the average of all the points in the list.
|
static int |
findFarthest(Point2D_F64 a,
java.util.List<Point2D_F64> contour) |
static int |
findFarthest(Point2D_I32 a,
java.util.List<Point2D_I32> contour)
Returns the index of the point farthest away from the sample point
|
static int |
incrementCircle(int i,
int dir,
int size)
Returns the next point in the list assuming a cyclical list
|
static java.util.List<Point2D_F64> |
rotatePoints(java.util.List<Point2D_F64> points,
int numRows,
int numCols)
Rotates the grid by 90 degrees in the counter clockwise direction.
|
static java.util.List<Point2D_F64> |
rotatePoints(java.util.List<Point2D_F64> points,
int numRows,
int numCols,
int expectedRows,
int expectedCols)
Automatically checks and adjusts the points.
|
static void |
sortByAngleCCW(Point2D_F64 center,
java.util.List<Point2D_F64> contour)
Sorts the points in counter clockwise direction around the provided point
|
public static java.util.List<Point2D_F64> rotatePoints(java.util.List<Point2D_F64> points, int numRows, int numCols, int expectedRows, int expectedCols)
points
- Ordered points in a grid.numRows
- Number of rows in grid.numCols
- Number of columns in grid.expectedRows
- Number of expected rows.expectedCols
- Number of expected columns.public static java.util.List<Point2D_F64> rotatePoints(java.util.List<Point2D_F64> points, int numRows, int numCols)
points
- Ordered points in a grid.numRows
- Number of rows in grid.numCols
- Number of columns in grid.public static int incrementCircle(int i, int dir, int size)
i
- current indexdir
- Direction and amount of incrementsize
- Size of the listpublic static int distanceCircle(int i0, int i1, int dir, int size)
i0
- First point.i1
- Second point.dir
- 0 > counting down, 0 < counting upsize
- public static int distanceCircle(int i0, int i1, int size)
i0
- i1
- size
- public static Point2D_I32 findAverage(java.util.List<Point2D_I32> contour)
contour
- public static void sortByAngleCCW(Point2D_F64 center, java.util.List<Point2D_F64> contour)
center
- Point that the angle is computed relative tocontour
- List of all the points which are to be sorted by anglepublic static int findFarthest(Point2D_I32 a, java.util.List<Point2D_I32> contour)
public static int findFarthest(Point2D_F64 a, java.util.List<Point2D_F64> contour)
Copyright © 2011-2012 Peter Abeles