Skip to content

Instantly share code, notes, and snippets.

@nikhil9
Created October 31, 2012 15:51
Show Gist options
  • Save nikhil9/3987829 to your computer and use it in GitHub Desktop.
Save nikhil9/3987829 to your computer and use it in GitHub Desktop.
Demo source code for Javacv Setup in Eclipse
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
import com.googlecode.javacv.CanvasFrame;
public class demo {
public static void main(String[] args) {
//Load image img1 as IplImage
final IplImage image = cvLoadImage("img1.png");
//create canvas frame named 'Demo'
final CanvasFrame canvas = new CanvasFrame("Demo");
//Show image in canvas frame
canvas.showImage(image);
//This will close canvas frame on exit
canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment