DEV Community

El Bruno for Microsoft Azure

Posted on • Originally published at elbruno.com 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!

Greetings

El Bruno


Top comments (3)

Collapse
 
alexisag profile image
AlexisAG

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

Collapse
 
elbruno profile image
El Bruno

That's weird šŸ™ƒ
The code snippet is here >> gist.github.com/elbruno/59b9495fb8...

Let me know if you can browse it, or check the code in the original post in elbruno.com/2022/02/15/opencv-dete...

Collapse
 
alexisag profile image
AlexisAG

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