110,536
社区成员
发帖
与我相关
我的任务
分享
/*Define the rect*/
public struct MRECT
{
int left;
int top;
int right;
int bottom;
}
public struct MPOINT
{
int x;
int y;
}
/*Define the image format space*/
[StructLayout(LayoutKind.Sequential)]
public struct OFFSCREEN
{
uint u32P下ixelArrayFormat;
int i32Width;
int i32Height;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
string[] ppu8Plane;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
uint[] pi32Pitch;
};
/*Define the face result*/
public struct FaceResult
{
public int nface_;
public MRECT *rcface_;
public float *score_;
};
接口:
[DllImport(@"\ArcsoftSDK\arcsoft_face_detection.dll", EntryPoint = "AFD_Initial", CallingConvention = CallingConvention.StdCall)]
public static extern int AFD_Initial(ref FaceEngine face_engine, int max_face_num = 10, int nscale = 16, float threshold = 0.7f, int enable_tracking = 0, int device_id = 0);
[DllImport(@"\ArcsoftSDK\arcsoft_face_detection.dll", EntryPoint = "AFD_Detect", CallingConvention = CallingConvention.StdCall)]
public static extern int AFD_Detect(FaceEngine face_engine, ref OFFSCREEN img, ref FaceResult face_res, MRECT roi_rect = NULL, int roi_num = 0);
[DllImport(@"\ArcsoftSDK\arcsoft_face_detection.dll", EntryPoint = "AFD_Release", CallingConvention = CallingConvention.StdCall)]
public static extern void AFD_Release(FaceEngine face_engine);