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

Detecting face landmarks using previous frame's landmarks #19

Closed sidc9 closed 7 years ago

sidc9 commented 8 years ago

Hi Patrik,

I have been testing your code for some time now for facial landmark training and tracking.

I modified rcr-track to use the landmark points from the previous frame as initialization, instead of the mean. Face detection is performed in the first frame. After that, I use the landmark points from the previous frame. But on doing this, the landmarks get scattered after just a few frames. This happens even if the face remains more or less stationary. I am pasting the code snippet that I used below. Am I doing something wrong?

(current_landmarks holds the landmarks form the previous frame, as also mentioned in your comments in the code)

if(!have_face) { ... ...

have_face=true; } else{ cv::Mat prev_landmarks = to_row(current_landmarks);

current_landmarks = rcr_model.detect(image, prev_landmarks);

rcr::draw_landmarks(image, current_landmarks); have_face=true; // simply setting it to true for now for testing purposes. }

I would greatly appreciate any help or insight from you.

Cheers!

patrikhuber commented 8 years ago

Hi,

What you're trying to do with initialising using the previous points was also my first intuition, and similar to you, it didn't work for the reason you mentioned. I think what's happening is the following:

I hope this helps, let me know how it goes and I'm glad to help more, I'm quite curious as well. (It's unfortunately the stuff that never gets mentioned in papers, for example Xiong & De La Torre don't disclose this information in their paper. But I'm actually pretty sure my idea should work (and might also be exactly how they do it)).

sidc9 commented 8 years ago

Thank you for your detailed response. I'm working to implement your ideas. I'll post here if I manage to make any headway. Thanks again!

patrikhuber commented 8 years ago

Cool to hear that! Just let me know if you need any help.

lmrshare commented 7 years ago

I have ever implement the idea "perturb around the ground-truth location of the training landmarks", however the tracking for rotation was week. So, did you have some better idea for simulating the perturbation of rotation.

patrikhuber commented 7 years ago

You can correct for rotation by in-plane rotating the input image. That way you don't need to train it. I think there's a discussion about it in some of the (possibly closed) issues here. Alternatively you can try perturbing in the training with a 2D rotation.

I'm closing this since the original question is resolved, and the new question is kind of off-topic.

lmrshare commented 7 years ago

Thanks for your response. I think it is a 3D rotation scene, so it may be not appropriate to train with a 2D rotation. BTW, how about your progress on the tracking work.

2016-12-27 17:57 GMT+08:00 Patrik Huber notifications@github.com:

Closed #19 https://github.com/patrikhuber/superviseddescent/issues/19.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/patrikhuber/superviseddescent/issues/19#event-905578815, or mute the thread https://github.com/notifications/unsubscribe-auth/AFxv_vE8xgED-kCX_guzlInRp7yo3T6lks5rMOETgaJpZM4GKYgn .

patrikhuber commented 7 years ago

I see. The tracking works well enough for my purposes. Landmark detection isn't my main topic. I am focussing my effort on eos, the 3D fitting library.

lmrshare commented 7 years ago

ok, thanks very much. can you introduce the procedure for your current tracking work.

2016-12-27 19:34 GMT+08:00 Patrik Huber notifications@github.com:

I see. The tracking works well enough for my purposes. Landmark detection isn't my main topic. I am focussing my effort on eos http://github.com/patrikhuber/eos, the 3D fitting library.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/patrikhuber/superviseddescent/issues/19#issuecomment-269314408, or mute the thread https://github.com/notifications/unsubscribe-auth/AFxv_qA7pvLn3G7R58qjAITdwFEnraX7ks5rMPfegaJpZM4GKYgn .