Пример #1
0
 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();
 }
Пример #2
0
        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());
        }
Пример #3
0
        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);
        }
Пример #4
0
        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;
        }
Пример #5
0
        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);
        }