private void Test() { string folderImport = (string)TestFolderImportLabel.Content; string testImagePath = (string)ImageElectionLabel.Content; if (folderImport == "Not defined" || testImagePath == "Not defined") { System.Windows.MessageBox.Show("Invalid directory path"); return; } Bitmap testImage = (Bitmap)Bitmap.FromFile(testImagePath); testImage = new Bitmap(testImage, AdvancedOptions._nBitmapSize, AdvancedOptions._nBitmapSize); object[] returned = DataHandler.ProcessInputTest(folderImport); if (returned == null) { return; } List <string> labels = (List <string>)returned[0]; Cell[,] map = (Cell[, ])returned[1]; lh = new LabelingHandler(labels); kn = new KohonenNetwork(testImage, lh, map); }
private void Train() { string folderImport = (string)TrainFolderImportLabel.Content; string folderLabels = (string)TrainLabelImportLabel.Content; string folderSave = (string)TrainFolderSaveLabel.Content; if (folderImport == "Not defined" || folderLabels == "Not defined" || folderSave == "Not defined") { System.Windows.MessageBox.Show("Invalid directory path"); return; } object[] returned = DataHandler.ProcessInputTrain(folderImport, folderLabels); if (returned == null) { return; } List <string> labels = (List <string>)returned[0]; List <Bitmap> sourceData = (List <Bitmap>)returned[1]; lh = new LabelingHandler(labels); kn = new KohonenNetwork(sourceData, lh, folderSave); started = true; }