move dirs

This commit is contained in:
2023-09-26 22:05:13 +03:00
parent 5414fa8538
commit 55d774e7d5
190 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env python3
import cv2
img = cv2.imread('face.png')
gray_image = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
face_classifier = cv2.CascadeClassifier(
cv2.data.haarcascades + 'haarcascade_frontalface_default.xml'
)
face = face_classifier.detectMultiScale(
gray_image, scaleFactor=1.1, minNeighbors=5, minSize=(40, 40)
)
for x, y, w, h in face:
cv2.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2)
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
cv2.imshow('Face Detector', img_rgb)
cv2.waitKey(0)
cv2.destroyAllWindows()