Search in sources :

Example 11 with Node

use of boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph.Node 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 12 with Node

use of boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph.Node in project BoofCV by lessthanoptimal.

the class TestChessboardCornerGraph method node_putEdgesIntoList.

@Test
void node_putEdgesIntoList() {
    Node n = new Node();
    List<Node> found = new ArrayList<>();
    found.add(new Node());
    n.putEdgesIntoList(found);
    assertEquals(0, found.size());
    n.edges[1] = new Node();
    n.putEdgesIntoList(found);
    assertEquals(1, found.size());
}
Also used : Node(boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph.Node) ArrayList(java.util.ArrayList) Test(org.junit.jupiter.api.Test)

Example 13 with Node

use of boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph.Node 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 14 with Node

use of boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph.Node 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

Node (boofcv.alg.fiducial.calib.chess.ChessboardCornerGraph.Node)14 Test (org.junit.jupiter.api.Test)11 ChessboardCorner (boofcv.alg.feature.detect.chess.ChessboardCorner)8 DogArray (org.ddogleg.struct.DogArray)3 GridInfo (boofcv.alg.fiducial.calib.chess.ChessboardCornerClusterToGrid.GridInfo)2 ArrayList (java.util.ArrayList)1