Ask Your Question
-1

SOLVED Does the Cascade Classifier work with OpenCV 2.4.11

asked 2018-04-15 10:10:45 -0600

Marko5280 gravatar image

updated 2018-04-18 05:38:17 -0600

I have created a program to detect faces in a live camera feed from a Webcam. It works fine in OpenCV 3.4.1 Java! However, I am trying to make a robot with face detection on the Lego EV3. The Lego EV3 uses leJOS and OpenCV 2.4.11! The program does not complete with OpenCV 2.4.11! It halts on line 34.

 CascadeClassifier face_cascade = new CascadeClassifier();

I get the error . . .

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 samples.face_detection.main(face_detection.java:34)

Does anyone know the cause/solution?

My program in it's entirety follows . . . (NOT)

EDIT 4/17/2018

Here is my test program . . .

import org.opencv.core.Core;
import org.opencv.objdetect.CascadeClassifier;

public class TESTFACE {

  public static void main(String[] args) {
      System.loadLibrary(Core.NATIVE_LIBRARY_NAME); 
      CascadeClassifier face_cascade = new CascadeClassifier("haarcascade_frontalface_alt.xml");
       }

}

The error is the same.

edit retag flag offensive close merge delete

Comments

Could you initialize the cascade classifiers directly upon creation? CascadeClassifier face_cascade = new CascadeClassifier("/path/to/cascade/"); should do the trick

StevenPuttemans gravatar imageStevenPuttemans ( 2018-04-17 07:30:24 -0600 )edit

That was my only idea. My new test program focused on the error.

Marko5280 gravatar imageMarko5280 ( 2018-04-17 09:00:40 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-04-17 12:35:37 -0600

Marko5280 gravatar image

SOLVED

OpenCV 2.4.11 is not installed correctly. This thread has been moved to

How do I install OpenCV 2.4.11 on Windows 7?

http://answers.opencv.org/question/18...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-04-15 10:10:45 -0600

Seen: 378 times

Last updated: Apr 18 '18