Пример #1
0
        //데이터가 학습 되었을 때 원하는 번호 검사
        private void RL_RunNumberBox_Click(object sender, EventArgs e)
        {
            int testDataNumber = mangeFile.NumberOfFile(Property.TestFolderPath);

            TestDataNumBox.Text = Convert.ToString(testDataNumber);
            DataProcessing DataShipping = new DataProcessing();

            try
            {
                int RunNumber = int.Parse(RL_ChoiseTestNumberTextBox.Text);

                if (RunNumber <= testDataNumber && RunNumber > 0)
                {
                    string output = Property.logistic.DesideRefression(DataShipping.TestDataShipping(RunNumber));

                    RL_LabelOutPutTextBox.Text = Convert.ToString(RunNumber) + "." + output;

                    RL_ImageBox.Load(Property.testDataPath + Convert.ToString(RunNumber) + ").bmp");
                }
                else
                {
                    MessageBox.Show("1부터 test데이터의 개수까지의 정수를 입력하시오");
                }
            }
            catch
            {
                MessageBox.Show("데이터를 학습시키오.");
            }
        }
Пример #2
0
        // 자동검사 시작
        private void timer2_Tick(object sender, EventArgs e)
        {
            try
            {
                if (
                    ((RunSpeedTextBox.Text == "") || (10 <= Convert.ToInt32(RunSpeedTextBox.Text) && Convert.ToInt32(RunSpeedTextBox.Text) <= 5000)) &&
                    (Property.autoRun == true || Property.LautoRun == true))
                {
                    // 카메라에서 프레임 가져온다.
                    _image = m_cvCap.QueryFrame();

                    // 비트맵으로 전환
                    CameraBox.Image = _image.ToBitmap();

                    //사진 폴더 사진 개수 측정
                    int testData = mangeFile.NumberOfFile(Property.TestFolderPath) + 1;

                    CameraBox.Image.Save(Property.testDataPath + (testData) + ").bmp", System.Drawing.Imaging.ImageFormat.Bmp);
                    DataShipping = new DataProcessing();
                    calculate    = new CalculateOutput();

                    try
                    {
                        string output = "";

                        if (Property.autoRun)
                        {
                            output              = calculate.CalculateKNN(DataShipping.TestDataShipping(testData));
                            OutputTextBox.Text  = Convert.ToString(testData) + "." + output;
                            TestDataNumBox.Text = Convert.ToString(testData);
                            ImageBox.Load(Property.testDataPath + Convert.ToString(testData) + ").bmp");
                        }
                        if (Property.LautoRun)
                        {
                            output = Property.logistic.DesideRefression(DataShipping.TestDataShipping(testData));
                            RL_LabelOutPutTextBox.Text      = Convert.ToString(testData) + "." + output;
                            RL_NumberOfTestDataTextBox.Text = Convert.ToString(testData);
                            RL_ImageBox.Load(Property.testDataPath + Convert.ToString(testData) + ").bmp");
                        }
                    }

                    catch
                    {
                        MessageBox.Show("데이터를 학습시키오.");
                        Property.LautoRun = false;
                        Property.autoRun  = false;
                    }
                }
            }
            catch
            {
                MessageBox.Show("카메라 연결을 확인하시오.");
            }
        }
Пример #3
0
        //데이터가 학습 되었을 때 번호를 1씩 증가시키며 검사
        private void RL_ForwardBox_Click(object sender, EventArgs e)
        {
            int testDataNumber = mangeFile.NumberOfFile(Property.TestFolderPath);

            TestDataNumBox.Text = Convert.ToString(testDataNumber);
            DataProcessing DataShipping = new DataProcessing();

            try
            {
                if (RL_LabelOutPutTextBox.Text == "")
                {
                    RL_LabelOutPutTextBox.Text = "1." + Property.logistic.DesideRefression(DataShipping.TestDataShipping(1));

                    RL_ImageBox.Load(Property.testDataPath + Convert.ToString(1) + ").bmp");
                }
                else if (RL_LabelOutPutTextBox.Text.Contains("True")) //true.
                {
                    if (testDataNumber > Convert.ToInt32(RL_LabelOutPutTextBox.Text.Substring(0, RL_LabelOutPutTextBox.Text.Length - 5)))
                    {
                        int    RunNumber = int.Parse(RL_LabelOutPutTextBox.Text.Substring(0, RL_LabelOutPutTextBox.Text.Length - 5));
                        string output    = Property.logistic.DesideRefression(DataShipping.TestDataShipping(RunNumber + 1));

                        RL_LabelOutPutTextBox.Text = Convert.ToString(RunNumber + 1) + "." + output;

                        RL_ImageBox.Load(Property.testDataPath + Convert.ToString(RunNumber + 1) + ").bmp");
                    }
                }
                else if (RL_LabelOutPutTextBox.Text.Contains("False"))//false.
                {
                    if (testDataNumber > Convert.ToInt32(RL_LabelOutPutTextBox.Text.Substring(0, RL_LabelOutPutTextBox.Text.Length - 6)))
                    {
                        int    RunNumber = int.Parse(RL_LabelOutPutTextBox.Text.Substring(0, RL_LabelOutPutTextBox.Text.Length - 6));
                        string output    = Property.logistic.DesideRefression(DataShipping.TestDataShipping(RunNumber + 1));

                        RL_LabelOutPutTextBox.Text = Convert.ToString(RunNumber + 1) + "." + output;

                        RL_ImageBox.Load(Property.testDataPath + Convert.ToString(RunNumber + 1) + ").bmp");
                    }
                }
            }
            catch
            {
                MessageBox.Show("데이터를 학습시키오.");
            }
        }