简体   繁体   中英

OpenCV3 Video Capture

Im trying to capture the video of the webcam using opencv in Java. I had no problems using the version 2.x but when I changed the version to 3.0.0 (updating native dependencies) I started to get this exception:

java.lang.Exception: unknown exception
    at org.opencv.videoio.VideoCapture.VideoCapture_2(Native Method)
    at org.opencv.videoio.VideoCapture.<init>(VideoCapture.java:54)

My code (is quite basic):

try{
    videoSource = new VideoCapture(0); // video capture from default cam
}catch(Exception e){
    e.printStackTrace();
    System.out.println("Error iniciando camara.");
}

Any tips would be appreciated.

Solved. I was using jdk 32 bits with dll 32bits in a SO of 64. Changed everything to 64 and worked!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM