Exemple #1
0
        public static void AddFace(string id, byte[] featureData, Image img)
        {
            var xid = id;

            for (int i = 0; i < 1000; i++)
            {
                id = xid + i;

                var fileName = Path.Combine(_FaceDataPath, id + ".dat");
                System.IO.File.WriteAllBytes(fileName, featureData);
                fileName = Path.Combine(_FaceImagePath, id + ".bmp");
                img.Save(fileName);
                var faceModel = new FaceModel
                {
                    Size     = featureData.Length,
                    PFeature = Marshal.AllocHGlobal(featureData.Length)
                };

                Marshal.Copy(featureData, 0, faceModel.PFeature, featureData.Length);
                _FaceLib[0].Items.Add(new FaceLib.Item()
                {
                    OrderId = DateTime.Now.Ticks, ID = id, FaceModel = faceModel
                });
            }
        }
Exemple #2
0
 public static extern int Match(IntPtr engine, ref FaceModel faceModel1, ref FaceModel faceModel2, out float score);
Exemple #3
0
 public static extern int ExtractFeature(IntPtr engine, ref ImageData imageData, ref FaceFeatureInput faceFeatureInput, out FaceModel faceModel);