Exemple #1
0
        //RECOGNIZE
        private void button2_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            Recognizer     recognizer     = new Recognizer();
            ImageProcessor imageProcessor = new ImageProcessor(boardSize);
            List <Bitmap>  digits         = imageProcessor.Process(bmpPicture, Config.MinGray);

            for (int i = 0; i < boardSize; i++)
            {
                for (int j = 0; j < boardSize; j++)
                {
                    if (tempMatrix[i, j] == 0)
                    {
                        tempMatrix[i, j] = recognizer.Recognize(digits[i * boardSize + j]);
                    }
                }
            }

            this.Cursor = Cursors.Arrow;
            //after successful recognition turn on LED light on phone
            if (!FlashLighter.IsBusy)
            {
                FlashLighter.RunWorkerAsync();
            }

            //check and correct recognized digits
            RecognitionAccepter ra = new RecognitionAccepter(boardSize);

            ra.ShowDialog();

            //creates game field from recognized digits
            gameField = new Matrix(boardSize, ra.field);

            pictureBox6.Visible = true;
            button3.Enabled     = true;
            //RecognitionWorker.RunWorkerAsync();
        }
Exemple #2
0
        //RECOGNIZE
        private void button2_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
                Recognizer recognizer = new Recognizer();
                ImageProcessor imageProcessor = new ImageProcessor(boardSize);
                List<Bitmap> digits = imageProcessor.Process(bmpPicture, Config.MinGray);
                for (int i = 0; i < boardSize; i++)
                {
                    for (int j = 0; j < boardSize; j++)
                    {
                        if(tempMatrix[i, j] == 0)
                            tempMatrix[i, j] = recognizer.Recognize(digits[i * boardSize + j]);
                    }
                }

            this.Cursor = Cursors.Arrow;
            //after successful recognition turn on LED light on phone
            if (!FlashLighter.IsBusy)
                FlashLighter.RunWorkerAsync();

            //check and correct recognized digits
            RecognitionAccepter ra = new RecognitionAccepter(boardSize);
            ra.ShowDialog();

            //creates game field from recognized digits
            gameField = new Matrix(boardSize, ra.field);

            pictureBox6.Visible = true;
            button3.Enabled = true;
            //RecognitionWorker.RunWorkerAsync();
        }