@Override public boolean hasOrientation() { if( orientation == null ) return detector.hasOrientation(); return true; } }
private static ConfigGeneralDetector confCorner() { ConfigGeneralDetector conf = new ConfigGeneralDetector(); conf.radius = 3; conf.threshold = 20; conf.maxFeatures = 150; return conf; }
@Override public Point2D_F64 getLocation(int featureIndex) { return detector.getLocation(featureIndex); }
public ArrayList<ConvexPolygon2d> detectConeLocations(BufferedImage image) { ImageFloat32 input = ConvertBufferedImage.convertFromSingle(image, null, ImageFloat32.class); // Create a Fast Hessian detector from the SURF paper. // Other detectors can be used in this example too. InterestPointDetector<ImageFloat32> detector = FactoryInterestPoint.fastHessian(new ConfigFastHessian(10, 2, 100, 2, 9, 3, 4)); // find interest points in the image detector.detect(input); // Show the features return new ArrayList<ConvexPolygon2d>(); }
@Override public double getOrientation(int featureIndex) { if( orientation == null ) return detector.getOrientation(featureIndex); Point2D_F64 p = detector.getLocation(featureIndex); orientation.setObjectRadius(getRadius(featureIndex)); return orientation.compute(p.x,p.y); }
private static ConfigFastHessian confDetectFH() { ConfigFastHessian conf = new ConfigFastHessian(); conf.initialSampleSize = 2; conf.extractRadius = 2; conf.maxFeaturesPerScale = 120; return conf; }
@Override public void process(GrayU8 gray) { detector.process(gray); synchronized (lockGui) { maximumsGUI.reset(); minimumsGUI.reset(); if( detector.totalSets() == 1 ) { maximumsGUI.addAll(detector.getPointSet(0)); } else { minimumsGUI.addAll(detector.getPointSet(0)); maximumsGUI.addAll(detector.getPointSet(1)); } } } }
@Override public void processFrame(T image) { detector.detect(image); }
private static ConfigSiftDetector confDetectSift() { ConfigSiftDetector conf = new ConfigSiftDetector(); conf.extract.radius = 3; conf.extract.threshold = 2; conf.maxFeaturesPerScale = 120; return conf; }
private void changeDetector(GeneralFeatureDetector fd) { detector = new GeneralToPointDetector(fd,imageClass, derivClass); sets.clear(); for (int i = 0; i < detector.totalSets(); i++) { sets.add( new QueueCorner()); } }
@Override public int getNumberOfFeatures() { return detector.getNumberOfFeatures(); }
@Override public double getRadius(int featureIndex) { return detector.getRadius(featureIndex); }
@Override public boolean hasScale() { return detector.hasScale(); }
public GeneralToInterestMulti(GeneralFeatureDetector<T, D> detector, double radius, Class<T> imageType, Class<D> derivType) { this.detector = new EasyGeneralFeatureDetector<>(detector, imageType, derivType); this.radius = radius; if( detector.isDetectMinimums() && detector.isDetectMaximums()) { sets = new FoundPointSO[]{new FoundMin(), new FoundMax()}; } else if( detector.isDetectMaximums() ){ sets = new FoundPointSO[]{new FoundMax()}; } else if( detector.isDetectMinimums()) { sets = new FoundPointSO[]{new FoundMin()}; } }
/** * Creates a {@link FastHessianFeatureDetector} detector which is wrapped inside * an {@link InterestPointDetector} * * @param config Configuration for detector. Pass in null for default options. * @return The interest point detector. * @see FastHessianFeatureDetector */ public static <T extends ImageGray> InterestPointDetector<T> fastHessian( ConfigFastHessian config ) { return new WrapFHtoInterestPoint(FactoryInterestPointAlgs.fastHessian(config)); }
public DetectDescribeMultiFusion(DetectorInterestPointMulti<T> detector, OrientationImage<T> orientation, DescribeRegionPoint<T, TD> describe) { this.detector = detector; this.orientation = orientation; this.describe = describe; info = new SetInfo[ detector.getNumberOfSets() ]; for( int i = 0; i < info.length; i++ ) { info[i] = new SetInfo<>(); info[i].descriptors = UtilFeature.createQueue(describe,10); } }
@Override public void detect(T input) { detector.detect(input); if( orientation != null ) orientation.setImage(input); }
/** * 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; }
@Override public boolean hasScale() { return detector.hasScale(); }
@Override public boolean hasOrientation() { if( orientation == null ) return detector.hasOrientation(); return true; } }