FaceChannel.FaceChannelV1 Image Processing Util Definition
FaceChannel.FaceChannelV1.imageProcessingUtil module
imageProcessingUtil.py
Image processing module used by the FaceChannelV1
- class FaceChannel.FaceChannelV1.imageProcessingUtil.imageProcessingUtil
Bases:
object
- currentFaceDetectionFrequency = -1
A counter to identify which is the current frame for face detection
- detectFace(image, multiple=False)
Detect a face using the cv2 face detector. It detects a face every “faceDetectionMaximumFrequency” frames.
- Parameters
image – ndarray with the image to be processed.
multiple – allows the code to detect multiple faces in one single frame
- Returns
dets: the tuple of the position of the recognized face. using the format: startX, startY, endX, endY. A list if multiple faces are detected.
- Return type
ndarray
- Returns
face: the image of the detected face. A list if multiple feces are detected.
- Return type
ndarray
- faceDetectionMaximumFrequency = 10
Search for a new face every x frames.
- property faceDetector
get the cv2 face detector
- preProcess(image, imageSize=(64, 64))
Pre-process an image to make it ready to be used as input to the FaceChannelV1
- Parameters
image – ndarray with the image to be processed.
imageSize – tuple with the final image size, default is (64x64)
- Returns
The pre-processed image
- Return type
ndarray
- previouslyDetectedface = None
Identify if in the previous frame, a face was detected