/Face-Detection-Replacement

Traditional Computer Vision algorithms | Detect and replace face automatically in image or videos | Academic Project

Primary LanguageMATLAB

Face Detection & Replacement

The package includes several fundamental and traditonal image processing tools (without any deep learning method), including the Canny Edge detection, Image morphing and Image mosaicing. Based on those computer vision tools, completed a package that can detect and replace faces automatically in image or videos.

Feature Detection Tools

Feature plays an important role in the object (e.g, face region) detection. Here, we implemented three base algorithms playing with several type of features (e.g. edge, corner) and achieved some contributions.

  • Canny edge detector
    Detect and extract edge information for images, finally succeed to build corresponding Canny Edge Image.

  • Automatic 2D image mosaic
    Construct a panorama given several images that have some common regions along with detected SIFT features for the image stitching.

Those above sub-packages play roles as feature detection, construction and matching tools that will be used in the major face detection section, then combine with the built Eigen face and GMM model of human skin color, improves the detection performance.

Face Replacement Tools

Given the target and interested face regions, some optimal image morphing methods are necessary to achieve a good face replacement performance for each video frame.

  • Face Morphing
    Achieved face warping given two different faces with detected correspondences, using Delaunay Triangulation and TPS(Thin-Plate Spline) algorithms.

  • Gradient domian blending
    Applied the gradient information, make the face replacement region more smoothly and well-look.

Fused Work

Combined the feature detection and face replacement tools, succeeded to implement an intact package for the automatical face detection and replacement tool for images and video. All source codes are stored in the folder, face_detection_replacement.