Documentation ¶
Index ¶
- type Canvas
- type Detector
- func (d *Detector) DetectFaces(pixels []uint8, width, height int) [][]int
- func (d *Detector) DetectLandmarkPoints(leftEye, rightEye *pigo.Puploc) [][]int
- func (d *Detector) DetectLeftPupil(results []int) *pigo.Puploc
- func (d *Detector) DetectRightPupil(results []int) *pigo.Puploc
- func (d *Detector) GetNoseCoordinates(leftEye, rightEye *pigo.Puploc) (int, int)
- func (d *Detector) Log(args ...interface{})
- func (d *Detector) ParseCascade(path string) ([]byte, error)
- func (d *Detector) UnpackCascades() error
- type FlpCascade
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
Canvas struct holds the Javascript objects needed for the Canvas creation
func (*Canvas) Alert ¶
func (c *Canvas) Alert(args ...interface{})
Alert calls the `alert` Javascript function
func (*Canvas) InitWebSocket ¶
func (c *Canvas) InitWebSocket()
InitWebSocket initializes the websocket connection.
func (*Canvas) Log ¶
func (c *Canvas) Log(args ...interface{})
Log calls the `console.log` Javascript function
func (*Canvas) Render ¶
Render calls the `requestAnimationFrame` Javascript function in asynchronous mode.
func (*Canvas) StartWebcam ¶
StartWebcam reads the webcam data and feeds it into the canvas element. It returns an empty struct in case of success and error in case of failure.
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector struct holds the main components of the fetching operation.
func (*Detector) DetectFaces ¶
DetectFaces runs the cluster detection over the webcam frame received as a pixel array and returns the detected faces.
func (*Detector) DetectLandmarkPoints ¶
DetectLandmarkPoints detects the landmark points
func (*Detector) DetectLeftPupil ¶
DetectLeftPupil detects the left pupil
func (*Detector) DetectRightPupil ¶
DetectRightPupil detects the right pupil
func (*Detector) GetNoseCoordinates ¶
GetNoseCoordinates retrieves the nose coordinates by using the LP93 cascase file. We are using the nose as a reference point, because it provides the most accurate position of the head.
func (*Detector) Log ¶
func (d *Detector) Log(args ...interface{})
Log calls the `console.log` Javascript function
func (*Detector) ParseCascade ¶
ParseCascade loads and parse the cascade file through the Javascript `location.href` method, using the `js/syscall` package. It will return the cascade file encoded into a byte array.
func (*Detector) UnpackCascades ¶
UnpackCascades unpack the cascade files.
type FlpCascade ¶
type FlpCascade struct { *pigo.PuplocCascade // contains filtered or unexported fields }
FlpCascade holds the binary representation of the facial landmark points cascade files