import cv2
import dlib
image = cv2.imread("D:\Project\COMPUTER_VISION\Computer Vision Masterclass\Images\people2.jpg")
face_detector_hog = dlib.get_frontal_face_detector()
detections = face_detector_hog(image, 1)
for face in detections:
l, t, r, b = face.left(), face.top(),face.right(),face.bottom()
cv2.rectangle(image, (l,t),(r,b),(0,255,0), 2)
cv2.imshow("image",image)
cv2.waitKey(0)
cv2.destroyAllWindows()
- face_detector_hog : 얼굴 탐지를 위한 dlib HOG 기반 얼굴 탐지기
- detections : 얼굴 탐지 결과. '1'은 얼굴 탐지기의 파라미터 중 하나로, 이미지 축소를 위한 수준(Up-sample)을 지정하는 값이다. 이는 Haar Cascade에서 scaleFactor와 비슷한 역할을 한다.
'이론 공부 > COMPUTER VISION' 카테고리의 다른 글
Computer Vision - LBPH(Local Binary Patterns Histograms) (0) | 2025.02.12 |
---|---|
Computer Vision - LAB 02_2. FACE DETECT (CNN with Dlib) (0) | 2025.02.11 |
Computer Vision - HOG(History of Oriented Gradients) (0) | 2025.02.11 |
Computer Vision - LAB 01_2. Face Detect (HAAR CASCADE) (0) | 2025.02.10 |
Computer Vision - LAB 01_1. Face Detect (HAAR CASCADE) (0) | 2025.02.10 |