Ask Your Question

ventilatorr's profile - activity

2016-02-01 03:12:21 -0500 received badge  Self-Learner (source)
2015-07-24 07:47:34 -0500 commented question Display driver stopped responding and has succesfully recovered during detectMultiScale

It's working now. I used the haarcascades_cuda instead of the normal one. I don't know why that worked if I'm not using the GPU but atleast it's working.

2015-07-24 05:23:34 -0500 received badge  Enthusiast
2015-07-23 14:37:20 -0500 commented question Display driver stopped responding and has succesfully recovered during detectMultiScale

I tried it in c++ but I get the same result. What are the requirements for OpenCV? My laptop has a Intel and Nvidea gpu so maybe that's a problem.

2015-07-22 07:52:43 -0500 commented question Display driver stopped responding and has succesfully recovered during detectMultiScale

Is the one on Github the latest?

2015-07-20 06:17:31 -0500 commented question Display driver stopped responding and has succesfully recovered during detectMultiScale

The latest on github and the one included with 3.0.

The one on github was last updated 2 years ago, can you link me the new one?

2015-07-19 12:03:14 -0500 commented question Display driver stopped responding and has succesfully recovered during detectMultiScale

Both are loaded when I check them, and without a face there are no eyes either. Check my edit.

2015-07-19 11:48:14 -0500 received badge  Editor (source)
2015-07-19 08:49:56 -0500 asked a question Display driver stopped responding and has succesfully recovered during detectMultiScale

I'm making the object detection tutorial in Java. The face detection is working but the eye detection crashes the program. Windows gives me a pop-up that says:

Display driver stopped responding and has succesfully recovered.

This is my code:

public Mat detectFace(Mat frame){
    CascadeClassifier face_cascade = new CascadeClassifier(face_cascade_name);
    CascadeClassifier eyes_cascade = new CascadeClassifier(eyes_cascade_name);

    Mat greyScale = new Mat();
    Imgproc.cvtColor(frame, greyScale, Imgproc.COLOR_BGR2GRAY);
    Imgproc.equalizeHist(greyScale, greyScale);

    MatOfRect faces = new MatOfRect();
    face_cascade.detectMultiScale(greyScale, faces);
    List<Rect> facesList = faces.toList();

    for(Rect face : facesList){
        Point center = new Point ( face.x + face.width*0.5, face.y + face.height*0.5 );
        Imgproc.ellipse( frame, center, new Size( face.width*0.5, face.height*0.5), 0.0, 0.0, 360.0, new Scalar( 255, 0, 255 ), 4, 8, 0 );

        Mat faceMat = new Mat(greyScale, face);

        MatOfRect eyes = new MatOfRect();
        eyes_cascade.detectMultiScale(faceMat, eyes);
        List<Rect> eyesList = eyes.toList();

        System.out.println(eyesList.size());

        for(Rect eye : eyesList){
            Point eyeCenter = new Point( face.x + eye.x + eye.width*0.5, face.y + eye.y + eye.height*0.5 );
               int radius = (int) ((eye.width + eye.height)*0.25 );
               Imgproc.circle( frame, center, radius, new Scalar( 255, 0, 0 ), 4, 8, 0 );
        }
    }

    return frame;
}

It crashes at eyes_cascade.detectMultiScale(faceMat, eyes) but face_cascade.detectMultiScale(greyScale, faces) works fine.

EDIT: It seems haarcascade_eye_tree_eyeglasses.xml is the problem. It doesn't crash when using another, but all the others I found don't detect the eyes. Does anyone have a working haarcascade?