I am not able to use OpenCV's imshow() method . Can someone please help me with this . I will post a screenshot of the errors im facing . i would also appreciate some help in configuring intellij for OpenCV . This is the error im facing
Exception in thread "main" java.lang.RuntimeException: Unknown exception.
at .bytedeco.opencv.global.opencv_highgui.imshow(Native Method)
at .example.Main.main(Main.java:35)
public class Main {
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.