Search in sources :

Example 1 with Tangents

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);
            }
        }
    }
}
Also used : Tangents(boofcv.alg.fiducial.calib.circle.KeyPointsCircleRegularGrid.Tangents) Grid(boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid) Test(org.junit.Test)

Example 2 with Tangents

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);
            }
        }
    }
}
Also used : Tangents(boofcv.alg.fiducial.calib.circle.KeyPointsCircleRegularGrid.Tangents) Grid(boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid) Test(org.junit.Test)

Aggregations

Grid (boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid)2 Tangents (boofcv.alg.fiducial.calib.circle.KeyPointsCircleRegularGrid.Tangents)2 Test (org.junit.Test)2