void Learn(short[,] imageData) { currentSampleCount++; double[] feature = imgFeature.GenerateFeature(imageData); featureVector.Add(feature); if (this.GestureDataReady) { this.ImageCollectionFinished(this, null); } this.learning = false; }
void Classify(object state) { short[,] imageData = (short[, ])state; double[] feature = imgFeature.GenerateFeature(imageData); int label = (int)svm.svm_predict(modelBuilder.GetModel(), MatrixUtil.DoubleToSvmNode(feature)); this.category = label; if (this.CategoryDetected != null) { this.CategoryDetected(this, new CategoryEventArgs() { CategoryLabel = this.category }); } this.classifying = false; }