facedetect

package
v0.0.0-...-919b350 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedImageFormat is returned by FaceDetector.DetectFaces calls when given image format is unsupported.
	ErrUnsupportedImageFormat = fmt.Errorf("unsupported image format")

	// ErrImageError is returned by FaceDetector.DetectFaces calls when face detector is unable to decode the image.
	ErrImageError = fmt.Errorf("error loading image")
)

Functions

This section is empty.

Types

type Bounds

type Bounds struct {
	X      int `json:"x"`
	Y      int `json:"y"`
	Height int `json:"height"`
	Width  int `json:"width"`
}

Bounds contains the position and size of face boundaries rectangle.

type Face

type Face struct {
	Bounds   *Bounds `json:"bounds"`
	Mouth    *Point  `json:"mouth,omitempty"`
	RightEye *Point  `json:"right_eye,omitempty"`
	LeftEye  *Point  `json:"left_eye,omitempty"`
}

Face is a container for face boundaries and positions of facial features.

type FaceDetector

type FaceDetector interface {
	DetectFaces(ctx context.Context, img io.Reader) ([]Face, error)
}

FaceDetector performs the image analysis and returns the list of detected faces with facial features.

type Point

type Point struct {
	X int `json:"x"`
	Y int `json:"y"`
}

Point is used to locate the facial features on an image.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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