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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBorderColor default drawer border color
	DefaultBorderColor = common.Green
	// DefaultBorderStrokeWidth default drawer border stroke width
	DefaultBorderStrokeWidth = 3
	// DefaultKeypointRadius default drawer keypoint radius
	DefaultKeypointRadius = 2
	// DefaultKeypointStrokeWidth default drawer keypoint stroke width
	DefaultKeypointStrokeWidth = 2
)

Variables

View Source
var (
	// CocoPair represents joints pair
	CocoPair = [16][2]CocoPart{
		{0, 1}, {1, 3}, {0, 2}, {2, 4}, {5, 6}, {5, 7}, {7, 9}, {6, 8}, {8, 10}, {5, 11}, {6, 12}, {11, 12}, {11, 13}, {12, 14}, {13, 15}, {14, 16},
	}

	// OpenPosePair represents joints pair for openpose
	OpenPosePair = [17][2]int{
		{1, 2}, {1, 5}, {2, 3}, {3, 4}, {5, 6},
		{6, 7}, {1, 8}, {8, 9}, {9, 10}, {1, 11},
		{11, 12}, {12, 13}, {1, 0}, {0, 14}, {14, 16},
		{0, 15}, {15, 17},
	}

	// CocoColors represents color for coco parts
	CocoColors = [19]string{
		"#ff0000", "#ff5500", "#ffaa00", "#ffff00",
		"#aaff00", "#55ff00", "#00ff00", "#00ff55", "#00ffaa",
		"#00ffff", "#00aaff", "#0055ff",
		"#0000ff", "#aa00ff", "#ff00ff",
		"#ff00aa", "#ff0055", "#ff55aa", "#aa0055",
	}
)

Functions

This section is empty.

Types

type CocoPart

type CocoPart = int

CocoPart coco part define

const (
	// CocoPartNose nose
	CocoPartNose CocoPart = iota
	// CocoPartLEye left eye
	CocoPartLEye
	// CocoPartREye right eye
	CocoPartREye
	// CocoPartLEar left ear
	CocoPartLEar
	// CocoPartREar right ear
	CocoPartREar
	// CocoPartLShoulder left sholder
	CocoPartLShoulder
	// CocoPartRShoulder right sholder
	CocoPartRShoulder
	// CocoPartLElbow left elbow
	CocoPartLElbow
	// CocoPartRElbow right elbow
	CocoPartRElbow
	// CocoPartLWrist left wrist
	CocoPartLWrist
	// CocoPartRWrist right wrist
	CocoPartRWrist
	// CocoPartLHip left hip
	CocoPartLHip
	// CocoPartRHip right hip
	CocoPartRHip
	// CocoPartLKnee left knee
	CocoPartLKnee
	// CocoPartRKnee right knee
	CocoPartRKnee
	// CocoPartRAnkle right ankle
	CocoPartRAnkle
	// CocoPartLAnkle left ankle
	CocoPartLAnkle
	// CocoPartNeck neck
	CocoPartNeck
	// CocoPartBackground background
	CocoPartBackground
)

type Drawer

type Drawer struct {
	// BorderColor represents face rect border color
	BorderColor string
	// BorderStrokeWidth represents face rect stroke width
	BorderStrokeWidth float64
	// KeypointStrokeWidth represents keypoints stroke width
	KeypointStrokeWidth float64
	// KeypointRadius represents keypoints circle radius
	KeypointRadius float64
}

Drawer represents a pose 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, openPose bool) image.Image

Draw draw rois

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 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