03. 객체 인식 - 2) 사람 감지 (From. 동영상/이미지)


03. 객체 인식 - 2) 사람 감지 (From. 동영상/이미지)

[동영상에서 사람 객체 감지] import cv2 cap = cv2.VideoCapture(0) hog = cv2.HOGDescriptor() hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector()) while True: ret, frame = cap.read() if not ret: break boxes, weights = hog.detectMultiScale(frame,winStride=(4, 4), padding=(8, 8), scale=1.05) for (x, y, w, h) in boxes: cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2) if len(boxes) > 0: cv2.putText(frame, "Person Detected", (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2) else: cv2.putTe...



원문링크 : 03. 객체 인식 - 2) 사람 감지 (From. 동영상/이미지)