Watcher device to capture and process inbound video stream for objects and faces.
__init__(self, parent=None, classifierFile=None, recognizerFile=None, namesFile=None, trainingSourceFolder=None, videoDeviceIndex=0, framesPerSecond=29.97, orientation=0, callback=None)
special
Watcher Initialization
Parameters: |
classifierFile (str ) – Classifier file such as haarcascades to identify generic objects.
recognizerFile (str ) – Trained file to be used to identify specific objects. (optional)
namesFile (str ) – File with friendly names tied to recognizer trained data set. (optional)
trainingSourceFolder (str ) – The source directory that contains all the images to use for building a new recognizerFile.
videoDeviceIndex (int ) – Video Device identifier. (optional)
framesPerSecond (float ) – Number of frames per second. Defaults to NTSC.
orientation (int ) – Device orientation which can be 0, 90, 180, or 270. (optional)
videoDeviceIndex (int ) – Video device index number. If not set then will use default video capture device.
callback (function ) – Callback function for which to send any captured data.
parent (object ) – Containing object's reference. Normally this would be the device container. (optional)
|
isRunning(self)
Identifies if the device is actively running.
snapshot(self, httpRequest)
Displays the snapshot from the last frame
start(self, httpRequest=None, useThreads=True)
stop(self, httpRequest=None)
stream(self, httpRequest)
Adds a streaming client to the watcher device for MJPEG streaming output
train(self, httpRequest=None, trainingSourceFolder=None)
Retrains the face recognition based on images in the supplied folder
Parameters: |
httpRequest (KHTTPHandler ) – Handler for inbound request. Not used.
trainingSourceFolder (str ) – The source directory that contains all the images to use for building a new
recognizerFile. Will use the configuration value if the input value is left
empty. (optional)
|
wait(self, seconds=0)
Waits for any active watchers to complete before closing.