Search in sources :

Example 1 with RenderCalibrationTargetsGraphics2D

use of boofcv.gui.RenderCalibrationTargetsGraphics2D in project BoofCV by lessthanoptimal.

the class TestCalibrationDetectorCircleHexagonalGrid method renderTarget.

@Override
public void renderTarget(Object layout, double length3D, GrayF32 image, List<Point2D_F64> points2D) {
    ConfigCircleHexagonalGrid config = (ConfigCircleHexagonalGrid) layout;
    RenderCalibrationTargetsGraphics2D renderer = new RenderCalibrationTargetsGraphics2D(30, 1);
    double radiusPixels = 20;
    double centerDistancePixels = 2 * radiusPixels * config.centerDistance / config.circleDiameter;
    renderer.circleHex(config.numRows, config.numCols, radiusPixels * 2, centerDistancePixels);
    // ShowImages.showWindow(renderer.getBufferred(),"Rendered",true);
    // BoofMiscOps.sleep(100000);
    image.setTo(renderer.getGrayF32());
    double centerDistanceWorld = length3D * centerDistancePixels / (double) image.getWidth();
    points2D.clear();
    points2D.addAll(createLayout(config.numRows, config.numCols, centerDistanceWorld));
}
Also used : RenderCalibrationTargetsGraphics2D(boofcv.gui.RenderCalibrationTargetsGraphics2D)

Example 2 with RenderCalibrationTargetsGraphics2D

use of boofcv.gui.RenderCalibrationTargetsGraphics2D in project BoofCV by lessthanoptimal.

the class TestCalibrationDetectorCircleRegularGrid method renderTarget.

@Override
public void renderTarget(Object layout, double length3D, GrayF32 image, List<Point2D_F64> points2D) {
    ConfigCircleRegularGrid config = (ConfigCircleRegularGrid) layout;
    RenderCalibrationTargetsGraphics2D renderer = new RenderCalibrationTargetsGraphics2D(40, 1);
    double radiusPixels = 20;
    double centerDistancePixels = 2 * radiusPixels * config.centerDistance / config.circleDiameter;
    renderer.circleRegular(config.numRows, config.numCols, radiusPixels * 2, centerDistancePixels);
    // ShowImages.showWindow(renderer.getBufferred(),"Rendered",true);
    // BoofMiscOps.sleep(100000);
    image.setTo(renderer.getGrayF32());
    double centerDistanceWorld = length3D * centerDistancePixels / (double) image.getWidth();
    double radiusWorld = length3D * radiusPixels / (double) image.getWidth();
    points2D.clear();
    points2D.addAll(CalibrationDetectorCircleRegularGrid.createLayout(config.numRows, config.numCols, centerDistanceWorld, radiusWorld * 2));
}
Also used : RenderCalibrationTargetsGraphics2D(boofcv.gui.RenderCalibrationTargetsGraphics2D)

Example 3 with RenderCalibrationTargetsGraphics2D

use of boofcv.gui.RenderCalibrationTargetsGraphics2D in project BoofCV by lessthanoptimal.

the class CreateCalibrationTargetGui method updatePreview.

private void updatePreview() {
    double paperWidth = paper.unit.convert(paper.width, units);
    double paperHeight = paper.unit.convert(paper.height, units);
    final RenderCalibrationTargetsGraphics2D renderer = new RenderCalibrationTargetsGraphics2D(-1, 400 / paperWidth);
    renderer.setPaperSize(paperWidth, paperHeight);
    if (selectedType == CalibrationTargetPanel.TargetType.CHESSBOARD) {
        ConfigChessboard config = (ConfigChessboard) selectedCalib;
        renderer.chessboard(config.numRows, config.numCols, config.squareWidth);
    } else if (selectedType == CalibrationTargetPanel.TargetType.SQUARE_GRID) {
        ConfigSquareGrid config = (ConfigSquareGrid) selectedCalib;
        renderer.squareGrid(config.numRows, config.numCols, config.squareWidth, config.spaceWidth);
    } else if (selectedType == CalibrationTargetPanel.TargetType.CIRCLE_GRID) {
        ConfigCircleRegularGrid config = (ConfigCircleRegularGrid) selectedCalib;
        renderer.circleRegular(config.numRows, config.numCols, config.circleDiameter, config.centerDistance);
    } else if (selectedType == CalibrationTargetPanel.TargetType.CIRCLE_HEX) {
        ConfigCircleHexagonalGrid config = (ConfigCircleHexagonalGrid) selectedCalib;
        renderer.circleHex(config.numRows, config.numCols, config.circleDiameter, config.centerDistance);
    }
    renderingPanel.setImageUI(renderer.getBufferred());
}
Also used : ConfigSquareGrid(boofcv.abst.fiducial.calib.ConfigSquareGrid) RenderCalibrationTargetsGraphics2D(boofcv.gui.RenderCalibrationTargetsGraphics2D) ConfigCircleHexagonalGrid(boofcv.abst.fiducial.calib.ConfigCircleHexagonalGrid) ConfigChessboard(boofcv.abst.fiducial.calib.ConfigChessboard) ConfigCircleRegularGrid(boofcv.abst.fiducial.calib.ConfigCircleRegularGrid)

Example 4 with RenderCalibrationTargetsGraphics2D

use of boofcv.gui.RenderCalibrationTargetsGraphics2D in project BoofCV by lessthanoptimal.

the class TestCalibrationDetectorChessboard method renderTarget.

@Override
public void renderTarget(Object layout, double length3D, GrayF32 image, List<Point2D_F64> points2D) {
    ConfigChessboard config = (ConfigChessboard) layout;
    RenderCalibrationTargetsGraphics2D renderer = new RenderCalibrationTargetsGraphics2D(40, 1);
    renderer.chessboard(config.numRows, config.numCols, 40);
    // ShowImages.showWindow(renderer.getBufferred(),"Rendered",true);
    // BoofMiscOps.sleep(100000);
    image.setTo(renderer.getGrayF32());
    double lengthPattern = length3D * config.numCols / (config.numCols + 2);
    points2D.clear();
    points2D.addAll(gridChess(config.numRows, config.numCols, lengthPattern / config.numCols));
}
Also used : RenderCalibrationTargetsGraphics2D(boofcv.gui.RenderCalibrationTargetsGraphics2D)

Example 5 with RenderCalibrationTargetsGraphics2D

use of boofcv.gui.RenderCalibrationTargetsGraphics2D in project BoofCV by lessthanoptimal.

the class TestCalibrationDetectorSquareGrid method renderTarget.

@Override
public void renderTarget(Object layout, double length3D, GrayF32 image, List<Point2D_F64> points2D) {
    ConfigSquareGrid config = (ConfigSquareGrid) layout;
    double squareWidthPixels = 20;
    double spacingPixels = squareWidthPixels * (config.spaceWidth / config.squareWidth);
    RenderCalibrationTargetsGraphics2D renderer = new RenderCalibrationTargetsGraphics2D(20, 1);
    renderer.squareGrid(config.numRows, config.numCols, squareWidthPixels, spacingPixels);
    image.setTo(renderer.getGrayF32());
    double squareWidthWorld = length3D * squareWidthPixels / (double) image.getWidth();
    double spacingWorld = length3D * spacingPixels / (double) image.getWidth();
    points2D.clear();
    points2D.addAll(CalibrationDetectorSquareGrid.createLayout(config.numRows, config.numCols, squareWidthWorld, spacingWorld));
}
Also used : RenderCalibrationTargetsGraphics2D(boofcv.gui.RenderCalibrationTargetsGraphics2D)

Aggregations

RenderCalibrationTargetsGraphics2D (boofcv.gui.RenderCalibrationTargetsGraphics2D)6 ConfigChessboard (boofcv.abst.fiducial.calib.ConfigChessboard)2 ConfigCircleHexagonalGrid (boofcv.abst.fiducial.calib.ConfigCircleHexagonalGrid)2 ConfigCircleRegularGrid (boofcv.abst.fiducial.calib.ConfigCircleRegularGrid)2 ConfigSquareGrid (boofcv.abst.fiducial.calib.ConfigSquareGrid)2