Documentation
¶
Index ¶
- func GetImage(input string) (*image.NRGBA, error)
- func ImgToNRGBA(img image.Image) *image.NRGBA
- func RgbToGrayscale(src image.Image) []uint8
- type CascadeParams
- type Detection
- type FlpCascade
- type ImageParams
- type Pigo
- type Puploc
- type PuplocCascade
- func (plc *PuplocCascade) FindLandmarkPoints(leftEye, rightEye *Puploc, img ImageParams, perturb int, flipV bool) *Puploc
- func (plc *PuplocCascade) ReadCascadeDir(path string) (map[string][]*FlpCascade, error)
- func (plc *PuplocCascade) RunDetector(pl Puploc, img ImageParams, angle float64, flipV bool) *Puploc
- func (plc *PuplocCascade) UnpackCascade(packet []byte) (*PuplocCascade, error)
- func (plc *PuplocCascade) UnpackFlp(cf string) (*PuplocCascade, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImgToNRGBA ¶
ImgToNRGBA converts any image type to *image.NRGBA with min-point at (0, 0).
func RgbToGrayscale ¶
RgbToGrayscale converts the image to grayscale mode.
Types ¶
type CascadeParams ¶
type CascadeParams struct {
MinSize int
MaxSize int
ShiftFactor float64
ScaleFactor float64
ImageParams
}
CascadeParams contains the basic parameters to run the analyzer function over the defined image. MinSize: represents the minimum size of the face. MaxSize: represents the maximum size of the face. ShiftFactor: determines to what percentage to move the detection window over its size. ScaleFactor: defines in percentage the resize value of the detection window when moving to a higher scale.
type Detection ¶
Detection struct contains the detection results composed of the row, column, scale factor and the detection score.
type FlpCascade ¶ added in v1.3.0
type FlpCascade struct {
*PuplocCascade
// contains filtered or unexported fields
}
FlpCascade holds the binary representation of the facial landmark points cascade files
type ImageParams ¶
ImageParams is a struct for image related settings. Pixels: contains the grayscale converted image pixel data. Rows: the number of image rows. Cols: the number of image columns. Dim: the image dimension.
type Pigo ¶
type Pigo struct {
// contains filtered or unexported fields
}
Pigo struct defines the basic binary tree components.
func (*Pigo) ClusterDetections ¶
ClusterDetections returns the intersection over union of multiple clusters. We need to make this comparison to filter out multiple face detection regions.
func (*Pigo) RunCascade ¶
func (pg *Pigo) RunCascade(cp CascadeParams, angle float64) []Detection
RunCascade analyze the grayscale converted image pixel data and run the classification function over the detection window. It will return a slice containing the detection row, column, it's center and the detection score (in case this is greater than 0.0).
type Puploc ¶ added in v1.2.0
Puploc contains all the information resulted from the pupil detection needed for accessing from a global scope.
type PuplocCascade ¶ added in v1.2.0
type PuplocCascade struct {
// contains filtered or unexported fields
}
PuplocCascade is a general struct for storing the cascade tree values encoded into the binary file.
func NewPuplocCascade ¶ added in v1.3.0
func NewPuplocCascade() *PuplocCascade
NewPuplocCascade initializes the PuplocCascade constructor method.
func (*PuplocCascade) FindLandmarkPoints ¶ added in v1.3.0
func (plc *PuplocCascade) FindLandmarkPoints(leftEye, rightEye *Puploc, img ImageParams, perturb int, flipV bool) *Puploc
FindLandmarkPoints detects the facial landmark points based on the pupil localization results.
func (*PuplocCascade) ReadCascadeDir ¶ added in v1.3.0
func (plc *PuplocCascade) ReadCascadeDir(path string) (map[string][]*FlpCascade, error)
ReadCascadeDir reads the facial landmark points cascade files from the provided directory.
func (*PuplocCascade) RunDetector ¶ added in v1.2.0
func (plc *PuplocCascade) RunDetector(pl Puploc, img ImageParams, angle float64, flipV bool) *Puploc
RunDetector runs the pupil localization function.
func (*PuplocCascade) UnpackCascade ¶ added in v1.2.0
func (plc *PuplocCascade) UnpackCascade(packet []byte) (*PuplocCascade, error)
UnpackCascade unpacks the pupil localization cascade file.
func (*PuplocCascade) UnpackFlp ¶ added in v1.3.0
func (plc *PuplocCascade) UnpackFlp(cf string) (*PuplocCascade, error)
UnpackFlp unpacks the facial landmark points cascade file. This will return the binary representation of the cascade file.