private static ConfigSiftDetector confDetectSift() { ConfigSiftDetector conf = new ConfigSiftDetector(); conf.extract.radius = 3; conf.extract.threshold = 2; conf.maxFeaturesPerScale = 120; return conf; }
@Override public void checkValidity() { scaleSpace.checkValidity(); detector.checkValidity(); orientation.checkValidity(); describe.checkValidity(); } }
/** * Creates a configuration similar to how it was originally described in the paper */ public static ConfigCompleteSift createPaper() { ConfigCompleteSift config = new ConfigCompleteSift(); config.scaleSpace = ConfigSiftScaleSpace.createPaper(); config.detector = ConfigSiftDetector.createPaper(); config.orientation = ConfigSiftOrientation.createPaper(); return config; }
/** * Creates a configuration similar to how it was originally described in the paper */ public static ConfigSiftDetector createPaper() { ConfigSiftDetector config = new ConfigSiftDetector(); config.extract = new ConfigExtract(1,0,1,true,true,true); config.extract.ignoreBorder = 1; config.maxFeaturesPerScale = 0; config.edgeR = 10; return config; }
private void setSelection( int which ) { InterestPointDetector<GrayU8> detector; switch( which ) { case 0: detector = FactoryInterestPoint.fastHessian(new ConfigFastHessian(10,3,100,2,9,4,4)); break; case 1: ConfigSiftDetector configSift = new ConfigSiftDetector(200); detector = FactoryInterestPoint.sift(null, configSift, GrayU8.class); break; default: throw new RuntimeException("Unknown selection"); } setProcessing(new PointProcessing(detector)); }
/** * Creates a SIFT detector */ public static SiftDetector sift(ConfigSiftScaleSpace configSS , ConfigSiftDetector configDetector ) { if( configSS == null ) configSS = new ConfigSiftScaleSpace(); if( configDetector == null ) configDetector = new ConfigSiftDetector(); NonMaxLimiter nonmax = FactoryFeatureExtractor.nonmaxLimiter( configDetector.extract,configDetector.maxFeaturesPerScale); SiftScaleSpace ss = new SiftScaleSpace(configSS.firstOctave,configSS.lastOctave, configSS.numScales,configSS.sigma0); return new SiftDetector(ss,configDetector.edgeR,nonmax); } }
public DetectPointScaleOriWithNoiseApp(Class<T> imageType, Class<D> derivType) { super(1); this.imageType = imageType; FeatureLaplacePyramid<T, D> flss = FactoryInterestPointAlgs.hessianLaplace(radius, thresh, maxScaleFeatures, imageType, derivType); addAlgorithm(0, "Hess Lap SS", FactoryInterestPoint.wrapDetector(flss, scales, false, imageType)); FeatureLaplacePyramid<T, D> flp = FactoryInterestPointAlgs.hessianLaplace(radius, thresh, maxScaleFeatures, imageType, derivType); addAlgorithm(0, "Hess Lap P", FactoryInterestPoint.wrapDetector(flp, scales, true,imageType)); addAlgorithm(0, "FastHessian", FactoryInterestPoint.<T>fastHessian( new ConfigFastHessian(thresh, 2, maxScaleFeatures, 2, 9, 4, 4))); addAlgorithm(0, "SIFT", FactoryInterestPoint.sift(null,new ConfigSiftDetector(2*maxScaleFeatures),imageType)); JPanel viewArea = new JPanel(new BorderLayout()); corruptPanel = new ImageCorruptPanel(); corruptPanel.setListener(this); panel = new ImagePanel(); viewArea.add(corruptPanel, BorderLayout.WEST); viewArea.add(panel, BorderLayout.CENTER); setMainGUI(viewArea); }
public static <T extends ImageGray> InterestPointDetector<T> sift(ConfigSiftScaleSpace configSS , ConfigSiftDetector configDet , Class<T> imageType ) { if( configSS == null ) configSS = new ConfigSiftScaleSpace(); if( configDet == null ) configDet = new ConfigSiftDetector(); SiftScaleSpace scaleSpace = new SiftScaleSpace(configSS.firstOctave,configSS.lastOctave,configSS.numScales,configSS.sigma0); NonMaxSuppression nonmax = FactoryFeatureExtractor.nonmax(configDet.extract); NonMaxLimiter limiter = new NonMaxLimiter(nonmax,configDet.maxFeaturesPerScale); SiftDetector detector = new SiftDetector(scaleSpace,configDet.edgeR,limiter); return new WrapSiftDetector<>(detector, imageType); } }
/** * Detects key points inside the image and computes descriptions at those points. */ protected double[][] extractFeaturesInternal(BufferedImage image) { ImageFloat32 boofcvImage = ConvertBufferedImage.convertFromSingle(image, null, ImageFloat32.class); // create the SIFT detector and descriptor in BoofCV v0.15 ConfigSiftDetector conf = new ConfigSiftDetector(2, detectThreshold, maxFeaturesPerScale, 5); DetectDescribePoint<ImageFloat32, SurfFeature> sift = FactoryDetectDescribe.sift(null, conf, null, null); // specify the image to process sift.detect(boofcvImage); int numPoints = sift.getNumberOfFeatures(); double[][] descriptions = new double[numPoints][SIFTLength]; for (int i = 0; i < numPoints; i++) { descriptions[i] = sift.getDescription(i).getValue(); } return descriptions; } }
public VisualizeAssociationScoreApp(Class<T> imageType, Class<D> derivType) { super(2); this.imageType = imageType; imageLeft = GeneralizedImageOps.createSingleBand(imageType, 1, 1); imageRight = GeneralizedImageOps.createSingleBand(imageType, 1, 1); GeneralFeatureDetector<T, D> alg; addAlgorithm(0, "Fast Hessian", FactoryInterestPoint.fastHessian(new ConfigFastHessian(1, 2, 200, 1, 9, 4, 4))); addAlgorithm(0, "SIFT", FactoryInterestPoint.sift(null,new ConfigSiftDetector(500),imageType)); alg = FactoryDetectPoint.createShiTomasi(new ConfigGeneralDetector(500,2,1), false, derivType); addAlgorithm(0, "Shi-Tomasi", FactoryInterestPoint.wrapPoint(alg, 1, imageType, derivType)); addAlgorithm(1, "SURF", FactoryDescribeRegionPoint.surfStable(null, imageType)); addAlgorithm(1, "SIFT", FactoryDescribeRegionPoint.sift(null,null, imageType)); addAlgorithm(1, "BRIEF", FactoryDescribeRegionPoint.brief(new ConfigBrief(true), imageType)); addAlgorithm(1, "BRIEFO", FactoryDescribeRegionPoint.brief(new ConfigBrief(false), imageType)); addAlgorithm(1, "Pixel 11x11", FactoryDescribeRegionPoint.pixel(11, 11, imageType)); addAlgorithm(1, "NCC 11x11", FactoryDescribeRegionPoint.pixelNCC(11, 11, imageType)); // estimate orientation using this once since it is fast Class integralType = GIntegralImageOps.getIntegralType(imageType); OrientationIntegral orientationII = FactoryOrientationAlgs.sliding_ii(null, integralType); orientation = FactoryOrientation.convertImage(orientationII, imageType); controlPanel = new VisualizeScorePanel(this); scorePanel = new AssociationScorePanel<>(3); JPanel gui = new JPanel(); gui.setLayout(new BorderLayout()); gui.add(controlPanel, BorderLayout.WEST); gui.add(scorePanel, BorderLayout.CENTER); setMainGUI(gui); }
public VisualizeAssociationMatchesApp(Class<T> imageType, Class<D> derivType) { super(3); this.imageType = imageType; GeneralFeatureDetector<T, D> alg; addAlgorithm(0, "Fast Hessian",FactoryInterestPoint.fastHessian(new ConfigFastHessian( 1, 2, 200, 1, 9, 4, 4))); addAlgorithm(0, "SIFT", FactoryInterestPoint.sift(null,new ConfigSiftDetector(400),imageType)); alg = FactoryDetectPoint.createShiTomasi(new ConfigGeneralDetector(500,2,1), false, derivType); addAlgorithm(0, "Shi-Tomasi", FactoryInterestPoint.wrapPoint(alg, 1, imageType, derivType)); addAlgorithm(1, "SURF-S", FactoryDescribeRegionPoint.surfStable(null, imageType)); addAlgorithm(1, "SURF-S Color", FactoryDescribeRegionPoint.surfColorStable(null, ImageType.pl(3, imageType))); addAlgorithm(1, "SIFT", FactoryDescribeRegionPoint.sift(null,null,imageType)); addAlgorithm(1, "BRIEF", FactoryDescribeRegionPoint.brief(new ConfigBrief(true), imageType)); addAlgorithm(1, "BRIEFSO", FactoryDescribeRegionPoint.brief(new ConfigBrief(false), imageType)); addAlgorithm(1, "Pixel 11x11", FactoryDescribeRegionPoint.pixel(11, 11, imageType)); addAlgorithm(1, "NCC 11x11", FactoryDescribeRegionPoint.pixelNCC(11, 11, imageType)); addAlgorithm(2, "Greedy", false); addAlgorithm(2, "Backwards", true); // estimate orientation using this once since it is fast and accurate Class integralType = GIntegralImageOps.getIntegralType(imageType); OrientationIntegral orientationII = FactoryOrientationAlgs.sliding_ii(null, integralType); orientation = FactoryOrientation.convertImage(orientationII,imageType); imageLeft = new Planar<>(imageType, 1, 1, 3); imageRight = new Planar<>(imageType, 1, 1, 3); grayLeft = GeneralizedImageOps.createSingleBand(imageType, 1, 1); grayRight = GeneralizedImageOps.createSingleBand(imageType, 1, 1); setMainGUI(panel); }