May 2020
Intermediate to advanced
262 pages
6h 48m
English
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:
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) ...