<分区>
import numpy as np
import cv2
import os
import math
webcam=cv2.VideoCapture(0)
frame = webcam.read()
webcam.release()
detector =cv2.CascadeClassifier("xml/frontal_face.xml")
scale_factor=1.2
min_neighbors=5
min_size=(30,30)
biggest_only= True
flags= cv2.CASCADE_SCALE_IMAGE
#print type(frame)
flags =cv2.CASCADE_FIND_BIGGEST_OBJECT | cv2.CASCADE_DO_ROUGH_SEARCH if biggest_only else cv2.CASCADE_SCALE_IMAGE
face = detector.detectMultiScale(
frame,
scaleFactor=1.1,
minNeighbors=5,
minSize=(30, 30),
flags=flags)
错误:
File "C:\Users\DELL\workspace\facedetect\detect.py", line 23, in flags=flags) TypeError: image is not a numerical tuple