Ejemplo n.º 1
0
        public List <UserFaceprints> GetUsersFaceprints()
        {
            int number_of_users = 0;
            var status          = QueryNumberOfUsers(out number_of_users);

            if (status != Status.Ok)
            {
                return(null);
            }
            var exported_db = new rsid.Faceprints[number_of_users];

            String[] user_ids = new String[number_of_users];
            status = QueryUserIds(out user_ids);
            if (status != Status.Ok)
            {
                return(null);
            }
            for (int i = 0; i < number_of_users; i++)
            {
                exported_db[i] = new Faceprints();
            }
            status = rsid_get_users_faceprints(_handle, exported_db);
            var user_features = new List <UserFaceprints>();

            for (uint i = 0; i < number_of_users; i++)
            {
                user_features.Add(new UserFaceprints
                {
                    faceprints = exported_db[i],
                    userID     = user_ids[i]
                });
                if (status != Status.Ok)
                {
                    return(null);
                }
            }
            return(user_features);
        }
Ejemplo n.º 2
0
 static extern EnrollStatus rsid_extract_faceprints_from_image(IntPtr rsid_authenticator, string userId, IntPtr buffer, int width, int height, ref Faceprints faceprints);
Ejemplo n.º 3
0
        public EnrollStatus EnrollImageFeatureExtraction(string userId, byte[] buffer, int width, int height, ref Faceprints userFaceprints)
        {
            var pinnedArray = GCHandle.Alloc(buffer, GCHandleType.Pinned);

            try
            {
                var pointer = pinnedArray.AddrOfPinnedObject();
                return(rsid_extract_faceprints_from_image(_handle, userId, pointer, width, height, ref userFaceprints));
            }
            finally { pinnedArray.Free(); }
        }