use of boofcv.alg.fiducial.calib.circle.KeyPointsCircleRegularGrid.Tangents in project BoofCV by lessthanoptimal.
the class TestKeyPointsCircleRegularGrid method vertical.
@Test
public void vertical() {
int numRows = 3, numCols = 4;
double space = 3, r = 1;
Grid g = createGrid(numRows, numCols, space, r);
KeyPointsCircleRegularGrid alg = new KeyPointsCircleRegularGrid();
alg.init(g);
assertTrue(alg.vertical(g));
for (int row = 0; row < numRows; row++) {
for (int col = 0; col < numCols; col++) {
Tangents t = alg.getTangents().get(row * numCols + col);
if (row == 0 || row == numRows - 1) {
assertEquals(1, t.countL);
assertEquals(1, t.countR);
} else {
assertEquals(2, t.countL);
assertEquals(2, t.countR);
}
}
}
}
use of boofcv.alg.fiducial.calib.circle.KeyPointsCircleRegularGrid.Tangents in project BoofCV by lessthanoptimal.
the class TestKeyPointsCircleRegularGrid method horizontal.
@Test
public void horizontal() {
int numRows = 3, numCols = 4;
double space = 3, r = 1;
Grid g = createGrid(numRows, numCols, space, r);
KeyPointsCircleRegularGrid alg = new KeyPointsCircleRegularGrid();
alg.init(g);
assertTrue(alg.horizontal(g));
for (int row = 0; row < numRows; row++) {
for (int col = 0; col < numCols; col++) {
Tangents t = alg.getTangents().get(row * numCols + col);
if (col == 0 || col == numCols - 1) {
assertEquals(1, t.countT);
assertEquals(1, t.countB);
} else {
assertEquals(2, t.countT);
assertEquals(2, t.countB);
}
}
}
}