Portrait Bokeh Implementation on Faces using OpenCV and NumPy in Python
- Blurs everything except faces.
- Gives you a choice to select which face you want in the foreground.
Note: Thanks to @vishwesh5 for the hints to proceed with the 1st point below.
- ROI generally works for only rectangles in OpenCV. This project can do for any shape.
- It's cool!
- Execute the program:
python3 main.py <image_path> 9
- Press Y when asked, if you don't want the face to be blurred. Else press N.
- Output will be stored as blur.png in the same folder as the python file.
Input Image
Output Image (kernel size = 9)
Input Image
Output Image (kernel size = 5)
Output Image (kernel size = 7)
Output Image (kernel size = 9)