TrackingjsGaze constructor which uses the trackingjs library in order to find the head and eye positions
- Source:
Methods
detectEyes(workingImage, width, height)
Performs eye detection on the passed working image
Parameters:
Name | Type | Description |
---|---|---|
workingImage |
ImageData | either the whole canvas or the upper half of the head |
width |
number | width of working image |
height |
number | height of working image |
- Source:
detectFace(workingImage, width, height)
Performs face detection on the passed canvas
Parameters:
Name | Type | Description |
---|---|---|
workingImage |
ImageData | whole video canvas |
width |
number | width of imageCanvas |
height |
number | height of imageCanvas |
- Source:
findLargestRectangle(rectangles)
Goes through an array of rectangles and returns the one with the largest area
Parameters:
Name | Type | Description |
---|---|---|
rectangles |
array | array of format [xCoordinate, yCoordinate, width, height] |
- Source:
getEyePatches(imageCanvas, width, height) → {Object}
Isolates the two patches that correspond to the user's eyes
Parameters:
Name | Type | Description |
---|---|---|
imageCanvas |
Canvas | canvas corresponding to the webcam stream |
width |
number | of imageCanvas |
height |
number | of imageCanvas |
- Source:
Returns:
the two eye-patches, first left, then right eye
- Type
- Object