Documentation ¶
Index ¶
- Constants
- func Activation(appId, sdkKey string) (err error)
- func OnlineActivation(appId, sdkKey string) (err error)
- type ActiveFileInfo
- type AgeInfo
- type EngineError
- type Face3DAngle
- type FaceEngine
- func (engine *FaceEngine) Destroy() error
- func (engine *FaceEngine) DetectFaces(width, height int, format C.MInt32, imgData []byte) (faceInfo MultiFaceInfo, err error)
- func (engine *FaceEngine) FaceFeatureCompare(feature1, feature2 FaceFeature) (float32, error)
- func (engine *FaceEngine) FaceFeatureExtract(width, height int, format C.MInt32, imgData []byte, faceInfo SingleFaceInfo) (faceFeature FaceFeature, err error)
- func (engine *FaceEngine) GetAge() (AgeInfo, error)
- func (engine *FaceEngine) GetFace3DAngle() (Face3DAngle, error)
- func (engine *FaceEngine) GetGender() (GenderInfo, error)
- func (engine *FaceEngine) GetLivenessScore() (LivenessInfo, error)
- func (engine *FaceEngine) GetLivenessScoreIR() (LivenessInfo, error)
- func (engine *FaceEngine) GetVersion() Version
- func (engine *FaceEngine) Process(width, height int, format C.MInt32, imgData []byte, ...) error
- func (engine *FaceEngine) ProcessIR(width, height int, format C.MInt32, imgData []byte, ...) error
- func (engine *FaceEngine) SetLivenessParam(threshold LivenessThreshold) error
- type FaceFeature
- type GenderInfo
- type LivenessInfo
- type LivenessThreshold
- type MultiFaceInfo
- type Rect
- type SingleFaceInfo
- type Version
Constants ¶
View Source
const ( DetectModeVideo = C.ASF_DETECT_MODE_VIDEO DetectModeImage = C.ASF_DETECT_MODE_IMAGE OrientPriority0 = C.ASF_OP_0_ONLY OrientPriority90 = C.ASF_OP_90_ONLY OrientPriority270 = C.ASF_OP_270_ONLY OrientPriority180 = C.ASF_OP_180_ONLY OrientPriorityAllOut = C.ASF_OP_ALL_OUT EnableNone = C.ASF_NONE EnableFaceDetect = C.ASF_FACE_DETECT EnableFaceRecognition = C.ASF_FACERECOGNITION EnableAge = C.ASF_AGE EnableGender = C.ASF_GENDER EnableFace3DAngle = C.ASF_FACE3DANGLE EnableLiveness = C.ASF_LIVENESS EnableIRLiveness = C.ASF_IR_LIVENESS ColorFormatBGR24 = C.ASVL_PAF_RGB24_B8G8R8 ColorFormatNV12 = C.ASVL_PAF_NV12 ColorFormatNV21 = C.ASVL_PAF_NV21 ColorFormatI420 = C.ASVL_PAF_I420 ColorFormatYUYV = C.ASVL_PAF_YUYV )
Variables ¶
This section is empty.
Functions ¶
func Activation ¶
在线激活接口,该接口与ASFOnlineActivation接口功能一致,推荐使用该接口
Types ¶
type ActiveFileInfo ¶
type ActiveFileInfo struct { StartTime string //开始时间 EndTime string //截止时间 Platform string //平台 SdkType string //sdk类型 AppId string //APPID SdkKey string //SDKKEY SdkVersion string //SDK版本号 FileVersion string //激活文件版本号 }
激活文件信息结构体
type EngineError ¶ added in v3.0.6
SDK错误码
type Face3DAngle ¶
type Face3DAngle struct { Roll []float32 Yaw []float32 Pitch []float32 Status []int32 // 0: 正常,其他数值:出错 Num int32 }
人脸3D角度信息结构体
type FaceEngine ¶
type FaceEngine struct {
// contains filtered or unexported fields
}
引擎结构体
func NewFaceEngine ¶
func NewFaceEngine(dm, op uint32, faceScale, maxFaceNum, combinedMask C.MInt32) (*FaceEngine, error)
创建一个新的引擎实例
如果调用初始化函数失败则返回一个错误
func (*FaceEngine) DetectFaces ¶
func (engine *FaceEngine) DetectFaces(width, height int, format C.MInt32, imgData []byte) (faceInfo MultiFaceInfo, err error)
人脸检测,目前不支持IR图像数据检测
func (*FaceEngine) FaceFeatureCompare ¶
func (engine *FaceEngine) FaceFeatureCompare(feature1, feature2 FaceFeature) (float32, error)
人脸特征比对
func (*FaceEngine) FaceFeatureExtract ¶ added in v3.0.5
func (engine *FaceEngine) FaceFeatureExtract(width, height int, format C.MInt32, imgData []byte, faceInfo SingleFaceInfo) (faceFeature FaceFeature, err error)
单人脸特征提取
func (*FaceEngine) GetFace3DAngle ¶
func (engine *FaceEngine) GetFace3DAngle() (Face3DAngle, error)
获取3D角度信息
func (*FaceEngine) GetLivenessScore ¶
func (engine *FaceEngine) GetLivenessScore() (LivenessInfo, error)
获取RGB活体结果
func (*FaceEngine) GetLivenessScoreIR ¶
func (engine *FaceEngine) GetLivenessScoreIR() (LivenessInfo, error)
获取IR活体结果
func (*FaceEngine) Process ¶
func (engine *FaceEngine) Process(width, height int, format C.MInt32, imgData []byte, detectedFaces MultiFaceInfo, combinedMask C.MInt32) error
年龄/性别/人脸3D角度(该接口仅支持RGB图像),最多支持4张人脸信息检测,超过部分返回未知 RGB活体仅支持单人脸检测,该接口不支持检测IR活体
func (*FaceEngine) ProcessIR ¶
func (engine *FaceEngine) ProcessIR(width, height int, format C.MInt32, imgData []byte, detectedFaces MultiFaceInfo, combinedMask C.MInt32) error
该接口目前仅支持单人脸IR活体检测(不支持年龄、性别、3D角度的检测),默认取第一张人脸
func (*FaceEngine) SetLivenessParam ¶
func (engine *FaceEngine) SetLivenessParam(threshold LivenessThreshold) error
设置活体置信度
取值范围[0-1]内部默认数值RGB-0.75,IR-0.7, 用户可以根据实际需求,设置不同的阈值
type FaceFeature ¶
type FaceFeature struct { Feature []byte // 人脸特征信息 FeatureSize int32 // 人脸特征信息长度 // contains filtered or unexported fields }
人脸特征结构体
type GenderInfo ¶
type GenderInfo struct { GenderArray []int32 // "0" 表示 男性, "1" 表示 女性, "-1" 表示不确定 Num int32 // 检测的人脸个数 }
性别信息结构体
type LivenessInfo ¶
活体信息
type LivenessThreshold ¶
活体置信度结构体
type MultiFaceInfo ¶
type MultiFaceInfo struct { FaceRect []Rect // 人脸框信息 FaceOrient []int32 // 输入图像的角度 FaceNum int32 // 检测到的人脸个数 FaceID []int32 // face ID,IMAGE模式下不返回FaceID // contains filtered or unexported fields }
多人脸信息结构体
type SingleFaceInfo ¶
type SingleFaceInfo struct { FaceRect Rect // 人脸框信息 FaceOrient int32 // 输入图像的角度,可以参考 ArcFaceCompare_OrientCode }
单人脸信息结构体
func GetSingleFaceInfo ¶ added in v3.0.5
func GetSingleFaceInfo(multiFaceInfo MultiFaceInfo) (faceInfo []SingleFaceInfo)
从多人脸结构体中提取单人脸信息
Click to show internal directories.
Click to hide internal directories.