Exemplo n.º 1
0
        //"Train your face" button's clicked part
        private async void btnEgit_Click(object sender, EventArgs e)
        {
            await Task.Run(() =>
            {
                for (int i = 0; i < 50; i++)
                {
                    if (!recognition.SaveTrainingData(pictureBox2.Image, txtFaceName.Text))
                    {
                        MessageBox.Show("Error", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    Thread.Sleep(100);
                    lblEgitilenAdet.Text = (i + 1) + " times photo taken.";
                }

                recognition = null;
                train       = null;

                recognition = new BusinessRecognition("D:\\", "Faces", "yuz.xml");
                train       = new Classifier_Train("D:\\", "Faces", "yuz.xml");
            });
        }
Exemplo n.º 2
0
        private async void btnEgit_Click(object sender, EventArgs e)
        {
            await Task.Run(() =>
            {
                for (int i = 0; i < 10; i++)
                {
                    if (!recognition.SaveTrainingData(pictureBox2.Image, txtFaceName.Text))
                    {
                        MessageBox.Show("Hata", "Profil alınırken beklenmeyen bir hata oluştu.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    Thread.Sleep(100);
                    lblEgitilenAdet.Text = (i + 1) + " adet profil.";
                }


                recognition = null;
                train       = null;

                recognition = new BusinessRecognition("C:\\", "Faces", "yuz.xml");
                train       = new Classifier_Train("C:\\", "Faces", "yuz.xml");
            });
        }