-
-
Save Praveen76/03b706e0a343fd53a3b3094e6f500763 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
haar_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') | |
faces_rect=haar_cascade.detectMultiScale(grayscale,scaleFactor=1.1,minNeighbours=3,minSize=(30,30)) | |
print('Number of images found :', len(faces_rect)) | |
for (x,y,w,h) in faces_rect: | |
cv.rectangle(img,(x,y),(x+w,y+h),(0,255,0),thickness=1) | |
cv.imshow('detected faces',img) | |
cv.imwrite('DetectedFaces.jpg',img) | |
cv.waitKey() | |
cv.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment