use of boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid 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.EllipseClustersIntoGrid.Grid 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);
}
}
}
}
use of boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid in project BoofCV by lessthanoptimal.
the class CalibrationDetectorCircleHexagonalGrid method process.
@Override
public boolean process(GrayF32 input) {
results = new CalibrationObservation(input.width, input.height);
detector.process(input);
List<Grid> grids = detector.getGrids();
if (grids.size() != 1)
return false;
if (!keypoint.process(grids.get(0)))
return false;
FastQueue<Point2D_F64> foundPixels = keypoint.getKeyPoints();
for (int i = 0; i < foundPixels.size; i++) {
results.add(foundPixels.get(i), i);
}
return true;
}
use of boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid in project BoofCV by lessthanoptimal.
the class CalibrationDetectorCircleRegularGrid method process.
@Override
public boolean process(GrayF32 input) {
results = new CalibrationObservation(input.width, input.height);
detector.process(input);
List<Grid> grids = detector.getGrids();
if (grids.size() != 1)
return false;
if (!keypoint.process(grids.get(0)))
return false;
FastQueue<Point2D_F64> foundPixels = keypoint.getKeyPoints();
for (int i = 0; i < foundPixels.size; i++) {
results.add(foundPixels.get(i), i);
}
return true;
}
use of boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid in project BoofCV by lessthanoptimal.
the class TestDetectCircleGrid method closestCorner4.
@Test
public void closestCorner4() {
Grid g = new Grid();
g.rows = 3;
g.columns = 3;
g.ellipses.add(new EllipseRotated_F64(20, 20, 0, 0, 0));
g.ellipses.add(null);
g.ellipses.add(new EllipseRotated_F64(20, 100, 0, 0, 0));
g.ellipses.add(null);
g.ellipses.add(new EllipseRotated_F64());
g.ellipses.add(null);
g.ellipses.add(new EllipseRotated_F64(100, 20, 0, 0, 0));
g.ellipses.add(null);
g.ellipses.add(new EllipseRotated_F64(100, 100, 0, 0, 0));
assertEquals(0, DetectCircleGrid.closestCorner4(g));
g.ellipses.get(0).center.set(20, 100);
g.ellipses.get(2).center.set(100, 20);
g.ellipses.get(6).center.set(100, 100);
g.ellipses.get(8).center.set(20, 20);
assertEquals(2, DetectCircleGrid.closestCorner4(g));
g.ellipses.get(0).center.set(100, 20);
g.ellipses.get(2).center.set(100, 100);
g.ellipses.get(6).center.set(20, 20);
g.ellipses.get(8).center.set(20, 100);
assertEquals(1, DetectCircleGrid.closestCorner4(g));
g.ellipses.get(0).center.set(100, 100);
g.ellipses.get(2).center.set(20, 20);
g.ellipses.get(6).center.set(20, 100);
g.ellipses.get(8).center.set(100, 20);
assertEquals(3, DetectCircleGrid.closestCorner4(g));
}
Aggregations