patrikhuber / superviseddescent

C++11 implementation of the supervised descent optimisation method
http://patrikhuber.github.io/superviseddescent/
Apache License 2.0
402 stars 188 forks source link

Crashing after a face is detected with rcr_track.cpp #49

Closed ghost closed 6 years ago

ghost commented 7 years ago

I have tried to make the rcr-track.cpp code working, I copied the same file found inside: apps/rcr. the code detected a face with the landmarks in the first frame only and the program crashes!! I got the following:

capture

Any idea why that is happening?

Thank you!!

patrikhuber commented 7 years ago

This looks a problem with either your video file or the decoder in OpenCV or ffmpeg (h264?). It doesn't look like it has anything to do with superviseddescent. I recommend you try different video files or formats or maybe a newer OpenCV version.

ghost commented 7 years ago

So now I tried different file formats. And I am using opencv3.2, and still it is not working. I got the following: capture I tried opencv alone with haar cascade face detection and it works in visual studio. So I guess it has nothing to do with opencv or ffmpeg.

I tried also the dlib library and it is working in visual studio on the same video files.

patrikhuber commented 7 years ago

You don't get an error anymore so it looks like the video files in principle are running. I suggest you just debug through your app and see what happens - I'm sure it's probably some problem with the logic in your app. It doesn't look like any issue with superviseddescent.

ghost commented 7 years ago

Now it worked. The problem was with the following line: if (cv::waitKey(30) >= 0) break;

When I replaced it with: if (cv::waitKey(25) == 27) break; it works fine.

Note that I am using opencv 3.2

Finally, inside the else block at line 32, whenever I removed the comments I got the following errors: 1- I got an error on get_enclosing_box method since it takes a Mat and we are passing LandmarkCollection. How to solve this issue? 2- class "rcr::detection_model" has no member "model_mean" 3- name space rcr has no member "alignMean".

patrikhuber commented 6 years ago

I'm going to close this, I don't think there is an issue in the superviseddescent library. Otherwise feel free to re-open.