/** * Detector for a grid of square targets. All squares must be entirely visible inside the image. * * @see boofcv.alg.fiducial.calib.grid.DetectSquareGridFiducial * * @param config Configuration for chessboard detector * @return Square grid target detector. */ public static CalibrationDetectorSquareGrid squareGrid(ConfigSquareGrid config) { config.checkValidity(); return new CalibrationDetectorSquareGrid(config); }
public DetectCalibrationSquareGridApp(int numRows , int numColumns , double squareWidth, double spaceWidth, boolean forCalibration , List<String> exampleInputs) { super(exampleInputs); config = new ConfigSquareGrid(numRows, numColumns, squareWidth,spaceWidth); setUpGui(new DetectCalibrationPolygonPanel(numRows,numColumns,config.square,config.thresholding)); declareDetector(); }
detector = FactoryFiducial.calibChessboard(new ConfigChessboard(7, 5, 0.03), imageClass); } else if( name.compareTo(CALIB_SQUARE_GRID) == 0 ) { detector = FactoryFiducial.calibSquareGrid(new ConfigSquareGrid(4, 3, 0.03, 0.03), imageClass); } else if( name.compareTo(CALIB_SQUARE_BINARY_GRID) == 0 ) { File configFile = new File(path,"description_4x3_3x3_4cm_2cm.txt");
protected void parseTarget( String where ) throws FileNotFoundException { Reader input = media.openFile(where); SimpleStringNumberReader reader = new SimpleStringNumberReader('#'); if( !reader.read(input) ) throw new RuntimeException("Parsing configuration failed"); if( reader.remainingTokens() < 7 ) throw new RuntimeException("Not enough tokens in config file"); String type = reader.nextString(); numRadial = (int)reader.nextDouble(); includeTangential = Boolean.parseBoolean(reader.nextString()); assumeZeroSkew = Boolean.parseBoolean(reader.nextString()); int numCols = (int)reader.nextDouble(); int numRows = (int)reader.nextDouble(); double width = reader.nextDouble(); if( type.compareToIgnoreCase("square") == 0 ) { double space = reader.nextDouble(); detector = FactoryFiducialCalibration.squareGrid(new ConfigSquareGrid(numRows, numCols, width, space)); } else if( type.compareToIgnoreCase("chess") == 0 ) { detector = FactoryFiducialCalibration.chessboard(new ConfigChessboard(numRows, numCols, width)); } else { throw new RuntimeException("Unknown type: "+type); } try { input.close(); } catch (IOException e) {} }