/** * Detector for a grid of binary targets. Allows for squares to be obscured or partially outside of the * image. * * @see CalibrationDetectorSquareFiducialGrid * * @param config Configuration of binary target * @return Detector for binary grid target */ public static CalibrationDetectorSquareFiducialGrid binaryGrid(ConfigSquareGridBinary config ) { config.checkValidity(); return new CalibrationDetectorSquareFiducialGrid(config); }
@Override public boolean process(GrayF32 input) { observations = new CalibrationObservation(); if( !detector.detect(input) ) { return false; } List<DetectFiducialSquareGrid.Detection> detections = detector.getDetections(); for (int i = 0; i < detections.size(); i++) { DetectFiducialSquareGrid.Detection d = detections.get(i); int row = d.gridIndex/numCols; int col = d.gridIndex%numCols; int pointRow = row*2; int pointCol = col*2; observations.add(d.location.a,getPointIndex(pointRow, pointCol)); observations.add(d.location.b,getPointIndex(pointRow, pointCol+1)); observations.add(d.location.c,getPointIndex(pointRow+1, pointCol+1)); observations.add(d.location.d,getPointIndex(pointRow+1, pointCol)); } observations.sort(); return true; }