drawer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultBorderColor default drawer border color
	DefaultBorderColor = common.Green
	// DefaultKeypointColor default drawer keypoint color
	DefaultKeypointColor = common.Pink
	// DefaultBorderStrokeWidth default drawer border stroke width
	DefaultBorderStrokeWidth = 3
	// DefaultKeypointRadius default drawer keypoint radius
	DefaultKeypointRadius = 2
	// DefaultKeypointStrokeWidth default drawer keypoint stroke width
	DefaultKeypointStrokeWidth = 2
	// DefaultInvalidBorderColor default drawer invalid border color
	DefaultInvalidBorderColor = common.Red
	// DefaultLabelColor default label color
	DefaultLabelColor = common.White
)

Variables

This section is empty.

Functions

func EulrToAxisPoints

func EulrToAxisPoints(yaw float64, pitch float64, roll float64, distance float64) [3][2]float64

EulrToAxisPoints returns a transformation roll/pitch/yaw to Axis in 2d intrinsic rotations around the (local) axis Y, X, Z, in that order.

Types

type Drawer

type Drawer struct {
	// BorderColor represents face rect border color
	BorderColor string
	// KeypointColor represents keypoint color
	KeypointColor string
	// BorderStrokeWidth represents face rect stroke width
	BorderStrokeWidth float64
	// KeypointRadius represents keypoints circle radius
	KeypointRadius float64
	// KeypointStrokeWidth represents keypoints stroke width
	KeypointStrokeWidth float64
	// MaskColor represents border color which mask is true
	MaskColor string
	// InvalidBorderColor
	InvalidBorderColor string
	// LabelColor string
	LabelColor string
	// Font
	Font *common.Font
}

Drawer represents a face drawer

func New

func New(options ...Option) *Drawer

New returns a new Drawer

func (*Drawer) Draw

func (d *Drawer) Draw(img image.Image, faces []face.FaceInfo) image.Image

Draw draw faces

func (*Drawer) DrawHeadPose

func (d *Drawer) DrawHeadPose(img image.Image, pose face.HeadPose, rect common.Rectangle) image.Image

DrawHeadPose draw head pose

func (*Drawer) DrawLandmark

func (d *Drawer) DrawLandmark(img image.Image, points []common.Point) image.Image

DrawLandmark draw landmark

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option represents Drawer option interface

func WithBorderColor

func WithBorderColor(color string) Option

WithBorderColor set Drawer BorderColor

func WithBorderStrokeWidth

func WithBorderStrokeWidth(w float64) Option

WithBorderStrokeWidth set Drawer BorderStrokeWidth

func WithFont added in v1.0.1

func WithFont(font *common.Font) Option

WithFont set Drawer Font

func WithInvalidBorderColor

func WithInvalidBorderColor(color string) Option

WithInvalidBorderColor set Drawer InvalidBorderColor

func WithKeypointColor

func WithKeypointColor(color string) Option

WithKeypointColor set Drawer KeypointColor

func WithKeypointRadius

func WithKeypointRadius(r float64) Option

WithKeypointRadius set Drawer KeypointRadius

func WithKeypointStrokeWidth

func WithKeypointStrokeWidth(w float64) Option

WithKeypointStrokeWidth set Drawer KeypointStrokeWidth

func WithLabelColor added in v1.0.1

func WithLabelColor(color string) Option

WithLabelColor set Drawer LabelColor

func WithMaskColor

func WithMaskColor(color string) Option

WithMaskColor set Drawer MaskColor

Jump to

Keyboard shortcuts

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