Search in sources :

Example 16 with CalibrationObservation

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);
        }
    }
}
Also used : PointIndex2D_F64(boofcv.struct.geo.PointIndex2D_F64) Point2D_F32(georegression.struct.point.Point2D_F32) CalibrationObservation(boofcv.alg.geo.calibration.CalibrationObservation)

Aggregations

CalibrationObservation (boofcv.alg.geo.calibration.CalibrationObservation)16 Point2D_F64 (georegression.struct.point.Point2D_F64)6 PointIndex2D_F64 (boofcv.struct.geo.PointIndex2D_F64)5 GrayF32 (boofcv.struct.image.GrayF32)5 DetectorFiducialCalibration (boofcv.abst.geo.calibration.DetectorFiducialCalibration)3 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)3 BufferedImage (java.awt.image.BufferedImage)3 Grid (boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid)2 StereoParameters (boofcv.struct.calib.StereoParameters)2 Point2D_F32 (georegression.struct.point.Point2D_F32)2 Point3D_F64 (georegression.struct.point.Point3D_F64)2 Se3_F64 (georegression.struct.se.Se3_F64)2 Test (org.junit.Test)2 ConfigChessboard (boofcv.abst.fiducial.calib.ConfigChessboard)1 CalibrateStereoPlanar (boofcv.abst.geo.calibration.CalibrateStereoPlanar)1 DetectFiducialSquareGrid (boofcv.alg.fiducial.calib.DetectFiducialSquareGrid)1 DetectCircleHexagonalGrid (boofcv.alg.fiducial.calib.circle.DetectCircleHexagonalGrid)1 DetectCircleRegularGrid (boofcv.alg.fiducial.calib.circle.DetectCircleRegularGrid)1 KeyPointsCircleHexagonalGrid (boofcv.alg.fiducial.calib.circle.KeyPointsCircleHexagonalGrid)1 KeyPointsCircleRegularGrid (boofcv.alg.fiducial.calib.circle.KeyPointsCircleRegularGrid)1