private void PictureBox1_Leave(object sender, EventArgs e) { if (radioButton1.Checked == true) { int[,] clipArr = NeiroGraphUtils.CutImageToArray((Bitmap)pictureBox1.Image, new Point(pictureBox1.Width, pictureBox1.Height)); if (clipArr == null) { return; } arr = NeiroGraphUtils.LeadArray(clipArr, new int[NeiroWeb.neironInArrayWidth, NeiroWeb.neironInArrayHeight]); pictureBox2.Image = new Bitmap(NeiroGraphUtils.GetBitmapFromArr(clipArr), new Size(pictureBox2.Width, pictureBox2.Height));; pictureBox3.Image = new Bitmap(NeiroGraphUtils.GetBitmapFromArr(arr), new Size(pictureBox3.Width, pictureBox3.Height)); string s = neiro.CheckLetter(arr); NeiroGraphUtils.ClearImage(pictureBox1); textBox1.Text += s; } }
private void Learn() { int[,] clipArr = NeiroGraphUtils.CutImageToArray((Bitmap)pictureBox1.Image, new Point(pictureBox1.Width, pictureBox1.Height)); if (clipArr == null) { return; } arr = NeiroGraphUtils.LeadArray(clipArr, new int[NeiroWeb.neironInArrayWidth, NeiroWeb.neironInArrayHeight]); pictureBox2.Image = new Bitmap(NeiroGraphUtils.GetBitmapFromArr(clipArr), new Size(pictureBox2.Width, pictureBox2.Height));; pictureBox3.Image = new Bitmap(NeiroGraphUtils.GetBitmapFromArr(arr), new Size(pictureBox3.Width, pictureBox3.Height)); if (textBox2.Text == " " || textBox2.Text == "Введіть ваш символ...") { label2.Text = "Введіть коррекний символ"; label2.Visible = true; return; } else { label2.Text = "Символ " + "'" + textBox2.Text + "'" + " збережено!"; label2.Visible = true; neiro.SetTraining(textBox2.Text, arr); NeiroGraphUtils.ClearImage(pictureBox1); } }