Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import cv2 as cv
  3. face_cascade = cv.CascadeClassifier('haarcascade_frontalface_default.xml')
  4. img = cv.imread('7oty l image bta3tk hena')
  5. gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
  6. faces = face_cascade.detectMultiScale(gray, 1.3, 5)
  7. for (x,y,w,h) in faces:
  8.     cv.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
  9.     roi_gray = gray[y:y+h, x:x+w]
  10.     roi_color = img[y:y+h, x:x+w]
  11.  
  12. cv.imshow('img',img)
  13. cv.waitKey(0)
  14. cv.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement