private async void btnEgit_Click(object sender, EventArgs e) { ToolTip tt = new ToolTip(); tt.IsBalloon = true; tt.InitialDelay = 0; tt.ShowAlways = true; tt.SetToolTip(btnEgit, "GÖRÜNTÜ ALINIYOR LÜTFEN KAMERAYA BAKIN!"); await Task.Run(() => { for (int i = 0; i < 200; i++) { if (!recognition.SaveTrainingData(pictureBox2.Image, txtFaceName.Text, txtcocuk.Text, comboBox1.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("D:\\", "Faces", "yuz.xml"); train = new Classifier_Train("D:\\", "Faces", "yuz.xml"); }); }
//"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"); }); }
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"); }); }
public BusinessRecognition(string Dizin, string KlasorAdi, string XmlVeriDosyasi) { this.Dizin = Dizin + "/" + KlasorAdi + "/"; this.XmlVeriDosyasi = XmlVeriDosyasi; Eigen_Recog = new Classifier_Train(Dizin, KlasorAdi, XmlVeriDosyasi); }
public BusinessRecognition(string Dizin, string KlasorAdi) { this.Dizin = Dizin + "/" + KlasorAdi + "/"; Eigen_Recog = new Classifier_Train(Dizin, KlasorAdi); }