Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)**