DEV Community

El Bruno for Microsoft Azure

Posted on • Originally published at elbruno.com on

#OpenCV – Detect and blur faces 😁 using haar cascades in Python 🐍

Hi !

Quick post today: detect a face using haar cascades and blur the face area. Easy to implement, and also easy to read:

face blur on a camera view

Code below

Important: Haar cascades are easy to implement and learn, however, not recommented as a good solution to detect faces.

Face Recognition and Face Detection series in Python

  1. Detecting Faces with 20 lines in Python
  2. Face Recognition with 20 lines in Python
  3. Detecting Facial Features with 20 lines in Python
  4. Facial Features and Face Recognition with 20 lines in Python
  5. Performance improvements with code
  6. Resize the camera input with OpenCV
  7. Working with Haar Cascades and OpenCV
  8. Detect and blur faces using haar cascades

Original Post

Happy coding!

Greetings

El Bruno


Top comments (3)

Collapse
 
64j0 profile image
Vinícius Gajo

Hey, is it possible to write this with F#?

Collapse
 
elbruno profile image
El Bruno

Hi Vinicius, yes sure !
I need to update my F# skills, however, I'll give it a try

Collapse
 
64j0 profile image
Vinícius Gajo

Cool, thanks for the reply. I'm currently studying opencv using Python since it is easy to find books and docs, but my final goal is to implement it with F#