if( !target.process(gray) ) throw new RuntimeException("Failed to detect target"); Zhang99ComputeTargetHomography computeH = new Zhang99ComputeTargetHomography(target.getLayout()); Zhang99DecomposeHomography decomposeH = new Zhang99DecomposeHomography(); if( !computeH.computeHomography(target.getDetectedPoints()) ) throw new RuntimeException("Can't compute homography"); CalibrationObservation calibrationObservation = target.getDetectedPoints();
/** * Detector for chessboard targets. Squares can be partially outside, but inside corners must be entirely * inside the image. * * @see DetectChessboardFiducial * * @param config Configuration for chessboard detector * @return Square grid target detector. */ public static CalibrationDetectorChessboard chessboard(ConfigChessboard config ) { config.checkValidity(); return new CalibrationDetectorChessboard(config); }
@Override public void declareDetector() { config.thresholding = ((DetectCalibrationPolygonPanel)controlPanel).polygonPanel.thresholdPanel.createConfig(); config.square = ((DetectCalibrationPolygonPanel)controlPanel).polygonPanel.getConfigPolygon(); config.numRows = controlPanel.getGridRows(); config.numCols = controlPanel.getGridColumns(); alg = FactoryFiducialCalibration.chessboard(config).getAlgorithm(); reprocessImageOnly(); }
public CalibrationDetectorChessboard(ConfigChessboard config) { RefineBinaryPolygon<GrayF32> refineLine = FactoryShapeDetector.refinePolygon(config.configRefineLines,GrayF32.class); RefineBinaryPolygon<GrayF32> refineCorner = config.refineWithCorners ? FactoryShapeDetector.refinePolygon(config.configRefineLines,GrayF32.class) : null; config.square.refine = null; BinaryPolygonDetector<GrayF32> detectorSquare = FactoryShapeDetector.polygon(config.square,GrayF32.class); InputToBinary<GrayF32> inputToBinary = FactoryThresholdBinary.threshold(config.thresholding,GrayF32.class); alg = new DetectChessboardFiducial<>( config.numRows, config.numCols, config.maximumCornerDistance,detectorSquare, refineLine,refineCorner,inputToBinary); layoutPoints = gridChess(config.numRows, config.numCols, config.squareWidth); }
DetectChessboardFiducial<GrayF32> alg = ((CalibrationDetectorChessboard) detector).getAlgorithm(); extractQuads(alg.getFindSeeds().getDetectorSquare().getPolygons(null,null)); binary = alg.getBinary();
Zhang99ComputeTargetHomography computeH = new Zhang99ComputeTargetHomography(target.getLayout()); if( !detector.process(gray) ) return null; gui.addCalibPoints( detector.getDetectedPoints().points ); if( !computeH.computeHomography(detector.getDetectedPoints()) ) throw new RuntimeException("Can't compute homography");
DetectorFiducialCalibration a = ((CalibrationFiducialDetector) detector).getCalibDetector(); if (a instanceof CalibrationDetectorChessboard) { binary = ((CalibrationDetectorChessboard) a).getAlgorithm().getBinary(); } else if( a instanceof CalibrationDetectorSquareGrid ){ binary = ((CalibrationDetectorSquareGrid) a).getAlgorithm().getBinary();
Zhang99ComputeTargetHomography computeH = new Zhang99ComputeTargetHomography(target.getLayout()); if( !detector.process(gray) ) return null; gui.addCalibPoints( detector.getDetectedPoints().points ); if( !computeH.computeHomography(detector.getDetectedPoints()) ) throw new RuntimeException("Can't compute homography");