facedetector

package
v0.0.0-...-57b8584 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: GPL-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToRGBA

func ConvertToRGBA(in image.Image) *image.RGBA

func DrawRect

func DrawRect(x1, y1, x2, y2, thickness int, img *image.RGBA)

Types

type ConfigHaarcascade

type ConfigHaarcascade struct {
	Stages []*Stage
}

type FaceDetector

type FaceDetector struct {
	ClassifiedSize []int
	Width          int
	Height         int
	FoundRects     []*FoundRect
	Image          image.Image
	FinalImage     image.Image
}

func NewFaceDetector

func NewFaceDetector(in interface{}, opencvfile string) *FaceDetector

func NewFaceDetectorFromImage

func NewFaceDetectorFromImage(imgData image.Image, opencvfile string) *FaceDetector

func NewFaceDetectorImagePath

func NewFaceDetectorImagePath(imagePath string, opencvfile string) *FaceDetector

func (*FaceDetector) DrawFaces

func (f *FaceDetector) DrawFaces() *image.RGBA

func (*FaceDetector) DrawImageInDirectory

func (face *FaceDetector) DrawImageInDirectory(directory string) []string

func (*FaceDetector) DrawOnImage

func (face *FaceDetector) DrawOnImage()

func (*FaceDetector) Equals

func (f *FaceDetector) Equals(r1 *FoundRect, r2 *FoundRect) bool

func (*FaceDetector) GetFaces

func (f *FaceDetector) GetFaces() []*FoundRect

type Feature

type Feature struct {
	Tilted float64 `xml:"tiltded"`
	Rects  []*Rect `xml:"rects"`
}

func (*Feature) Add

func (f *Feature) Add(rect *Rect)

type FoundRect

type FoundRect struct {
	X      int
	Y      int
	Width  int
	Height int
}

func (*FoundRect) ToString

func (f *FoundRect) ToString() string

type HaarcascadeFrontalfaceDefault

type HaarcascadeFrontalfaceDefault struct {
	Stages *Stages `xml:"stages"`
}

type OpenCVFile

type OpenCVFile struct {
	OpenCVStorage *OpenCVStorage `xml:"opencv_storage"`
}

type OpenCVStorage

type OpenCVStorage struct {
	Haarcascade *HaarcascadeFrontalfaceDefault `xml:"haarcascade_frontalface_default"`
}

type Rect

type Rect struct {
	V     []string `xml:"_"`
	Rects []*RectValue
}

func (*Rect) Parse

func (r *Rect) Parse()

type RectValue

type RectValue struct {
	X1     int
	Y1     int
	X2     int
	Y2     int
	Weight float64
}

type RootNode

type RootNode struct {
	Feature   *Feature `xml:"feature"`
	Threshold float64  `xml:"threshold"`
	LeftVal   float64  `xml:"left_val"`
	RightVal  float64  `xml:"right_val"`
}

func (*RootNode) GetVal

func (r *RootNode) GetVal(grayImage [][]float64, square [][]float64, i int, j int, scale float64) float64

type Stage

type Stage struct {
	Trees     *Trees  `xml:"trees"`
	Threshold float64 `xml:"stage_threshold"`
}

func (*Stage) Parse

func (s *Stage) Parse()

func (*Stage) Pass

func (s *Stage) Pass(grayImage [][]float64, square [][]float64, i int, j int, scale float64) bool

type Stages

type Stages struct {
	Stage []*Stage `xml:"_"`
}

func (*Stages) Parse

func (s *Stages) Parse()

type Tree

type Tree struct {
	RootNode *RootNode `xml:"_"`
}

type Trees

type Trees struct {
	Trees []*Tree `xml:"_"`
}

Jump to

Keyboard shortcuts

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