Monday, January 14, 2019

Open image using javacv with java netbeans. #02


In this tutorial show you how open image using javacv. Here include complete video tutorial and source code. 






Select Image using File chooser

        JFileChooser fchooser = new JFileChooser();
        fchooser.showOpenDialog(null);
        File f = fchooser.getSelectedFile();
        imgpath.setText(f.getAbsolutePath());


Image open code

        IplImage img = cvLoadImage(imgpath.getText());
        final CanvasFrame cf = new CanvasFrame("");
        cf.showImage(img);
        cf.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);

No comments:

Post a Comment