Detect Face and Blur it (single face expected)
Python Code using OpenCV and a bit of numpy to find faces in still images and blur them.
Takes as input the path of an image (in face_detect_tester.py) or a path full of images (in face_detect.py) and outputs the same image(s) with the face of the person included blurred, if found.
If many faces are there, only the largest face will be blurred. If no faces are there, nothing gets blurred. The output image is a BW version of the input Image.
The current version outputs a BW version of the images, with the blur using a 1-0 mask. Later versions should:
- output RGB-colored images
- use Gaussian mask on the blur effect.
- same methodology will be applied to videos using FFmpeg. Providing options of: Either producing a mask video to be used in any other video editing tool OR the video itself with the face blurred.
- OpenCV & Numpy in Python
- Pycharm
1- Make sure the variable path has the correct path name leading to where your images are located.
2- Make sure the
1- Make sure the variable imagePath has the correct path name leading to where your imageis located.
2- Make sure the
All other inputs are in the folder: 'IMDB Celeb Faces'. All other outputs are in the 'Output Folder'.