Search in sources :

Example 1 with CalibrationDetectorChessboardX

use of boofcv.abst.fiducial.calib.CalibrationDetectorChessboardX in project BoofCV by lessthanoptimal.

the class DetectCalibrationChessboardXCornerApp method createAlgorithm.

private void createAlgorithm() {
    synchronized (lockAlgorithm) {
        configDetector.detPyramidTopSize = controlPanel.detPyramidTop;
        configDetector.detNonMaxRadius = controlPanel.detRadius;
        configDetector.detNonMaxThresholdRatio = controlPanel.detNonMaxThreshold / 100.0;
        configDetector.detRefinedXCornerThreshold = controlPanel.detRefinedXThresh;
        configDetector.connEdgeThreshold = controlPanel.connEdgeThreshold;
        configDetector.connOrientationTol = controlPanel.connOrientationTol;
        configDetector.connDirectionTol = controlPanel.connDirectionTol;
        configDetector.connAmbiguousTol = controlPanel.connAmbiguousTol;
        if (controlPanel.connMaxDistance == 0)
            configDetector.connMaxNeighborDistance = Double.MAX_VALUE;
        else
            configDetector.connMaxNeighborDistance = controlPanel.connMaxDistance;
        configGridDimen.numCols = controlPanel.gridCols;
        configGridDimen.numRows = controlPanel.gridRows;
        // check to see if it should be turned off. 0 is allowed, but we will set it to less than zero
        if (configDetector.connEdgeThreshold <= 0)
            configDetector.connEdgeThreshold = -1;
        detector = new CalibrationDetectorChessboardX(configDetector, configGridDimen);
        detector.getDetector().getDetector().useMeanShift = controlPanel.meanShift;
        if (controlPanel.anyGrid) {
            detector.getClusterToGrid().setCheckShape(null);
        }
    }
}
Also used : CalibrationDetectorChessboardX(boofcv.abst.fiducial.calib.CalibrationDetectorChessboardX)

Example 2 with CalibrationDetectorChessboardX

use of boofcv.abst.fiducial.calib.CalibrationDetectorChessboardX in project BoofCV by lessthanoptimal.

the class TestCreateCalibrationTarget method chessboard.

@Test
void chessboard() throws IOException {
    createDocument("-r 7 -c 5 -o target -t CHESSBOARD -u cm -w 3 -p LETTER");
    BufferedImage image = loadPDF();
    GrayF32 gray = new GrayF32(image.getWidth(), image.getHeight());
    ConvertBufferedImage.convertFrom(image, gray);
    CalibrationDetectorChessboardX detector = FactoryFiducialCalibration.chessboardX(null, new ConfigGridDimen(7, 5, 3));
    assertTrue(detector.process(gray));
}
Also used : ConfigGridDimen(boofcv.abst.fiducial.calib.ConfigGridDimen) CalibrationDetectorChessboardX(boofcv.abst.fiducial.calib.CalibrationDetectorChessboardX) GrayF32(boofcv.struct.image.GrayF32) BufferedImage(java.awt.image.BufferedImage) ConvertBufferedImage(boofcv.io.image.ConvertBufferedImage) Test(org.junit.jupiter.api.Test)

Aggregations

CalibrationDetectorChessboardX (boofcv.abst.fiducial.calib.CalibrationDetectorChessboardX)2 ConfigGridDimen (boofcv.abst.fiducial.calib.ConfigGridDimen)1 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)1 GrayF32 (boofcv.struct.image.GrayF32)1 BufferedImage (java.awt.image.BufferedImage)1 Test (org.junit.jupiter.api.Test)1