Search in sources :

Example 6 with SquareGrid

use of boofcv.alg.fiducial.calib.squares.SquareGrid in project BoofCV by lessthanoptimal.

the class CommonDetectCalibrationApp method renderGrid.

protected void renderGrid(Graphics2D g2, double scale) {
    List<SquareGrid> grids = getGrids();
    for (int i = 0; i < grids.size(); i++) {
        SquareGrid g = grids.get(i);
        int a = grids.size() == 1 ? 0 : 255 * i / (grids.size() - 1);
        int rgb = a << 16 | (255 - a) << 8;
        g2.setStroke(new BasicStroke(3));
        Color color = new Color(rgb);
        for (int j = 0; j < g.nodes.size(); j++) {
            SquareNode n = g.nodes.get(j);
            if (n == null)
                continue;
            g2.setColor(color);
            VisualizeShapes.drawPolygon(n.square, true, scale, g2);
            drawCornersInside(g2, scale, n.square);
        }
    }
}
Also used : SquareGrid(boofcv.alg.fiducial.calib.squares.SquareGrid) SquareNode(boofcv.alg.fiducial.calib.squares.SquareNode)

Aggregations

SquareGrid (boofcv.alg.fiducial.calib.squares.SquareGrid)6 Test (org.junit.Test)4 SquareGridTools (boofcv.alg.fiducial.calib.squares.SquareGridTools)2 SquareNode (boofcv.alg.fiducial.calib.squares.SquareNode)2 GrayU8 (boofcv.struct.image.GrayU8)2 Point2D_F64 (georegression.struct.point.Point2D_F64)2 TestSquareGridTools (boofcv.alg.fiducial.calib.squares.TestSquareGridTools)1