Blur Human Face using OpenCV python. By using this method you can not only blur human faces but also many features like human eyes,nose,ears etc.
Blur Human Face using OpenCV Python. At first import OpenCV and time.

We need to load face_cascade. Then we load haarcascade. "haarcascade_frontalface_default.xml" contain our feature data. We are using haarcascade for the frontal face. We create the 'video' variable which will record the input from our webcam.
We create a while loop so that we can extract the video. This 'video' variable will click still pictures so what we are doing here is, we are creating a while loop and then creating a slideshow of images. That slideshow of image is called a video. Then inside the While loop we describe the coordinate of our face.
We use here Median blur function from OpenCV to blur our image. In median blur function the first parameter is the image and then we have to define the percentage of te blur(Keep in mind one point that it should be a positive or an Odd number). Here we blur the image 35 %.

Submitted by Swarnava Basu (swarnavabasu)
Download packets of source code on Coders Packet
Comments