微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 硬件工程师文库 > 利用Dragonbaord 410c开发板搭建具有运动追踪功能摄像头

利用Dragonbaord 410c开发板搭建具有运动追踪功能摄像头

时间:02-10 来源:互联网 点击:

);

   detector = cv2.xfeatures2d.SIFT_create()

   keypoints = detector.detect(gray,None)

   framenext=cv2.drawKeypoints(graynext,keypoints)

# draw the text and timestamp on the frame

   cv2.putText(frame, "Room Status: {}".format(text), (10, 20),

       cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 2)

   cv2.putText(frame, datetime.datetime.now().strftime("%A %d %B %Y%I:%M:%S%p"),

       (10, frame.shape[0] - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.35, (0, 0, 255),1)

   cv2.imshow("Security Feed", frame)

   cv2.imshow("Thresh", thresh)

   cv2.imshow("Frame Delta", frameDelta)

   cv2.imshow("keypoints",framenext)

   #key = cv2.waitKey(1) & 0xFF

   if cv2.waitKey(10) == 27:

       break 

                   camera.release()

    cv2.destroyAllWindows()

         #Send the message via our own SMTP server (sendmail)

    sender = 'from@runoob.com'

    receivers = ['XXXXXXXXXX@thundersoft.com']

    text = MIMEText('Hello Qualcomm my name is NO1','plain','utf-8')

    image_url = "./detected_face.jpg"

     image = MIMEImage(open(image_url,'rb').read())

    image.add_header('Content-ID','<image>')

    message = MIMEMultipart('related')

    message['From'] = Header("workshop",'utf-8')

    message['To'] = Header("Test",'utf-8')

    subject = 'Python SMTP Test'

    message['Subject'] = Header(subject,'utf-8')

    message.attach(text)

    message.attach(image)

try:

         smtpObj=smtplib.SMTP('localhost')

         #smtpObj.set_debuglevel(1)

         smtpObj.sendmail(sender,receivers, message.as_string())

         smtpObj.quit()

         print"done!"

except smtplib.SMTPException:

 print "error:send failed"

三、测试

编写好代码后保存,然后使用Python monition_camera.py命令就可以运行上述代码了,这里我们收到的邮件及附件效果如下,由于涉及到隐私具体的跟踪人体目标就不展示了,大家下载代码实现即可以看到效果。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top