一、HOGDescriptor()函数
调用OpenCV中的HOGDescriptor()
hog = cv2.HOGDescriptor()
hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
二、代码
#!/usr/bin/python
# -*- coding: utf-8 -*-
# @Time : 2017/11/20 11:23
# @File : faceDetect.py
# @Software: PyCharm
import sys
from PIL import Image, ImageTk
from imutils.object_detection import non_max_suppression
from imutils import paths
import numpy as np
import argparse
import imutils
import cv2
global x_CB, y_CB,x,y,w,h,ex_,ey_
# face_model = "lbpcascade_frontalface.xml"
# face_model = "haarcascade_profileface.xml"
# face_model = "haarcascade_frontalface_alt2.xml"
face_model = "haarcascade_frontalface_default.xml"
eyes_model = "haarcascade_eye.xml"
out_file = "output.avi"
hog = cv2.HOGDescriptor()
hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDete