Last active
October 8, 2019 18:03
-
-
Save vallantin/dc70db99ee2e335d00f2686140080115 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_and_blur(bw, color): | |
# detect al faces | |
faces = cascade.detectMultiScale(bw, 1.1, 4) | |
# get the locations of the faces | |
for (x, y, w, h) in faces: | |
# select the areas where the face was found | |
roi_color = color[y:y+h, x:x+w] | |
# blur the colored image | |
blur = cv2.GaussianBlur(roi_color, (101,101), 0) | |
# Insert ROI back into image | |
color[y:y+h, x:x+w] = blur | |
# return the blurred image | |
return color |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment