Kazanımlar
- Haar Cascade’in ne olduğunu öğreneceksiniz.
- OpenCV ile resimlerdeki yüzleri tespit etmeyi öğreneceksiniz.
import cv2 import matplotlib.pyplot as plt test_img = cv2.imread("oguz.jpg") face_cascade = cv2.CascadeClassifier("frontalface.xml") gray = cv2.cvtColor(test_img, cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(gray, 1.3, 3) # x,y,w,h for (x,y,w,h) in faces: cv2.rectangle(test_img, (x,y), (x+w,y+h), (0,255,0), 4) cv2.imshow("Detected Faces", test_img) # plt.figure(figsize=(12,8)) # plt.imshow(gray,cmap="gray") # plt.show()