Skip to Content
Hands-On Edge Analytics with Azure IoT
book

Hands-On Edge Analytics with Azure IoT

by Colin Dow
May 2020
Intermediate to advanced
262 pages
6h 48m
English
Packt Publishing
Content preview from Hands-On Edge Analytics with Azure IoT

The Camera script

The Camera script uses the Face class and the Message class to identify a person and send out a message respectively. The Camera script makes use of the OpenCV library.

To create the script, do the following:

  1. In Thonny, create a new Python file in the project folder (Smart Doorbell).
  2. Copy the following code and save the file as Camera.py:
import cv2from Face import Facefrom Message import Messagefrom time import sleepcap = cv2.VideoCapture(0) text_position = (10, 30)font = cv2.FONT_HERSHEY_SIMPLEXscale = 1colour = (255, 255, 255)face = Face("faces")message = Message()while(True):    ret, frame = cap.read()    name = face.get_name(frame, source_type="video")        if name:        cv2.putText(frame, name, text_position, font, scale, \ colour) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Azure IoT Edge Computing: Extending the Cloud to the Intelligent Edge

Beginning Azure IoT Edge Computing: Extending the Cloud to the Intelligent Edge

David Jensen

Publisher Resources

ISBN: 9781838829902Supplemental Content