A simple 3D face alignment and warping demo.
MIT License
Input: face image/video
Output: Textured 3D face model
This is the author's implementation of 3D face alignment and warping method described in: Mirror Mirror: Crowdsourcing Better Portraits Jun-Yan Zhu, Aseem Agarwala, Alexei A. Efros, Eli Shechtman, Jue Wang In ACM Transactions on Graphics (Proceedings of SIGGRAPH Asia 2014)
Please cite our paper if you use our code for your research.
@article{zhu2014mirror,
author = {Jun-Yan Zhu and Aseem Agarwala and Alexei A Efros and Eli Shechtman and Jue Wang},
title = {Mirror Mirror: Crowdsourcing Better Portraits},
journal = {ACM Transactions on Graphics (SIGGRAPH Asia 2014)},
volume = {33},
number = {6},
year = {2014},
}
Given an image or a video sequence that contains a face, the program can align and warp the face to a 3D face model. The user can further rotate/translate the face, and adjust the camera projection (perspective projection or orthogonal projection). The program also provides different OpenGL rendering options. See "Usage" for details.
Contact: Jun-Yan Zhu ([email protected])
sudo apt-get install libopencv-dev
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt-get install libxmu-dev libxi-dev
Download and unzip the code.
Run the following command.
mkdir cbuild
cd cbuild
cmake -DCMAKE_BUILD_TYPE=Release ../
make
./FaceDemo mode filePath
./FaceDemo image ./data/bush.jpg
./FaceDemo video ./data/eli.avi
+/-
: zoom in/outp
: toggle between a perspective projection and an orthogonal projection.s
: toggle between flat and smooth shading.w
: toggle between filled and wireframe mode.t
: toggle between static mode and transformation mode: for static mode, the 3D face model doesn't rotate and translate.q
: quit the program