Пример #1
0
        public static List <List <string> > User_Verification(string url, byte[] imagebyte, string gesture, string check, bool CheckIn)
        {
            List <List <string> > err = new List <List <string> >();

            err.Add(new List <string>());

            GestureHandler          gshobj = new GestureHandler();
            FaceRegistrationHandler frhobj = new FaceRegistrationHandler();
            ImageDepthHandler       idh    = new ImageDepthHandler();

            if (check == "Yes")
            {
                if (idh.Validate(imagebyte, url))
                {
                    if (gshobj.Validate(url, imagebyte, gesture))
                    {
                        string result = frhobj.VerifyFace(imagebyte, CheckIn);
                        err[0].Add(result);
                        err[0].Add("");
                        return(err);
                    }
                    else
                    {
                        if (gshobj.error != "")
                        {
                            err[0].Add("Failed");
                            err[0].Add(gshobj.error);
                            return(err);
                        }

                        err[0].Add("Failed");
                        err[0].Add("Please follow the gesture and try again");
                        return(err);
                    }
                }
                else
                {
                    err[0].Add("You are trying to spoof");
                    err[0].Add("");
                    return(err);
                }
            }
            else
            {
                if (gshobj.Validate(url, imagebyte, gesture))
                {
                    string result = frhobj.VerifyFace(imagebyte, CheckIn);
                    err[0].Add(result);
                    err[0].Add("");
                    return(err);
                }
                else
                {
                    if (gshobj.error != "")
                    {
                        err[0].Add("Failed");
                        err[0].Add(gshobj.error);
                        return(err);
                    }

                    err[0].Add("Failed");
                    err[0].Add("Please follow the gesture and try again");
                    return(err);
                }
            }
        }
Пример #2
0
        public static List <List <string> > User_ImageValidation(string realfakecheck, byte[] imagebyte, string url)
        {
            List <List <string> > err = new List <List <string> >();

            err.Add(new List <string>());

            ImageValidationHandler ivhobj = new ImageValidationHandler();

            ImageValidationTable ivtobj = new ImageValidationTable();

            ImageDepthHandler idhobj = new ImageDepthHandler();

            GestureHandler gsobj = new GestureHandler();

            FaceRegistrationHandler fcobj = new FaceRegistrationHandler();


            List <bool> flag = ivtobj.UserList();

            if (ivtobj.error != "")
            {
                err[0].Add("");
                err[0].Add(ivtobj.error);
                return(err);
            }

            string result = ivhobj.Validate(url, imagebyte, flag[0], flag[2], flag[1], flag[3]);

            if (result == "0")
            {
                //Real or Face CheckBox
                if (realfakecheck == "Yes")
                {
                    if (idhobj.Validate(imagebyte, url))
                    {
                        if (gsobj.GenerateDefaultGesture(url, imagebyte))
                        {
                            err[0].Add("Success");
                            err[0].Add("");
                            return(err);
                        }
                        else
                        {
                            if (gsobj.error != "")
                            {
                                err[0].Add("");
                                err[0].Add(gsobj.error);
                                return(err);
                            }
                            err[0].Add("Please follow the Gesture");
                            err[0].Add("");
                            return(err);
                        }
                    }
                    else
                    {
                        err[0].Add("You are trying to spoof");
                        err[0].Add("");
                        return(err);
                    }
                }
                else
                {
                    if (gsobj.GenerateDefaultGesture(url, imagebyte))
                    {
                        err[0].Add("Success");
                        err[0].Add("");
                        return(err);
                    }
                    else
                    {
                        if (gsobj.error != "")
                        {
                            err[0].Add("");
                            err[0].Add(gsobj.error);
                            return(err);
                        }
                        err[0].Add("Please follow the Gesture");
                        err[0].Add("");
                        return(err);
                    }
                }
            }
            else
            {
                err[0].Add(result);
                err[0].Add("");
                return(err);
            }
        }