/** * For some features, there are pre-made implementations of DetectDescribePoint. This has only * been done in situations where there was a performance advantage or that it was a very common * combination. */ public static <T extends ImageSingleBand, D extends TupleDesc> DetectDescribePoint<T, D> createFromPremade(Class<T> imageType) { return (DetectDescribePoint) FactoryDetectDescribe.surfStable( new ConfigFastHessian(1, 2, 200, 1, 9, 4, 4), null, null, ImageFloat32.class); // note that SIFT only supports ImageFloat32 // if( imageType == ImageFloat32.class ) // return (DetectDescribePoint)FactoryDetectDescribe.sift(null,new // ConfigSiftDetector(2,0,200,5),null,null); // else // throw new RuntimeException("Unsupported image type"); }
/** * Any arbitrary implementation of InterestPointDetector, OrientationImage, DescribeRegionPoint * can be combined into DetectDescribePoint. The syntax is more complex, but the end result is * more flexible. This should only be done if there isn't a pre-made DetectDescribePoint. */ public static <T extends ImageSingleBand, D extends TupleDesc> DetectDescribePoint<T, D> createFromComponents(Class<T> imageType) { // create a corner detector Class derivType = GImageDerivativeOps.getDerivativeType(imageType); GeneralFeatureDetector corner = FactoryDetectPoint.createShiTomasi(new ConfigGeneralDetector(1000, 5, 1), false, derivType); InterestPointDetector detector = FactoryInterestPoint.wrapPoint(corner, 1, imageType, derivType); // describe points using BRIEF DescribeRegionPoint describe = FactoryDescribeRegionPoint.brief(new ConfigBrief(true), imageType); // Combine together. // NOTE: orientation will not be estimated return FactoryDetectDescribe.fuseTogether(detector, null, describe); }
@Override public DetectDescribePoint<ImageFloat32, SurfFeature> createDetDesc() { return FactoryDetectDescribe.sift(null, new ConfigSiftDetector(2, 0, 500, 5), null, null); }