Search in sources :

Example 61 with EllipseRotated_F64

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());
}
Also used : EllipseRotated_F64(georegression.struct.curve.EllipseRotated_F64)

Example 62 with EllipseRotated_F64

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;
}
Also used : EllipseRotated_F64(georegression.struct.curve.EllipseRotated_F64)

Aggregations

EllipseRotated_F64 (georegression.struct.curve.EllipseRotated_F64)62 ArrayList (java.util.ArrayList)34 Test (org.junit.Test)25 Grid (boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid)18 GrayU8 (boofcv.struct.image.GrayU8)15 Point2D_F64 (georegression.struct.point.Point2D_F64)9 List (java.util.List)9 NodeInfo (boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.NodeInfo)5 Node (boofcv.alg.fiducial.calib.circle.EllipsesIntoClusters.Node)5 EllipsesIntoClusters (boofcv.alg.fiducial.calib.circle.EllipsesIntoClusters)2 TestDetectCircleHexagonalGrid.createGrid (boofcv.alg.fiducial.calib.circle.TestDetectCircleHexagonalGrid.createGrid)2 SquareGrid (boofcv.alg.fiducial.calib.squares.SquareGrid)2 SquareNode (boofcv.alg.fiducial.calib.squares.SquareNode)2 EllipseInfo (boofcv.alg.shapes.ellipse.BinaryEllipseDetector.EllipseInfo)2 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)2 Vector3D_F64 (georegression.struct.point.Vector3D_F64)2 AffineTransform (java.awt.geom.AffineTransform)2 BufferedImage (java.awt.image.BufferedImage)2 CalibrationDetectorCircleHexagonalGrid (boofcv.abst.fiducial.calib.CalibrationDetectorCircleHexagonalGrid)1 CalibrationDetectorCircleRegularGrid (boofcv.abst.fiducial.calib.CalibrationDetectorCircleRegularGrid)1