FACE_DETECTION USING PYTHON

 import cv2

#  python -m pip install --upgrade pip

#load the cascade
face_cascade=cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
#read the input image
img=cv2.imread('Madhurima.jpg')
#convery into grayscale
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GREY)
#detect faces
faces=face_cascade.detectMultiScale(gray,1.1,4)
#draw rectangle around the face
for(x,y,w,h)in faces:
cv2.ectangle(img,(x,y),(x+w,y+h),(255,0,0),0)
#display the output
cv2.imshow('img',img)
cv2.waitKey()

Comments

Popular posts from this blog

java chapter11 practice question on abstruct class and interfaces

DAY 12 -AZURE DP900(Microsoft Azure Data Fundamentals: Explore non-relational data in Azure)

java exercise4