hrastnik / FaceSwap

Real-time FaceSwap application built with OpenCV and dlib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make swapped face follow mouth and eyes

galfaroth opened this issue · comments

Hi!
I was able to run the code. How can I achieve an effect not that one face is cloned to another but follow the emotion? I guess I would need to take the keypoints from one face and apply them to the second.

EXAMPLE
If I have person 1 that is not smiling and person 2 that is smiling and opening eyes, I would like to see the person 1 having the face of person 2 that is not smiling and person 2 having face of person 1 smiling and opening the eyes.

Is it a simple fix to getTransformationMatrices() ? or should I rather fix getFacePoints(...)? Could you possibly guide me on how to achive this simple fix?

It's not really a simple fix. You should use the points to segment the faces into smaller pieces (triangles) and then find the transformations between the pieces. This is a lot of work and IMO it will be hard to keep it real time.

Well you might be right. I tried to work on it a bit but I think it will be harden than I thought. Do you think the function cv::remap would be useful?