Ask Your Question

Schiawo's profile - activity

2013-09-27 12:40:01 -0500 commented question javacv NullpointerException loading image.

OK, i fixed the other one too.

2013-09-27 12:32:37 -0500 commented question javacv NullpointerException loading image.

It worked, thank you very much! can you say me something about this error? I think is the same problem but the image should be passed like configuration argument and i tried a path like "c:/my/folder/img1.png" but still not works.

2013-09-27 12:16:20 -0500 asked a question javacv NullpointerException loading image.

I'm trying to execute this simple java class to test opencv and javacv correct installation:

    import static com.googlecode.javacv.cpp.opencv_core.*;
    import static com.googlecode.javacv.cpp.opencv_highgui.*;
    import com.googlecode.javacv.CanvasFrame;

    public class demo1 {
        public static void main(String[] args) {
            //Load image img1 as IplImage
            final IplImage image = cvLoadImage("img1.png");
            System.out.println("Image loaded");
            //create canvas frame named 'Demo'
            final CanvasFrame canvas = new CanvasFrame("Demo");
            //Show image in canvas frame
            //This will close canvas frame on exit

I receive this console output:

Image loaded
Exception in thread "main" java.lang.NullPointerException
    at com.googlecode.javacv.CanvasFrame.showImage(
    at com.googlecode.javacv.CanvasFrame.showImage(
    at demo1.main(

I installed OpenCV- in my win7 64bit pc

extracted it in C:\opencv,

set the environment variable PATH as C:\opencv\build\x64\vc11\bin,

i've got the Java SDK,

downloaded javacv (source and cppjars)

and added all opencv and javacv jar files in the Eclipse project.

The img1.png is in the same folder of

What is the problem? Thank you for help.