private void Button_Click(object sender, RoutedEventArgs e) { BgrHsvClassifier classifier = new BgrHsvClassifier(); classifier.Train(); SVMClassifier svm = new SVMClassifier(); svm.TrainFromCsv(@"D:\Development\OpenCV\SetVision\recordings.csv"); svm.Save(@"D:\Development\OpenCV\SetVision\rgbsvm.yaml"); }
private void Button_Click_1(object sender, RoutedEventArgs e) { BgrClassifier.Test(); SVMClassifier svm = new SVMClassifier(); svm.TrainFromCsv(@"D:\Development\OpenCV\SetVision\recordings.csv"); string col1 = svm.ClassifyToString(new float[] { 0, 0, 255 }); //red string col2 = svm.ClassifyToString(new float[] { 110, 45, 89 }); //purple string col3 = svm.ClassifyToString(new float[] { 99, 20, 120 }); //purple string col4 = svm.ClassifyToString(new float[] { 71, 100, 54 }); //green string col5 = svm.ClassifyToString(new float[] { 119, 54, 98 }); //purple }