Esempio n. 1
0
        private void Grid_pictureBox_MouseClick(object sender, MouseEventArgs e)
        {
            int Step_I  = Grid_pictureBox.Size.Width / PG.RowCount;
            int Step_J  = Grid_pictureBox.Size.Height / PG.ColumnCount;
            int Index_I = e.Y / Step_I;
            int Index_J = e.X / Step_J;

            if (PG.Matrix[Index_I][Index_J] == false)
            {
                PG.Matrix[Index_I][Index_J] = true;
            }
            else
            {
                PG.Matrix[Index_I][Index_J] = false;
            }


            Grid_pictureBox.Refresh();
            Recognize_textBox.Clear();
        }
Esempio n. 2
0
        private void Teach_button_Click(object sender, EventArgs e)
        {
            bool IsLeant = Pers.Teach(PG.Matrix, this.IsTrue_checkBox.Checked);

            if (this.LearningSample == null)
            {
                this.LearningSample = new List <LearningPicture>();
            }

            List <List <bool> > NewMatrix = new List <List <bool> >();

            foreach (List <bool> row in PG.Matrix)
            {
                NewMatrix.Add(new List <bool>());
                foreach (bool pix in row)
                {
                    NewMatrix.Last().Add(pix);
                }
            }

            this.LearningSample.Add(new LearningPicture(NewMatrix, this.IsTrue_checkBox.Checked));
            while (IsLeant == false)
            {
                IsLeant = true;
                foreach (LearningPicture LP in this.LearningSample)
                {
                    //не обяз true
                    if (Pers.Teach(LP.Picture, LP.Answer) == false)
                    {
                        IsLeant = false;
                    }
                }
            }
            PG.Clear();
            Grid_pictureBox.Refresh();

            //Pers.Teach(PG.Matrix, true);
        }
Esempio n. 3
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     //PG = new PaintingGrid((int)X_numericUpDown.Value, (int)Y_numericUpDown.Value);
     PG = new PaintingGrid(5, 5);
     Grid_pictureBox.Refresh();
 }