This web application demonstrates three different methods for blurring faces in images:
- OpenCV's built-in GaussianBlur
- Custom numerical convolution
- Fourier domain filtering
The application allows users to upload an image, detects faces in the image, and applies all three blurring methods. It then displays the results side by side with timing information.
- Clone this repository
- Install the required dependencies:
pip install -r requirements.txt - Download the face detection model:
curl -o haarcascade_frontalface_alt.xml https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_frontalface_alt.xml
- Start the application:
python app.py - Open your web browser and navigate to http://127.0.0.1:5000/
- Upload an image containing faces
- View the results of the three different blurring methods
- Face detection is performed using OpenCV's Haar Cascade Classifier
- The detected face region is extracted and blurred using each method
- The blurred region is then reapplied to the original image
- Timing information is recorded to compare the performance of each method
Uses OpenCV's optimized implementation of Gaussian blur
Implements Gaussian blur using direct convolution with a manually created Gaussian kernel
Applies Gaussian blur in the frequency domain using the Fourier transform