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 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 FreeCPoint2fVector(c *C.Point2fVector)
- func GetBigCPUCount() int
- func GetGPUCount() int
- func GoBytes(c *C.Bytes) []byte
- func GoFloatVector(cVector *C.FloatVector) []float64
- func GoImage(c *C.Image) (image.Image, error)
- 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 NewCPoint2fVector() *C.Point2fVector
- func NewImageFromBytes(data []byte, w int, h int, channels int) (image.Image, error)
- func SetEstimatorLightMode(e Estimator, mode bool)
- func SetEstimatorThreads(e Estimator, n int)
- func SetOMPThreads(n int)
- type Estimator
- type Image
- type Keypoint
- type ObjectInfo
- type Point
- type Rectangle
Constants ¶
const ( Green = "#64DD17" Pink = "#E91E63" Red = "#FF1744" Blue = "#2196F3" )
Variables ¶
var ZP = Point{}
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 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 FreeCImage ¶
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 FreeCPoint2fVector ¶
func FreeCPoint2fVector(c *C.Point2fVector)
FreeCPoint2fVector release C.Point2fVector 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 NewCPoint2fVector ¶
func NewCPoint2fVector() *C.Point2fVector
NewCPoint2fVector retruns C.Point2fVector pointer
func NewImageFromBytes ¶
func SetEstimatorLightMode ¶
SetEstimatorLightMode set ncnn net opt.lightmode
func SetEstimatorThreads ¶
SetEstimatorThreads set ncnn net opt.num_threads
Types ¶
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 }
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 Point ¶
Point represents a Point
func GoPoint2fVector ¶
func GoPoint2fVector(cVector *C.Point2fVector, w float64, h float64) []Point
GoPoint2fVector convert C.Point2fVector to []Point