use of georegression.struct.curve.EllipseRotated_F64 in project BoofCV by lessthanoptimal.
the class EllipsesIntoClusters method init.
/**
* Recycles and initializes all internal data structures
*/
void init(List<EllipseInfo> ellipses) {
searchPoints.resize(ellipses.size());
nodes.resize(ellipses.size());
clusters.reset();
for (int i = 0; i < ellipses.size(); i++) {
EllipseRotated_F64 e = ellipses.get(i).ellipse;
double[] p = searchPoints.get(i);
p[0] = e.center.x;
p[1] = e.center.y;
Node n = nodes.get(i);
n.connections.reset();
n.which = i;
n.cluster = -1;
}
search.setPoints(searchPoints.toList(), nodes.toList());
}
use of georegression.struct.curve.EllipseRotated_F64 in project BoofCV by lessthanoptimal.
the class DetectCircleHexagonalGrid method isClockWise.
/**
* Uses the cross product to determine if the grid is in clockwise order
*/
private static boolean isClockWise(Grid g) {
EllipseRotated_F64 v00 = g.get(0, 0);
EllipseRotated_F64 v02 = g.columns < 3 ? g.get(1, 1) : g.get(0, 2);
EllipseRotated_F64 v20 = g.rows < 3 ? g.get(1, 1) : g.get(2, 0);
double a_x = v02.center.x - v00.center.x;
double a_y = v02.center.y - v00.center.y;
double b_x = v20.center.x - v00.center.x;
double b_y = v20.center.y - v00.center.y;
return a_x * b_y - a_y * b_x < 0;
}
Aggregations