public Sequence Add(Point[] sequence, string classLabel) { if (sequence == null || sequence.Length == 0) return null; if (!Classes.Contains(classLabel)) Classes.Add(classLabel); int classIndex = Classes.IndexOf(classLabel); Sequence sample = new Sequence() { Classes = Classes, SourcePath = sequence, Output = classIndex }; Samples.Add(sample); return sample; }
//adds the GestureData obj and classLabel to database public Sequence Add(GestureData[] sequence, string classLabel) { if (sequence == null || sequence.Length == 0) return null; if (!Classes.Contains(classLabel)) Classes.Add(classLabel); int classIndex = Classes.IndexOf(classLabel); //create a new obj of Sequence class, to add to the Samples<Sequence> list Sequence sample = new Sequence() { Classes = Classes, //all the classes are stored in a list form SourcePath = sequence, //the GestureData obj is added Output = classIndex //the class label (int form) }; Samples.Add(sample); return sample; }