Search in sources :

Example 6 with RenderCalibrationTargetsGraphics2D

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

the class CameraCalibrationGui method calibrationParametersChanged.

@Override
public void calibrationParametersChanged(CalibrationTargetPanel.TargetType type, Object _config) {
    final RenderCalibrationTargetsGraphics2D renderer = new RenderCalibrationTargetsGraphics2D(20, 1);
    if (type == CalibrationTargetPanel.TargetType.CHESSBOARD) {
        ConfigChessboard chess = (ConfigChessboard) _config;
        renderer.chessboard(chess.numRows, chess.numCols, 20);
    } else if (type == CalibrationTargetPanel.TargetType.SQUARE_GRID) {
        ConfigSquareGrid config = (ConfigSquareGrid) _config;
        double space = 20 * config.spaceWidth / config.squareWidth;
        renderer.squareGrid(config.numRows, config.numCols, 20, space);
    } else if (type == CalibrationTargetPanel.TargetType.CIRCLE_GRID) {
        ConfigCircleRegularGrid config = (ConfigCircleRegularGrid) _config;
        double space = 10 * config.centerDistance / config.circleDiameter;
        renderer.circleRegular(config.numRows, config.numCols, 10, space);
    } else if (type == CalibrationTargetPanel.TargetType.CIRCLE_HEX) {
        ConfigCircleHexagonalGrid config = (ConfigCircleHexagonalGrid) _config;
        double space = 10 * config.centerDistance / config.circleDiameter;
        renderer.circleHex(config.numRows, config.numCols, 10, space);
    }
    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)

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