本文整理汇总了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)