DEV Community

El Bruno for Microsoft Azure

Posted on • Originally published at on

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

Hi !

NET is in anniversary mode, so I think it will be a good idea to share some camera samples in C#. For these demos I’m using C#, NET 6 and OpenCVSharp as OpenCV wrapper for .NET.

Today post: detect a face using haar cascades and blur the face area. This demo also show the detected face in a separated window (just for fun).


Code Sample

Easy to implement, and also easy to read:

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

Original Post

Happy coding!


El Bruno

Top comments (3)

alexisag profile image

Looks good, but I do not see the code.
Do you have a link ? I would like to know how it works.

elbruno profile image
El Bruno

That's weird πŸ™ƒ
The code snippet is here >>

Let me know if you can browse it, or check the code in the original post in

alexisag profile image

It's ok now, I can see the code sample πŸ™ƒ
Thx for the share !