Ajout des tests sur HaarCascade
This commit is contained in:
parent
406e6d9b5d
commit
5ea3bd93c8
54 changed files with 8111 additions and 1 deletions
13
ongoing/HaarCascade_tests/trained_classifiers/haar.py~
Normal file
13
ongoing/HaarCascade_tests/trained_classifiers/haar.py~
Normal file
|
@ -0,0 +1,13 @@
|
|||
import numpy as np
|
||||
import cv2 as cv
|
||||
face_cascade = cv.CascadeClassifier('banana_classifier.xml')
|
||||
img = cv.imread('000.jpg')
|
||||
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
|
||||
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
|
||||
for (x,y,w,h) in faces:
|
||||
cv.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
|
||||
roi_gray = gray[y:y+h, x:x+w]
|
||||
roi_color = img[y:y+h, x:x+w]
|
||||
cv.imshow('img',img)
|
||||
cv.waitKey(0)
|
||||
cv.destroyAllWindows()
|
Loading…
Add table
Add a link
Reference in a new issue