Documentation ¶
Overview ¶
Package common .
Index ¶
- Constants
- Variables
- func CObjectInfoVectiorLength(c *C.ObjectInfoVector) int
- func CObjectInfoVectorPtr(c *C.ObjectInfoVector) unsafe.Pointer
- func ColorFromHex(hexColor string) color.RGBA
- func CreateGPUInstance() int
- func DestroyEstimator(e Estimator)
- func DestroyGPUInstance()
- func DrawCircle(gc *draw2dimg.GraphicContext, pt Point, r float64, borderColor string, ...)
- func DrawLabel(gc *draw2dimg.GraphicContext, font *Font, label string, pt Point, ...)
- func DrawLabelInWidth(gc *draw2dimg.GraphicContext, font *Font, label string, pt Point, ...)
- func DrawRectangle(gc *draw2dimg.GraphicContext, rect Rectangle, borderColor string, ...)
- func EstimatorLoadModel(e Estimator, modelPath string) error
- func FreeCBytes(c *C.Bytes)
- func FreeCFloatVector(c *C.FloatVector)
- func FreeCImage(c *C.Image)
- func FreeCKeypointVector(points *C.KeypointVector)
- func FreeCObjectInfoVector(p *C.ObjectInfoVector)
- func FreeCPalmObjectVector(p *C.PalmObjectVector)
- func FreeCPoint2fVector(c *C.Point2fVector)
- func FreeCPoint3dVector(c *C.Point3dVector)
- func GetBigCPUCount() int
- func GetGPUCount() int
- func GoBytes(c *C.Bytes) []byte
- func GoFloatVector(cVector *C.FloatVector) []float64
- func GoImage(c *C.Image, out *Image)
- func Image2BGR(buf io.Writer, img image.Image)
- func Image2RGB(buf io.Writer, img image.Image)
- func Image2RGBA(buf io.Writer, img image.Image)
- func NewCBytes() *C.Bytes
- func NewCFloatVector() *C.FloatVector
- func NewCImage() *C.Image
- func NewCKeypointVector() *C.KeypointVector
- func NewCObjectInfoVector() *C.ObjectInfoVector
- func NewCPalmObjectVector() *C.PalmObjectVector
- func NewCPoint2fVector() *C.Point2fVector
- func NewCPoint3dVector() *C.Point3dVector
- func NewFontCache(fontFolder string) *draw2d.SyncFolderFontCache
- func NewImageFromBytes(data []byte, w int, h int, channels int, out *Image)
- func SetEstimatorLightMode(e Estimator, mode bool)
- func SetEstimatorThreads(e Estimator, n int)
- func SetOMPThreads(n int)
- type Estimator
- type Font
- type Image
- type Keypoint
- type ObjectInfo
- type PalmObject
- type Point
- type Point3d
- type Rectangle
Constants ¶
const ( White = "#FFFFFF" Black = "#000000" Gray = "#333333" Green = "#64DD17" Pink = "#E91E63" Red = "#FF1744" Blue = "#2196F3" )
Variables ¶
var FullRect = Rect(0, 0, 1, 1)
var ZP = Point{}
var ZP3d = Point3d{}
var ZR = Rectangle{}
Functions ¶
func CObjectInfoVectiorLength ¶
func CObjectInfoVectiorLength(c *C.ObjectInfoVector) int
CObjectInfoVectiorLength get C.ObjectInfoVector length
func CObjectInfoVectorPtr ¶
func CObjectInfoVectorPtr(c *C.ObjectInfoVector) unsafe.Pointer
CObjectInfoVectorPtr get C.ObjectInfoVector start pointer
func DrawCircle ¶
func DrawCircle(gc *draw2dimg.GraphicContext, pt Point, r float64, borderColor string, bgColor string, strokeWidth float64)
DrawCircle draw circle on image
func DrawLabel ¶ added in v1.0.1
func DrawLabel(gc *draw2dimg.GraphicContext, font *Font, label string, pt Point, txtColor string, bgColor string, scale float64)
DrawLabel draw label text to image
func DrawLabelInWidth ¶ added in v1.0.1
func DrawLabelInWidth(gc *draw2dimg.GraphicContext, font *Font, label string, pt Point, txtColor string, bgColor string, boundWidth float64)
DrawLabelInWidth draw label text to image in width restrict
func DrawRectangle ¶
func DrawRectangle(gc *draw2dimg.GraphicContext, rect Rectangle, borderColor string, bgColor string, strokeWidth float64)
DrawRectangle draw rectangle on image
func EstimatorLoadModel ¶
EstimatorLoadModel load detecter model
func FreeCBytes ¶
func FreeCFloatVector ¶
func FreeCFloatVector(c *C.FloatVector)
FreeCFloatVector release C.FloatVector memory
func FreeCKeypointVector ¶
func FreeCKeypointVector(points *C.KeypointVector)
FreeCKeypointVector release *C.KeypointVector memory
func FreeCObjectInfoVector ¶
func FreeCObjectInfoVector(p *C.ObjectInfoVector)
FreeCObjectInfoVector release *C.ObjectInfoVector memory
func FreeCPalmObjectVector ¶ added in v1.0.1
func FreeCPalmObjectVector(p *C.PalmObjectVector)
FreeCPalmObjectVector release *C.PalmObjectVector memory
func FreeCPoint2fVector ¶
func FreeCPoint2fVector(c *C.Point2fVector)
FreeCPoint2fVector release C.Point2fVector memory
func FreeCPoint3dVector ¶ added in v1.0.1
func FreeCPoint3dVector(c *C.Point3dVector)
FreeCPoint3dVector release C.Point3dVector memory
func GoFloatVector ¶
func GoFloatVector(cVector *C.FloatVector) []float64
GoFloatVector convert C.FloatVector to []float64
func Image2RGBA ¶
Image2RGBA write image rgbdata to buffer
func NewCFloatVector ¶
func NewCFloatVector() *C.FloatVector
NewCFloatVector returns C.FloatVector pointer
func NewCKeypointVector ¶
func NewCKeypointVector() *C.KeypointVector
NewCKeypointVector returns *C.KeypointVector
func NewCObjectInfoVector ¶
func NewCObjectInfoVector() *C.ObjectInfoVector
NewCObjectInfoector returns *C.ObjectInfoVector
func NewCPalmObjectVector ¶ added in v1.0.1
func NewCPalmObjectVector() *C.PalmObjectVector
NewCPalmObjectVector returns *C.PalmObjectVector
func NewCPoint2fVector ¶
func NewCPoint2fVector() *C.Point2fVector
NewCPoint2fVector retruns C.Point2fVector pointer
func NewCPoint3dVector ¶ added in v1.0.1
func NewCPoint3dVector() *C.Point3dVector
NewCPoint3dVector retruns C.Point3dVector pointer
func NewFontCache ¶ added in v1.0.1
func NewFontCache(fontFolder string) *draw2d.SyncFolderFontCache
NewFontCache load font cache
func NewImageFromBytes ¶
NewImageFromBytes returns Image by []byte
func SetEstimatorLightMode ¶
SetEstimatorLightMode set ncnn net opt.lightmode
func SetEstimatorThreads ¶
SetEstimatorThreads set ncnn net opt.num_threads
Types ¶
type Font ¶ added in v1.0.1
type Font struct { // Cache FontCache Cache draw2d.FontCache // Size font size Size float64 `json:"size,omitempty"` // Data font setting Data *draw2d.FontData `json:"data,omitempty"` // Font Font *truetype.Font `json:"-"` }
Font font info
type Image ¶
Image image with buffer cache
type Keypoint ¶
type Keypoint struct { // Point keypoint location Point Point // Score keypoint prob Score float32 }
Keypoint represents detected body keypoint
func GoKeypoint ¶
GoKeypoint convert C.Keypoint to go type
func GoKeypointVector ¶
func GoKeypointVector(c *C.KeypointVector, w float64, h float64) []Keypoint
GoKeypointVector convert *C.KeypointVector to Keypoint slice
type ObjectInfo ¶
type ObjectInfo struct { // Score detected score Score float32 // Label Label int // Rect roi location Rect Rectangle // Points keypoints Keypoints []Keypoint // Name Name string }
ObjectInfo represents detected roi object info
func GoObjectInfo ¶
func GoObjectInfo(c *C.ObjectInfo, w float64, h float64) ObjectInfo
GoObjectInfo convert C.ObjectInfo to go type
func GoObjectInfoVector ¶
func GoObjectInfoVector(c *C.ObjectInfoVector, w float64, h float64) []ObjectInfo
GoObjectInfoVector convert *C.ObjectInfoVector to ROI slice
func (ObjectInfo) ToCObjectInfo ¶
func (o ObjectInfo) ToCObjectInfo(w float64, h float64) *C.ObjectInfo
ToCObjectInfo returns ObjectInfo C type
type PalmObject ¶ added in v1.0.1
type PalmObject struct { Name string Score float64 Rotation float64 RectPoints []Point Landmarks []Point Skeleton []Point Skeleton3d []Point3d }
PalmObject
func GoPalmObject ¶ added in v1.0.1
func GoPalmObject(cObj *C.PalmObject, w float64, h float64) PalmObject
GoPalmObject convert C.PalmObject to Go type
func GoPalmObjectVector ¶ added in v1.0.1
func GoPalmObjectVector(c *C.PalmObjectVector, w float64, h float64) []PalmObject
type Point ¶
Point represents a Point
func GoPoint2fVector ¶
func GoPoint2fVector(cVector *C.Point2fVector, w float64, h float64) []Point
GoPoint2fVector convert C.Point2fVector to []Point
type Point3d ¶ added in v1.0.1
Point3d represents a 3dPoint
func GoPoint3dVector ¶ added in v1.0.1
func GoPoint3dVector(cVector *C.Point3dVector) []Point3d
GoPoint3dVector convert C.Point3dVector to []Point3d