Search in sources :

Example 16 with ChessboardCorner

use of boofcv.alg.feature.detect.chess.ChessboardCorner in project BoofCV by lessthanoptimal.

the class TestChessboardCornerGraph method node_reset.

@Test
void node_reset() {
    Node n = new Node();
    n.corner = new ChessboardCorner();
    n.corner.setTo(1, 2);
    n.index = 3;
    n.corner.orientation = 9;
    n.edges[1] = new Node();
    n.reset();
    assertEquals(-1, n.index);
    for (int i = 0; i < 4; i++) {
        assertNull(n.edges[i]);
    }
    assertNull(n.corner);
}
Also used : ChessboardCorner(boofcv.alg.feature.detect.chess.ChessboardCorner) Node(boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph.Node) Test(org.junit.jupiter.api.Test)

Example 17 with ChessboardCorner

use of boofcv.alg.feature.detect.chess.ChessboardCorner in project BoofCV by lessthanoptimal.

the class TestChessboardCornerGraph method reset.

@Test
void reset() {
    ChessboardCornerGraph alg = new ChessboardCornerGraph();
    for (int i = 0; i < 10; i++) {
        Node n = alg.corners.grow();
        n.corner = new ChessboardCorner();
        n.corner.setTo(i * 5, 1);
    }
    assertTrue(alg.corners.size > 0);
    alg.reset();
    assertEquals(0, alg.corners.size);
}
Also used : ChessboardCorner(boofcv.alg.feature.detect.chess.ChessboardCorner) Node(boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph.Node) Test(org.junit.jupiter.api.Test)

Example 18 with ChessboardCorner

use of boofcv.alg.feature.detect.chess.ChessboardCorner in project BoofCV by lessthanoptimal.

the class TestChessboardCornerGraph method findClosest.

@Test
void findClosest() {
    ChessboardCornerGraph alg = new ChessboardCornerGraph();
    for (int i = 0; i < 10; i++) {
        Node n = alg.corners.grow();
        n.corner = new ChessboardCorner();
        n.corner.setTo(i * 5, 1);
    }
    Node n = alg.findClosest(10.1, 0.5);
    assertEquals(0, n.corner.distance(10, 1), UtilEjml.TEST_F64);
}
Also used : ChessboardCorner(boofcv.alg.feature.detect.chess.ChessboardCorner) Node(boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph.Node) Test(org.junit.jupiter.api.Test)

Aggregations

ChessboardCorner (boofcv.alg.feature.detect.chess.ChessboardCorner)18 Test (org.junit.jupiter.api.Test)9 Node (boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph.Node)8 DogArray (org.ddogleg.struct.DogArray)3 GrayU8 (boofcv.struct.image.GrayU8)2 ArrayList (java.util.ArrayList)2 ChessboardCornerClusterFinder (boofcv.alg.fiducial.calib.chess.ChessboardCornerClusterFinder)1 GridElement (boofcv.alg.fiducial.calib.chess.ChessboardCornerClusterToGrid.GridElement)1 GridInfo (boofcv.alg.fiducial.calib.chess.ChessboardCornerClusterToGrid.GridInfo)1 ChessboardCornerGraph (boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph)1 Transform (boofcv.alg.fiducial.calib.ecocheck.ECoCheckDetector.Transform)1 RenderCalibrationTargetsGraphics2D (boofcv.gui.RenderCalibrationTargetsGraphics2D)1 GrayF32 (boofcv.struct.image.GrayF32)1 Point2D_F32 (georegression.struct.point.Point2D_F32)1 AffineTransform (java.awt.geom.AffineTransform)1