Пример #1
0
        private void buttonAsTest_Click(object sender, EventArgs e)
        {
            //making new HashSet of TestDataset
            int selectedItemIndex = listBoxImages.SelectedIndex;

            if (selectedItemIndex >= 0)
            {
                String selectedItemFilename = listBoxImages.SelectedItem.ToString();
                if (DatasetElementsMethods.setTrainTestElements(selectedItemFilename, imageDataset, imageDatasetTest, DatasetImageElements.TypeDataset.testing))
                {
                    //updating (deleting) from listboxImage
                    DatasetElementsMethods.updateListBoxMain(listBoxImages, imageDataset, labelStatusPre);
                    //updating listBoxTest
                    DatasetElementsMethods.updateListBoxTrainTest(listBoxTestDataset, imageDatasetTest, labelTestCountElements);

                    //If Counting is Successful -> displaying
                    if (DatasetElementsMethods.countCharaters(imageDatasetTest, labelTestCount))
                    {
                    }
                }
            }
        }
Пример #2
0
        //If ComboBox Test Selected
        private void comboBoxTestCharater_SelectedIndexChanged(object sender, EventArgs e)
        {
            int selectedIndexItem = listBoxTestDataset.SelectedIndex;

            if (selectedIndexItem >= 0)
            {
                //Parsing of Elmenent in ComboBox
                DatasetImageElements.Charater selectedCharater = (DatasetImageElements.Charater)Enum.Parse(typeof(DatasetImageElements.Charater), comboBoxTestCharater.SelectedValue.ToString());

                //Updating in Train Test HashSet
                if (DatasetElementsMethods.setCharaterInTrainTestDataset(selectedIndexItem, selectedCharater, imageDatasetTest))
                {
                    DatasetElementsMethods.updateListBoxTrainTest(listBoxTestDataset, imageDatasetTest, labelTestCountElements);

                    //If Counting is Successful -> displaying
                    if (DatasetElementsMethods.countCharaters(imageDatasetTest, labelTestCount))
                    {
                    }

                    listBoxTestDataset.SelectedIndex = selectedIndexItem;
                }
            }
        }
Пример #3
0
        private void buttonDelTestDatasetElem_Click(object sender, EventArgs e)
        {
            //If item in listBox Selected
            int selectedItem = listBoxTestDataset.SelectedIndex;

            if (selectedItem >= 0)
            {
                //delete elements from Train Dataset
                if (DatasetElementsMethods.delTrainTestElements(selectedItem, imageDataset, imageDatasetTest))
                {
                    //Updating listboxs
                    DatasetElementsMethods.updateListBoxMain(listBoxImages, imageDataset, labelStatusPre);
                    DatasetElementsMethods.updateListBoxTrainTest(listBoxTestDataset, imageDatasetTest, labelTestCountElements);

                    //Clearing pictureBox
                    DatasetElementsMethods.clearPictureBox(pictureBoxPreTest);

                    //If Counting is Successful -> displaying
                    if (DatasetElementsMethods.countCharaters(imageDatasetTest, labelTestCount))
                    {
                    }
                }
            }
        }