本文整理匯總了Python中imutils.video.VideoStream.more方法的典型用法代碼示例。如果您正苦於以下問題:Python VideoStream.more方法的具體用法?Python VideoStream.more怎麽用?Python VideoStream.more使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類imutils.video.VideoStream
的用法示例。
在下文中一共展示了VideoStream.more方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: print
# 需要導入模塊: from imutils.video import VideoStream [as 別名]
# 或者: from imutils.video.VideoStream import more [as 別名]
print("Starting live video stream...")
vs = VideoStream(src=0).start()
fileStream = False
time.sleep(1.0)
currentCount = 0
mouse = Mouse()
face_cascade = cv2.CascadeClassifier('res/haarcascade_frontalface_default.xml')
while True:
# if this is a file video stream, then we need to check if
# there any more frames left in the buffer to process
if fileStream and not vs.more():
break
# grab the frame from the threaded video file stream, resize
# it, and convert it to grayscale
# channels)
frame = vs.read()
frame = imutils.resize(frame, width=450)
height, width, c = frame.shape
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.circle(frame, ((int)(width/2),(int)(height/2)), 4, (0,0,255), 2)
cv2.circle(frame, ((int)(width/2),(int)(height/2)), 20, (128,0,128), 2)
face = face_cascade.detectMultiScale(gray, 1.15)