當前位置: 首頁>>代碼示例>>Python>>正文


Python VideoStream.more方法代碼示例

本文整理匯總了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)
開發者ID:mousmik,項目名稱:Mousely,代碼行數:32,代碼來源:eye_detection.py


注:本文中的imutils.video.VideoStream.more方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。