Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I tested the following code of opencv3.0.0 with Java eclipse neon and run and I got the error in the above question.
Pls help me!

Thanks in advance,
Kathy.
Java
package againtest;

import org.opencv.core.*;       
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.videoio.VideoCapture;
 

public class VideoCap {
	
	public static void main(String[] args) {
 
		System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
		
		VideoCapture camera = new VideoCapture();
		camera.open(0);
		
    	if(!camera.isOpened()){
    		System.out.println("Error");
    	} else {
    		Mat frame = new Mat();
    	    while(true){
    	    	if (camera.read(frame)){
    	    		System.out.println("Frame Obtained");
    	    		System.out.println("Captured Frame Width " + 
    	    		frame.width() + " Height " + frame.height());
    	    		Imgcodecs.imwrite("image/camera.jpg", frame);
    	    		System.out.println("OK");
    	    		break;
    	    	}
    	    }	
    	}
    	camera.release();
	}
 
}


What I have tried:

I tried to test opencv3.0.0 with java eclipse neon.
Posted
Updated 14-Jul-16 22:01pm
v2
Comments
Patrice T 15-Jul-16 2:12am    
problem somewhere else.
Richard MacCutchan 15-Jul-16 4:01am    
I don't see a class called "againtest.hellocv" anywhere in your code. Did you try running againtest.VideoCap?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900