use of boofcv.alg.fiducial.calib.squares.SquareEdge in project BoofCV by lessthanoptimal.
the class CommonDetectCalibrationApp method renderGraph.
protected void renderGraph(Graphics2D g2, double scale) {
List<List<SquareNode>> graphs = getClusters();
BasicStroke strokeWide = new BasicStroke(3);
BasicStroke strokeNarrow = new BasicStroke(2);
Line2D.Double l = new Line2D.Double();
g2.setStroke(new BasicStroke(3));
for (int i = 0; i < graphs.size(); i++) {
List<SquareNode> graph = graphs.get(i);
int key = graphs.size() == 1 ? 0 : 255 * i / (graphs.size() - 1);
int rgb = key << 8 | (255 - key);
g2.setColor(new Color(rgb));
List<SquareEdge> edges = new ArrayList<>();
for (SquareNode n : graph) {
for (int j = 0; j < n.edges.length; j++) {
if (n.edges[j] != null && !edges.contains(n.edges[j])) {
edges.add(n.edges[j]);
}
}
}
for (SquareEdge e : edges) {
Point2D_F64 a = e.a.center;
Point2D_F64 b = e.b.center;
l.setLine(a.x * scale, a.y * scale, b.x * scale, b.y * scale);
g2.setColor(Color.CYAN);
g2.setStroke(strokeWide);
g2.draw(l);
g2.setColor(new Color(rgb));
g2.setStroke(strokeNarrow);
g2.draw(l);
}
}
}
use of boofcv.alg.fiducial.calib.squares.SquareEdge in project BoofCV by lessthanoptimal.
the class TestQrCodeDecoderImage method connect.
private static void connect(PositionPatternNode a, PositionPatternNode b, int sideA, int sideB) {
SquareEdge e = new SquareEdge(a, b, 3, 1);
a.edges[sideA] = b.edges[sideB] = e;
}
Aggregations