use of boofcv.struct.geo.PointIndex2D_F64 in project BoofCV by lessthanoptimal.
the class AssistedCalibration method renderCalibrationPoints.
private void renderCalibrationPoints(double stationaryTime, List<PointIndex2D_F64> points) {
int shade = Math.min(255, (int) (255.0 * (stationaryTime / STILL_THRESHOLD)));
if (pictureTaken) {
g2.setColor(new Color(0, shade, 0));
} else {
g2.setColor(new Color(shade, 0, Math.max(0, 255 - shade * 2)));
}
int r = 6;
int w = 2 * r;
for (int i = 0; i < points.size(); i++) {
PointIndex2D_F64 p = points.get(i);
ellipse.setFrame(p.x - r, p.y - r, w, w);
g2.fill(ellipse);
}
}
use of boofcv.struct.geo.PointIndex2D_F64 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);
}
}
}
use of boofcv.struct.geo.PointIndex2D_F64 in project BoofCV by lessthanoptimal.
the class FiducialDetectorPnP method createDetectedList.
/**
* Create the list of observed points in 2D3D
*/
private void createDetectedList(int which, List<PointIndex2D_F64> pixels) {
detected2D3D.clear();
List<Point2D3D> all = getControl3D(which);
for (int i = 0; i < pixels.size(); i++) {
PointIndex2D_F64 a = pixels.get(i);
Point2D3D b = all.get(i);
pixelToNorm.compute(a.x, a.y, b.observation);
detected2D3D.add(b);
}
}
Aggregations