Search Creators CG LAB Program-12
Search Creators CG LAB Program-12
Subject Code:21CSL66
Program-12
Program
import cv2
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades +
'haarcascade_frontalface_default.xml')
image = cv2.imread('image/face.jpeg')
cv2.waitKey(0)
cv2.destroyAllWindows()
Output
Explanation
(0, 255, 0) argument specifies the color (green in this case), and the 2
argument specifies the thickness of the rectangle lines.
11.The image with the detected faces and rectangles is displayed using
cv2.imshow('Face Detection', image).
12.The script waits for a key press (cv2.waitKey(0)) before closing the window.
13.Finally, the window is closed using cv2.destroyAllWindows().