Search in sources :

Example 6 with Node

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);
    }
}
Also used : EllipseRotated_F64(georegression.struct.curve.EllipseRotated_F64) Node(boofcv.alg.fiducial.calib.circle.EllipsesIntoClusters.Node)

Aggregations

Node (boofcv.alg.fiducial.calib.circle.EllipsesIntoClusters.Node)6 EllipseRotated_F64 (georegression.struct.curve.EllipseRotated_F64)5 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)2 Grid (boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid)1 List (java.util.List)1 Tuple2 (org.ddogleg.struct.Tuple2)1