public Recording(string path) { this.path = path; gaze = GazeData.readTobiiCsv(path); fixations = GazeData.fixationBusher2008(gaze); fixationLines = GazeData.lineBreakDetectionSimple(ref fixations); string[] split = Path.GetFileNameWithoutExtension(path).Split('_'); readerName = split[0]; documentName = split[1]; saccades = computeSaccades(fixations); computeFeatures(); }
public int estimatedNumberOfReadWords() { GazeData gdCopy = (GazeData)gd.Clone(); gdCopy.gazes = GazeData.fixationBusher2008(gdCopy.gazes); gdCopy.lines = GazeData.lineBreakDetectionSimple(ref gdCopy.gazes); List <int> words = new List <int>(); foreach (var item in gdCopy.lines) { //estimateSpeed words.Add(wordsLine(item)); } return(words.Sum()); }
public List <double> speedPerLine() { //Clone the gaze for applying fixation and line break detection on it GazeData gdCopy = (GazeData)gd.Clone(); gdCopy.gazes = GazeData.fixationBusher2008(gdCopy.gazes); gdCopy.lines = GazeData.lineBreakDetectionSimple(ref gdCopy.gazes); List <double> speed = new List <double>(); foreach (var item in gdCopy.lines) { //estimateSpeed speed.Add(speedLine(item)); } return(speed); }
public void update(float posX, float posY, float timestamp) { Gaze g = new Gaze(); g.gazeX = posX; g.gazeY = posY; g.timestamp = timestamp; gazes.Add(g); GazeData gd = new GazeData(); gd.gazes = gazes; gd.gazes = GazeData.fixationBusher2008(gd.gazes); gd.lines = GazeData.lineBreakDetectionSimple(ref gd.gazes); fixations = gd.gazes; nbWords = (int)(gd.TotalLinesLength / space); //I had one word per line in the estimation because the fixations are found at the center of the words nbWords += gd.lines.Count; }
public static List <GazeData> loadEyeGazes(string folderPathEG) { List <GazeData> gazes = new List <GazeData>(); List <string> files = Directory.GetFiles(folderPathEG, "*.csv").ToList(); files.AddRange(Directory.GetFiles(folderPathEG, "*.txt")); foreach (var item in files) { //Get the ID of the groundtruth int groundTruthID = int.Parse(Path.GetFileNameWithoutExtension(item).Split('_')[1]); //I don't take the first text as it seems not relevant //if (groundTruthID == 1) continue; GazeData gd = new GazeData(Path.ChangeExtension(item, null), groundTruthID - 1); gd.gazes = GazeData.fixationBusher2008(gd.gazes, 100); gd.lines = GazeData.lineBreakDetectionSimple(ref gd.gazes); //gd.lineBreakDetectionOkoso(); //gd.rowDataLineBreak(-80); gazes.Add(gd); } return(gazes); }