use of boofcv.alg.geo.calibration.CalibrationObservation in project BoofCV by lessthanoptimal.
the class DisplayFisheyeCalibrationPanel method drawFeatures.
private void drawFeatures(Graphics2D g2, double scale) {
if (results == null)
return;
g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
CalibrationObservation set = features;
Point2D_F32 adj = new Point2D_F32();
if (showOrder) {
renderOrder(g2, scale, (List) set.points);
}
if (showPoints) {
g2.setColor(Color.BLACK);
g2.setStroke(new BasicStroke(3));
for (PointIndex2D_F64 p : set.points) {
adj.set((float) p.x, (float) p.y);
VisualizeFeatures.drawCross(g2, adj.x * scale, adj.y * scale, 4);
}
g2.setStroke(new BasicStroke(1));
g2.setColor(Color.RED);
for (PointIndex2D_F64 p : set.points) {
adj.set((float) p.x, (float) p.y);
VisualizeFeatures.drawCross(g2, adj.x * scale, adj.y * scale, 4);
}
}
if (showAll) {
for (CalibrationObservation l : allFeatures) {
for (PointIndex2D_F64 p : l.points) {
adj.set((float) p.x, (float) p.y);
VisualizeFeatures.drawPoint(g2, adj.x * scale, adj.y * scale, 2, Color.BLUE, false);
}
}
}
if (showNumbers) {
drawNumbers(g2, set, null, scale);
}
if (showErrors) {
g2.setStroke(new BasicStroke(4));
g2.setColor(Color.BLACK);
for (int i = 0; i < set.size(); i++) {
PointIndex2D_F64 p = set.get(i);
adj.set((float) p.x, (float) p.y);
double r = errorScale * results.pointError[i];
if (r < 1)
continue;
VisualizeFeatures.drawCircle(g2, adj.x * scale, adj.y * scale, r);
}
g2.setStroke(new BasicStroke(2.5f));
g2.setColor(Color.ORANGE);
for (int i = 0; i < set.size(); i++) {
PointIndex2D_F64 p = set.get(i);
adj.set((float) p.x, (float) p.y);
double r = errorScale * results.pointError[i];
if (r < 1)
continue;
VisualizeFeatures.drawCircle(g2, adj.x * scale, adj.y * scale, r);
}
}
}
Aggregations