OpenCV 2.4.4 Java - Grab Webcam picture/stream (OSX)

后端 未结 3 1601
我寻月下人不归
我寻月下人不归 2021-01-06 02:03

I\'m new in the world of Stackoverflow and in OpenCV programming. I\'ve made some projects with OpenCV Bindings for Java (the opencv.org officials, not JavaCV), like object

相关标签:
3条回答
  • 2021-01-06 02:18

    Replace
    System.loadLibrary("opencv_java244");
    with
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

    0 讨论(0)
  • 2021-01-06 02:20

    The problem was simply that camera need time to initialize. I've added

    Thread.sleep(1000);
    

    after

    VideoCapture camera = new VideoCapture(0);
    
    0 讨论(0)
  • 2021-01-06 02:29

    I've tried this code in MacOS, and found another error.

    System.loadLibrary("opencv_java244");
    

    Above line returns this error

    java.lang.UnsatisfiedLinkError: org.opencv.highgui.VideoCapture.VideoCapture_2(I)J
    

    To overcome it, I replaced that line with this one

    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    

    and the code works!

    I'm using opencv 2.4.8, including it as user library in my eclipse project

    0 讨论(0)
提交回复
热议问题