Beispiel #1
0
 private void button2_Click(object sender, System.EventArgs e)
 {
     backpropNetwork = new OCRNetwork(this, new int[3] {
         aMatrixDim *aMatrixDim, (aMatrixDim * aMatrixDim + aCharsCount) / 2, aCharsCount
     });
     tabControl1.SelectedTab = tabPage3;
 }
Beispiel #2
0
        private void ShowNoise(Size sz, Graphics g, int noisePercent)
        {
            int range = sz.Height * sz.Width * noisePercent / 200;

            for (int i = 0; i < range; i++)
            {
                int       x = (int)OCRNetwork.Random(0, sz.Width);
                int       y = (int)OCRNetwork.Random(0, sz.Height);
                Rectangle r = new Rectangle(x, y, 0, 0);
                r.Inflate(1, 1);
                Brush b;
                if ((OCRNetwork.Random(0, 100)) > 80)              //80% is black noise, 20% is white noise
                {
                    b = new SolidBrush(Color.White);
                }
                else
                {
                    b = new SolidBrush(Color.Black);
                }

                g.FillRectangle(b, r);
                b.Dispose();
            }
        }
Beispiel #3
0
		private void button2_Click(object sender, System.EventArgs e)
		{
			backpropNetwork = new OCRNetwork(this, new int[3] {aMatrixDim * aMatrixDim, (aMatrixDim * aMatrixDim + aCharsCount)/2, aCharsCount});
			tabControl1.SelectedTab = tabPage3;
		}