Ask Your Question

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>( at samples.face_detection.main(

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) {
      CascadeClassifier face_cascade = new CascadeClassifier("haarcascade_frontalface_alt.xml");


The error is the same.

edit retag flag offensive close merge delete


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

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

Marko5280 gravatar image


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?

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


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

Seen: 45 times

Last updated: Apr 18