Ejemplo n.º 1
0
        /// <summary>
        /// 人脸特征比对,输出比对相似度。
        /// </summary>
        /// <param name="feature1"></param>
        /// <param name="feature2"></param>
        /// <returns></returns>
        public float FaceFeatureCompare(ASF_FaceFeature feature1, byte[] feature2)
        {
            var f2 = new ASF_FaceFeature
            {
                featureSize = feature2.Length
            };
            var p2 = Marshal.AllocHGlobal(feature2.Length);

            f2.feature = p2;
            ASFFunctions.ASFFaceFeatureCompare(EngineHandler, feature1, f2, out float score, ASF_CompareModel.ASF_LIFE_PHOTO);
            return(score);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 人脸特征比对,输出比对相似度。
        /// </summary>
        /// <param name="feature1"></param>
        /// <param name="feature2"></param>
        /// <returns></returns>
        public float FaceFeatureCompare(byte[] feature1, byte[] feature2)
        {
            var f1 = new ASF_FaceFeature
            {
                featureSize = feature1.Length
            };
            var f2 = new ASF_FaceFeature
            {
                featureSize = feature2.Length
            };
            var p1 = Marshal.AllocHGlobal(feature1.Length);
            var p2 = Marshal.AllocHGlobal(feature2.Length);

            Marshal.Copy(feature1, 0, p1, feature1.Length);
            Marshal.Copy(feature2, 0, p2, feature2.Length);
            f1.feature = p1;
            f2.feature = p2;
            ASFFunctions.ASFFaceFeatureCompare(EngineHandler, f1, f2, out float score, ASF_CompareModel.ASF_LIFE_PHOTO);
            Marshal.FreeHGlobal(p1);
            Marshal.FreeHGlobal(p2);
            return(score);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 人脸特征比对,输出比对相似度。
 /// </summary>
 /// <param name="feature1"></param>
 /// <param name="feature2"></param>
 /// <param name="compareModel"></param>
 /// <returns></returns>
 public float FaceFeatureCompare(ASF_FaceFeature feature1, ASF_FaceFeature feature2, ASF_CompareModel compareModel = ASF_CompareModel.ASF_LIFE_PHOTO)
 {
     ASFFunctions.ASFFaceFeatureCompare(EngineHandler, feature1, feature2, out float score, compareModel);
     return(score);
 }