OpenCV CascadeClassifier error

泄露秘密 提交于 2019-12-10 17:45:02

问题


i'm trying to do face detection through a webcam, but i got an error, cascadeclassifier error.

After do some testing, i found this line of code generate the error

CascadeClassifier face_cascade = new CascadeClassifier();

The error i got is

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.objdetect.CascadeClassifier.CascadeClassifier_0()J
    at org.opencv.objdetect.CascadeClassifier.CascadeClassifier_0(Native Method)
    at org.opencv.objdetect.CascadeClassifier.<init>(CascadeClassifier.java:38)
    at CamCapture.main(CamCapture.java:24)

Is anybody know how to solve this?



回答1:


finally i found the answer,

i should load the library before use the cascadeclassifier. so just put this code

System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

before the cascadeclassifier.



来源:https://stackoverflow.com/questions/16449781/opencv-cascadeclassifier-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!