Пример #1
0
 private void button6_Click(object sender, EventArgs e)
 {
     if ((!radioButton3.Checked && !radioButton4.Checked) || pictureBox1.Image == null)
     {
         return;
     }
     if (radi)
     {
         return;
     }
     label17.Text = "Trajanje poboljšanja:";
     if (!radioButton4.Checked)
     {
         poboljsanje        = true;
         progressBar4.Value = 0;
         radi = true;
         backgroundWorker1.RunWorkerAsync();
     }
     else
     {
         ViolaJonesDetekcija.IzvrsiPoboljsanje(radioButton4.Checked, new Bitmap(pictureBox1.Image), lice, backgroundWorker1);
         double uspjesnost = ViolaJonesDetekcija.DajTrenutnuUspjesnost() * 100;
         label2.Text = uspjesnost.ToString() + " %";
         label9.Text = ViolaJonesDetekcija.DajBrojProcesiranihSlika().ToString();
     }
 }
Пример #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            if ((!radioButton3.Checked && !radioButton4.Checked) || pictureBox1.Image == null)
            {
                return;
            }
            var watch = System.Diagnostics.Stopwatch.StartNew();

            ViolaJonesDetekcija.IzvrsiPoboljsanje(radioButton4.Checked, new Bitmap(pictureBox1.Image), lice, progressBar4);
            watch.Stop();
            var trajanje = watch.ElapsedMilliseconds;

            trajanje    /= 1000;
            label17.Text = "Trajanje poboljšanja: " + trajanje.ToString() + " sekundi";
            double uspjesnost = ViolaJonesDetekcija.DajTrenutnuUspjesnost() * 100;

            label2.Text = uspjesnost.ToString() + " %";
            label9.Text = ViolaJonesDetekcija.DajBrojProcesiranihSlika().ToString();
        }
Пример #3
0
 private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
 {
     if (treningLica)
     {
         ViolaJonesDetekcija.TreningLica(textBox1.Text, backgroundWorker1);
     }
     else if (treningNeLica)
     {
         ViolaJonesDetekcija.TreningNeLica(textBox1.Text, backgroundWorker1);
     }
     else if (detekcija)
     {
         rezultatDetekcije = ViolaJonesDetekcija.Detekcija(new Bitmap(pictureBox1.Image), backgroundWorker1);
     }
     else if (detekcijaDirektorij)
     {
         ViolaJonesDetekcija.DetekcijaIzvjestaj(textBox2.Text, backgroundWorker1);
     }
     else if (poboljsanje)
     {
         ViolaJonesDetekcija.IzvrsiPoboljsanje(radioButton4.Checked, new Bitmap(pictureBox1.Image), lice, backgroundWorker1);
     }
 }