1. head detection: use Haar algorithm to detect face features( eyes, nose, mouth, etc.);
2. Facial feature mapping: use facial landmarks to create a face model;
3. Face Alignment: Rotate, scale or distort the face to match the angle of the target face;
4. Head Swap: Pair and blend two heads to match skin tones, lighting and shadows;
5. Image Blending and Refinement: Correct traces and refine edges to ensure the output looks natural and seamless.



