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