感兴趣区域检测技术

Boofcv研究:感兴趣区域检测技术

public class InterestPoint {

    public static <T extends ImageGray>
    void detect( BufferedImage image , Class<T> imageType ) {
        T input = ConvertBufferedImage.convertFromSingle(image, null, imageType);

        InterestPointDetector<T> detector = FactoryInterestPoint.fastHessian(
                new ConfigFastHessian(10, 2, 100, 2, 9, 3, 4));

        detector.detect(input);

        displayResults(image, detector);
    }

    private static <T extends ImageGray>
    void displayResults(BufferedImage image, InterestPointDetector<T> detector)
    {
        Graphics2D g2 = image.createGraphics();
        FancyInterestPointRender render = new FancyInterestPointRender();


        for( int i = 0; i < detector.getNumberOfFeatures(); i++ ) {
            Point2D_F64 pt = detector.getLocation(i);

            if( detector.hasScale() ) {
                int radius = (int)(detector.getRadius(i));
                render.addCircle((int)pt.x,(int)pt.y,radius);
            } else {
                render.addPoint((int) pt.x, (int) pt.y);
            }
        }
        g2.setStroke(new BasicStroke(3));

        render.draw(g2);
        ShowImages.showWindow(image, "Detected Features", true);
    }

    public static void main( String args[] ) {
        BufferedImage image = UtilImageIO.loadImage(UtilIO.pathExample("D:\\JavaProject\\Boofcv\\example\\sunflowers.jpg"));
        detect(image, GrayF32.class);
    }
}

感兴趣区域检测技术

上一篇:《DBA修炼之道:数据库管理员的第一本书》——2.3节升级DBMS的主版本和次版本


下一篇:详解语音处理检测技术中的热点——端点检测、降噪和压缩 | 硬创公开课