def __init__(self, haarCascadeFilePath, videoCapture):
try:
self.faceCascade = cv2.CascadeClassifier(haarCascadeFilePath)
except:
raise Exception("Error creating haar cascade classifier. Are you sure file " + haarCascadeFilePath + " exists?")
self.videoCapture = videoCapture
self.foundFace = False
self.trackedFace = None
self.trackedFaceROI = None
self.templateMatchingStartTime = cv2.getTickCount()
self.templateMatchingCurrentTime = cv2.getTickCount()
self.isTemplateMatchingRunning = False
self.img = None
评论列表
文章目录