use of boofcv.alg.fiducial.calib.circle.EllipsesIntoClusters.Node in project BoofCV by lessthanoptimal.
the class EllipseClustersIntoGrid method addEdgesToInfo.
/**
* Adds edges to node info and computes their orientation
*/
void addEdgesToInfo(List<Node> cluster) {
for (int i = 0; i < cluster.size(); i++) {
Node n = cluster.get(i);
NodeInfo infoA = listInfo.get(i);
EllipseRotated_F64 a = infoA.ellipse;
// create the edges and order them based on their direction
for (int j = 0; j < n.connections.size(); j++) {
NodeInfo infoB = listInfo.get(indexOf(cluster, n.connections.get(j)));
EllipseRotated_F64 b = infoB.ellipse;
Edge edge = infoA.edges.grow();
edge.target = infoB;
edge.angle = Math.atan2(b.center.y - a.center.y, b.center.x - a.center.x);
}
sorter.sort(infoA.edges.data, infoA.edges.size);
}
}
Aggregations