Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krshrimali/portrait-bokeh-using-opencv-and-numpy
Portrait Bokeh Implementation on Faces using OpenCV and NumPy in Python
https://github.com/krshrimali/portrait-bokeh-using-opencv-and-numpy
blur numpy opencv portrait-bokeh python
Last synced: 6 days ago
JSON representation
Portrait Bokeh Implementation on Faces using OpenCV and NumPy in Python
- Host: GitHub
- URL: https://github.com/krshrimali/portrait-bokeh-using-opencv-and-numpy
- Owner: krshrimali
- License: apache-2.0
- Created: 2019-04-14T13:21:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-27T01:10:42.000Z (over 1 year ago)
- Last Synced: 2024-11-02T14:42:01.449Z (13 days ago)
- Topics: blur, numpy, opencv, portrait-bokeh, python
- Language: Python
- Homepage: https://www.youtube.com/watch?v=4aweeJGS4so
- Size: 6.06 MB
- Stars: 9
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Portrait-Bokeh-using-OpenCV-and-NumPy
Portrait Bokeh Implementation on Faces using OpenCV and NumPy in Python
## What it does?
1. Blurs everything **except** faces.
2. Gives you a choice to select which face you want in the foreground.## Why is it special?
**Note**: Thanks to @vishwesh5 for the hints to proceed with the 1st point below.
1. ROI generally works for only rectangles in OpenCV. This project can do for any shape.
2. It's cool!## Usage
1. Execute the program: `python3 main.py 9`
2. Press Y when asked, if you don't want the face to be blurred. Else press N.
3. Output will be stored as blur.png in the same folder as the python file.## Example with Multiple Faces
**Input Image**
**Output Image (kernel size = 9)**
## Example
**Input Image**
**Output Image (kernel size = 5)**
**Output Image (kernel size = 7)**
**Output Image (kernel size = 9)**