本文整理汇总了Python中Camera.getIMG方法的典型用法代码示例。如果您正苦于以下问题:Python Camera.getIMG方法的具体用法?Python Camera.getIMG怎么用?Python Camera.getIMG使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.getIMG方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getResetBG
# 需要导入模块: import Camera [as 别名]
# 或者: from Camera import getIMG [as 别名]
timeOfLastSound = time.time()
#Show the banner, if we're supposed to
if showBanner:
cv2.rectangle(frame, (0,0), (320, 30), (0,0,255), -1)
cv2.putText(frame, "Movement Detected", (0,25), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255), 2)
#Activate/Deactivate the banner every 0.5 seconds
if time.time() - timeOfLastFlash > 0.5: #"""map(differenceScore, warningThreshold, warningThreshold * 2, 2, 1)"""
showBanner = not showBanner
timeOfLastFlash = time.time()
return frame
getResetBG() #Setup the background subtractor
#Some test code, only to be run when this isn't being used as a library
if __name__ == "__main__":
while True:
#ret, frame = cap.read()
frame = Camera.getIMG()
fgmask = fgbg.apply(frame)
#res = cv2.bitwise_and(frame, frame, mask = fgmask)
res = processDifference(frame)
cv2.imshow('img', res)
if cv2.waitKey(20) == 27:
break
cv2.destroyAllWindows()