Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("Hello");

        string fp0 = "C:\\Users\\bobic\\Desktop\\SLIKE\\img3.jpg";
        string fp1 = "C:\\Users\\bobic\\Desktop\\SLIKE\\img01.jpg";

        byte[] imgD0 = File.ReadAllBytes(fp0);
        //byte[] imgD1 = File.ReadAllBytes(fp1);
        DBService dbsr = new DBService("real_data.db");

        dbsr.AssertDatabaseExists();
        FARequest frf = new FARequest(APIConstants.APIKEY, APIConstants.APISECRET);

        frf.image_file1 = imgD0;
        //frf.image_file2 = imgD1;
        Debug.Log(FAUtils.getIdConfidenceForCompare(imgD0, dbsr));

        /*
         * var obj = GameObject.Find("HttpUtil");
         * HTTPUtils htp=obj.GetComponent<HTTPUtils>();
         * htp.POST(APIConstants.APIURL_COMPARE, frf);
         * while (!htp) { }
         * double data;*/

        // frf.image_file1
    }
Esempio n. 2
0
    public void CompareFaces()
    {
        Debug.Log("Compare faces");
        var image = CameraDevice.Instance.GetCameraImage(_pixel_format);

        if (image != null)
        {
            byte[] pixels = image.Pixels;
            dbsr = new DBService("real_data.db");
            dbsr.AssertDatabaseExists();

            var id_user     = FAUtils.getIdConfidenceForCompare(pixels, dbsr);
            var patient     = Patient.GetInfo(dbsr, id_user);
            var health_info = HealthInfo.GetHealthInfoForPatient(dbsr, id_user);
            var appointment = Appointment.GetAppointmentsForPatient(dbsr, id_user);

            var text = GameObject.Find("Patient_Name").GetComponent <TextMesh>();
            text.text = patient.FirstName + " " + patient.LastName;
            text      = GameObject.Find("Patient_JMBG").GetComponent <TextMesh>();
            text.text = patient.JMBG;
            text      = GameObject.Find("Patient_Age").GetComponent <TextMesh>();
            text.text = patient.Age.ToString();
            text      = GameObject.Find("Patient_Record").GetComponent <TextMesh>();
            text.text = patient.MedicalRecordNumber;
            text      = GameObject.Find("Patien_Condition").GetComponent <TextMesh>();
            text.text = health_info.Condition;
            text      = GameObject.Find("Patient_BloodType").GetComponent <TextMesh>();
            text.text = health_info.BloodType;
            text      = GameObject.Find("Patient_Alergies").GetComponent <TextMesh>();
            text.text = health_info.Allergies;
            text      = GameObject.Find("Patient_Title").GetComponent <TextMesh>();
            text.text = appointment.First().Title;
            text      = GameObject.Find("Patient_Date").GetComponent <TextMesh>();
            text.text = appointment.First().AppointmentDate.ToString("dd.MM.yyyy.");
            text      = GameObject.Find("Patient_Description").GetComponent <TextMesh>();
            text.text = appointment.First().Description;
        }
    }