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);
}
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);
}
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);
}
Aggregations