Skip to content

garimachhikara128/Morphing

Repository files navigation

Morphing

Facial Feature Detection:

  1. git clone https://github.com/spmallick/dlib
  2. cd dlib/examples
  3. mkdir build
  4. cd build
  5. cmake ..
  6. cmake --build . --config Release

Download the file from https://github.com/spmallick/dlib and extract it.

Update your face_landmark_detection_to_file.cpp with the one mentioned above.

Desktop$ cd JournalNewVideos/
Desktop/JournalNewVideos$ cd dlib-master/examples/
Desktop/JournalNewVideos/dlib-master/examples$ mkdir build
Desktop/JournalNewVideos/dlib-master/examples$ cd build
Desktop/JournalNewVideos/dlib-master/examples/build$ cmake ..
Desktop/JournalNewVideos/dlib-master/examples/build$ cmake --build . --config Release

Download file from "http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2" and save it on desktop. Extract this file and save the extracted file "http://dlib.net/files/shape_predictor_68_face_landmarks.dat." in Desktop/JournalNewVideos/dlib-master/examples/build

Now put the folder containing images in Desktop/JournalNewVideos/dlib-master/examples/build/YourFolder

Run the following command :
Desktop/Journal/dlib-master/examples/build$ ./face_landmark_detection_to_file shape_predictor_68_face_landmarks.dat ThresholdDynamic/*.png

Add Extra Points:

DLib gives 68 facial points as output. We need to add 8 extra points of image boundary. Run AddExtraPoints.py for this.

Average of File:

We want to calculate a morphed image between img1 and img2, then obatin the average of facial points of img1.txt and img2.txt. Use file AverageFileContentNew.java for this.

Triangulation:

We obtain delaunay triangles using file Triangulation.py.

Morphing:

Last step is to obtain morphed frames, use file FaceMorph.py for this.

Reference :

https://www.learnopencv.com/facial-landmark-detection/
https://github.com/spmallick/dlib/

About

Obtaining morphed images using dlib and opencv

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published