Ask Your Question

Revision history [back]

Try this for me its working after resizing and decreasing the neighbour


cam=cv2.VideoCapture(0)

while True:

ret, frame = cam.read()
frame=imutils.resize(frame, width=min(100, frame.shape[1]))
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
upper=fc.detectMultiScale(gray,1.1,1)
#print lips
for (a,b,c,d) in upper:
    cv2.rectangle(frame,(a,b),(a+c,b+d),(0,0,255),2)
print len(upper)
cv2.imshow('detect',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
    break

cam.release() cv2.destroyAllWindows()