91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

基于樹莓派的動態圖像對比(py3_object_detection.py)

資源截圖

代碼片段和文件信息

#?-*-?coding:?utf-8?-*-
“““
Created?on?Thu?May??7?17:26:11?2020
@author:?fd
Desc:
????this?is?a?demo?for?detecting?moving?objects.?
????the?algorithm?of?frame?differences?is?used.
“““

import?cv2
import?uuid
import?RPI.GPIO?as?GPIO
import?time
??????
????
if?__name__?==?‘__main__‘:????
????led_channel?=?21
????switch_channel?=?10????
????GPIO.setmode(GPIO.BOARD)
????GPIO.setup(led_channel?GPIO.OUT)
????GPIO.setup(switch_channel?GPIO.IN?pull_up_down=GPIO.PUD_UP)
????
????cap?=?cv2.VideoCapture(0)
????frame_width?=?int(cap.get(cv2.CAP_PROP_frame_WIDTH))
????frame_height?=?int(cap.get(cv2.CAP_PROP_frame_HEIGHT))
????
????for?i?in?range(5):
????????GPIO.output(led_channel?GPIO.HIGH)
????????time.sleep(0.2)
????????GPIO.output(led_channel?GPIO.LOW)
????????time.sleep(0.2)
????????
????intervals?=?5
????try:
????????while?True:????????????
????????????if?GPIO.input(switch_channel)?==?GPIO.LOW:
????????????????#?lighten?LED
????????????????GPIO.output

評論

共有 條評論