Beispiel #1
0
        private void btnRecognize_Click(object sender, EventArgs e)
        {
            string text = String.Empty;

            lblResult.Visible = true;
            if (!action)
            {
                if (index == paths.Length)
                {
                    DialogResult result = MessageBox.Show("Begin new recognition?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (result == DialogResult.Yes)
                    {
                        DefoltCondition();
                    }
                    return;
                }
                btnRecognize.Text = "Stop";
                action            = true;
                btnNext.Visible   = true;
                btnNext.Enabled   = true;
                //тут придется добавить, чтобы ждало окончания действия
                if (index <= paths.Length - 1)
                {
                    imgBox.ImageLocation = paths[index];
                    //index = 23;
                    //25 бо
                    //34 бо
                    //41 ytn
                    //6 - ytn
                    //17 - бо 1 из двух тэгов
                    //15 1 ошибка
                    //31 1 ошибка
                    //37? четверки слипаются + нтд
                    //19 - непонятный текст
                    //18, 23, 26,27,35,38,39,40,42,43,44 глянуть
                    //
                    tags = Recognition.GetTags(paths[index], ref rectFaces, ref rectTags, out detectionTime);
                    ShowImage(paths[index]);
                    lblNowImg.Text = "Now: " + (index++ + 1).ToString();
                    lblResult.Text = "Result: " + Result(tags);
                }
            }
            else
            {
                if (index != paths.Length)
                {
                    btnRecognize.Text = "Continue";
                }
                else
                {
                    btnRecognize.Text = "Recognize";
                }
                action          = false;
                btnNext.Enabled = false;
            }
        }
Beispiel #2
0
 private void btnNext_Click(object sender, EventArgs e)
 {
     if (index <= paths.Length - 1)
     {
         imgBox.ImageLocation = paths[index];
         //imgBox.ImageLocation = @"C:\Users\а\Desktop\15337.jpg";
         rectFaces.Clear();
         rectTags.Clear();
         tags.Clear();
         tags = Recognition.GetTags(paths[index], ref rectFaces, ref rectTags, out detectionTime);
         ShowImage(paths[index]);
         lblNowImg.Text = "Now: " + (index++ + 1).ToString();
         lblResult.Text = "Result " + Result(tags);
         if (index == paths.Length)
         {
             btnNext.Enabled = false;
         }
     }
 }