/// <summary>
        /// 人脸检测/人脸追踪
        /// 图像数据以结构体形式传入,对采用更高字节对齐方式的图像兼容性更好
        /// </summary>
        /// <param name="imageFormat">图片格式</param>
        /// <param name="image">图片</param>
        /// <param name="multiFaceInfo">多人脸对象</param>
        /// <param name="detectModel">检测模式</param>
        /// <returns>返回0表示正常;返回负数请根据ErrorCodeUtil类注释查看;其他值请在官网-帮助中心查询</returns>
        public int ASFDetectFacesEx(Image image, out MultiFaceInfo multiFaceInfo, ASF_ImagePixelFormat imageFormat = ASF_ImagePixelFormat.ASVL_PAF_RGB24_B8G8R8, ASF_DetectModel detectModel = ASF_DetectModel.ASF_DETECT_MODEL_RGB)
        {
            int retCode = -1;

            multiFaceInfo = new MultiFaceInfo();
            if (image == null)
            {
                return(ErrorCodeUtil.IMAGE_IS_NULL);
            }
            ImageInfo imageInfo = new ImageInfo();

            imageInfo = ASF_ImagePixelFormat.ASVL_PAF_RGB24_B8G8R8.Equals(imageFormat) ? ImageUtil.ReadBMP(image) : ImageUtil.ReadBMP_IR(image);
            if (imageInfo == null)
            {
                return(ErrorCodeUtil.IMAGE_DATA_READ_FAIL);
            }
            ASF_ImageData asfInfoData = CommonUtil.TransImageDataStructByImageInfo(imageInfo);
            IntPtr        pImageInfo  = MemoryUtil.Malloc(MemoryUtil.SizeOf <ASF_ImageData>());

            MemoryUtil.StructureToPtr(asfInfoData, pImageInfo);

            ASF_MultiFaceInfo multiFaceInfoStruct = new ASF_MultiFaceInfo();
            IntPtr            pMultiFaceInfo      = MemoryUtil.Malloc(MemoryUtil.SizeOf <ASF_MultiFaceInfo>());

            //调用SDK接口
            retCode = ASFFunctions.ASFDetectFacesEx(pEngine, pImageInfo, pMultiFaceInfo);
            if (retCode != 0)
            {
                MemoryUtil.FreeArray(imageInfo.imgData, pMultiFaceInfo, pImageInfo);
                return(retCode);
            }
            multiFaceInfoStruct = MemoryUtil.PtrToStructure <ASF_MultiFaceInfo>(pMultiFaceInfo);
            MemoryUtil.FreeArray(imageInfo.imgData, pMultiFaceInfo, pImageInfo);

            //转化非托管内存到托管内存
            multiFaceInfo.faceNum = multiFaceInfoStruct.faceNum;
            if (multiFaceInfo.faceNum > 0)
            {
                if (multiFaceInfoStruct.faceID != IntPtr.Zero)
                {
                    multiFaceInfo.faceID = new int[multiFaceInfo.faceNum];
                    Marshal.Copy(multiFaceInfoStruct.faceID, multiFaceInfo.faceID, 0, multiFaceInfo.faceNum);
                }
                multiFaceInfo.faceOrients = new int[multiFaceInfo.faceNum];
                Marshal.Copy(multiFaceInfoStruct.faceOrients, multiFaceInfo.faceOrients, 0, multiFaceInfo.faceNum);
                multiFaceInfo.faceRects = new MRECT[multiFaceInfo.faceNum];
                for (int i = 0; i < multiFaceInfo.faceNum; i++)
                {
                    multiFaceInfo.faceRects[i] = MemoryUtil.PtrToStructure <MRECT>(multiFaceInfoStruct.faceRects + MemoryUtil.SizeOf <MRECT>() * i);
                }
            }
            return(retCode);
        }