v1.0.3 Latest Latest

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

Go to latest
Published: Aug 22, 2018 License: MIT Imports: 10 Imported by: 40




This section is empty.


This section is empty.


func GetImage

func GetImage(input string) (*image.NRGBA, error)

GetImage retrieves and decodes the image file to *image.NRGBA type.

func ImgToNRGBA

func ImgToNRGBA(img image.Image) *image.NRGBA

ImgToNRGBA converts any image type to *image.NRGBA with min-point at (0, 0).

func RgbToGrayscale

func RgbToGrayscale(src *image.NRGBA) []uint8

RgbToGrayscale converts the image to grayscale mode.


type CascadeParams

type CascadeParams struct {
	MinSize     int
	MaxSize     int
	ShiftFactor float64
	ScaleFactor float64

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

type Detection struct {
	Row   int
	Col   int
	Scale int
	Q     float32

Detection struct contains the detection results composed of the row, column, scale factor and the detection score.

type ImageParams

type ImageParams struct {
	Pixels []uint8
	Rows   int
	Cols   int
	Dim    int

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 NewPigo

func NewPigo() *Pigo

NewPigo instantiate a new pigo struct.

func (*Pigo) ClusterDetections

func (pg *Pigo) ClusterDetections(detections []Detection, iouThreshold float64) []Detection

ClusterDetections returns the intersection over union of multiple clusters. We need to make this comparision to filter out multiple face detection regions.

func (*Pigo) RunCascade

func (pg *Pigo) RunCascade(img ImageParams, opts CascadeParams) []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).

func (*Pigo) Unpack

func (pg *Pigo) Unpack(packet []byte) (*Pigo, error)

Unpack unpack the binary face classification file.

Jump to

Keyboard shortcuts

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