private void button3_Click(object sender, EventArgs e) { if (this.recognizer == null) { MessageBox.Show("Error: no recognizer implemented"); return; } recognizer.Input = BMPTransform.BitmapToDouble(GetBitmap(draws)); recognizer.DoWork(); label2.Text = recognizer.Output[0].ToString(); label4.Text = recognizer.Output[1].ToString(); label6.Text = recognizer.Output[2].ToString(); double maxValue = recognizer.Output[0]; int index = 0; for (int i = 1; i < 3; i++) { if (recognizer.Output[i] > maxValue) { maxValue = recognizer.Output[i]; index = i; } } MessageBox.Show("Group number is " + (index + 1).ToString()); }
private void button2_Click(object sender, EventArgs e) { if (this.recognizer == null) { this.recognizer = new RBFGrid(); this.recognizer.InputCellCount = height * width; this.recognizer.OutputCellCount = 3; } if (this.size == 0) { MessageBox.Show("No image to teach "); return; } int group = 0; if (radioButton2.Checked) { group = 1; } if (radioButton3.Checked) { group = 2; } recognizer.Input = BMPTransform.BitmapToDouble(GetBitmap(draws)); recognizer.LearnImage(group); MessageBox.Show("Success"); }