facetrack

package
v0.0.0-...-524a0d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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 NewCanvas

func NewCanvas() *Canvas

NewCanvas creates and initializes the new Canvas element

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

func (c *Canvas) Render() error

Render calls the `requestAnimationFrame` Javascript function in asynchronous mode.

func (*Canvas) Send

func (c *Canvas) Send(value string)

Send sends the value through the socket.

func (*Canvas) StartWebcam

func (c *Canvas) StartWebcam() (*Canvas, error)

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.

func (*Canvas) Stop

func (c *Canvas) Stop()

Stop stops the rendering.

type Detector

type Detector struct {
	// contains filtered or unexported fields
}

Detector struct holds the main components of the fetching operation.

func NewDetector

func NewDetector() *Detector

NewDetector initializes a new constructor function.

func (*Detector) DetectFaces

func (d *Detector) DetectFaces(pixels []uint8, width, height int) [][]int

DetectFaces runs the cluster detection over the webcam frame received as a pixel array and returns the detected faces.

func (*Detector) DetectLandmarkPoints

func (d *Detector) DetectLandmarkPoints(leftEye, rightEye *pigo.Puploc) [][]int

DetectLandmarkPoints detects the landmark points

func (*Detector) DetectLeftPupil

func (d *Detector) DetectLeftPupil(results []int) *pigo.Puploc

DetectLeftPupil detects the left pupil

func (*Detector) DetectRightPupil

func (d *Detector) DetectRightPupil(results []int) *pigo.Puploc

DetectRightPupil detects the right pupil

func (*Detector) GetNoseCoordinates

func (d *Detector) GetNoseCoordinates(leftEye, rightEye *pigo.Puploc) (int, int)

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

func (d *Detector) ParseCascade(path string) ([]byte, error)

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

func (d *Detector) UnpackCascades() error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL