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: 7 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 = 3
	// DefaultKeypointStrokeWidth default drawer keypoint stroke width
	DefaultKeypointStrokeWidth = 1
	// DefaultLabelColor default label color
	DefaultLabelColor = common.White
)

Variables

View Source
var (
	// PoseColors represents color for hand pose
	PoseColors = [6]string{
		"#0ad7ff", "#ff7337", "#05ff37", "#190fff", "#ff0f37", "#aa00ff",
	}
)

Functions

This section is empty.

Types

type Drawer

type Drawer struct {
	// BorderColor represents hand rect border color
	BorderColor string
	// BorderStrokeWidth represents hand rect stroke width
	BorderStrokeWidth float64
	// KeypointStrokeWidth represents keypoints stroke width
	KeypointStrokeWidth float64
	// KeypointRadius represents keypoints circle radius
	KeypointRadius float64
	// KeypointColor represents keypoint color
	KeypointColor string
	// LabelColor string
	LabelColor string
	// Font
	Font *common.Font
}

Drawer represents a hand drawer

func New

func New(options ...Option) *Drawer

New returns a new Drawer

func (*Drawer) Draw

func (d *Drawer) Draw(img image.Image, rois []common.ObjectInfo, drawBorder bool) image.Image

Draw draw rois

func (*Drawer) DrawPalm added in v1.0.1

func (d *Drawer) DrawPalm(img image.Image, rois []common.PalmObject) image.Image

DrawPalm draw PalmObject

func (*Drawer) DrawPalm3D added in v1.0.1

func (d *Drawer) DrawPalm3D(roi common.PalmObject, size float64, bg string) image.Image

DrawPalm3D draw 3d PalmObject

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 WithKeypointColor added in v1.0.1

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

Jump to

Keyboard shortcuts

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