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));
}
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));
}
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());
}
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));
}
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));
}
Aggregations