öffentliche Klasse Main {< /p>
Code: Select all
public static void main(String[] args) {
Loader.load(opencv_core.class);
VideoCapture capture = new VideoCapture(0);
if (!capture.isOpened()){
System.out.println("error eerror");
return;
}
Mat frame = new Mat();
while (true){
if (capture.read(frame)){
opencv_highgui.imshow("camera" , frame);
}
if (opencv_highgui.waitKey(1) == 27 ){
break;
}
else {
System.out.println("Unable to capture frame");
break;
}
}
capture.release();
opencv_highgui.destroyAllWindows();
}
} this is what i wanted to try . The camera is turned on for a second and then this error pops up . Any help is appreciated . Thank you.