Exemplo n.º 1
0
        private void GenerateIndexLabels()
        {
            Record           record     = new Record();
            VideosCollection videos     = new VideosCollection();
            string           indexFile  = output_folder + "\\" + "Index.csv";
            string           surveyFile = null;
            string           stringTemp = null;
            string           videoName  = null;

            stringTemp += "Record" + ";" + "Video Name" + ";" + "Path - RGB Frames" + ";" + "Path - Depth Frames" + ";" + "Path - IR Frames" + ";" + "Q1" + ";" + "Q2" + ";" + "Q3" + ";" + "Q4" + ";" + "Q5" + ";" + "Q6" + ";" + "\n";

            using (StreamWriter sw = new StreamWriter(indexFile, false, Encoding.GetEncoding("ISO-8859-1")))
            {
                foreach (var d in dictPaths)
                {
                    surveyFile = Directory.GetFiles(d.Key, "Survey.txt")[0];
                    videos     = LoadSurveyJson(surveyFile);

                    foreach (var v in videos.Videos)
                    {
                        videoName   = v.VideoName.Split('\\').Last();//.Split('.')[0];
                        stringTemp += d.Value.root + ";" + videoName + ";" + d.Value.rgbFolder + "\\" + videoName.Split('.')[0] + ";"
                                      + d.Value.depthFolder + "\\" + videoName.Split('.')[0] + ";" + d.Value.irFolder + "\\" + videoName.Split('.')[0] + ";";
                        foreach (var a in v.Answers)
                        {
                            stringTemp += a.Answer + ";";
                        }
                        stringTemp += "\n";
                    }
                    sw.Write(stringTemp);
                    stringTemp = null;
                }
            }
        }
Exemplo n.º 2
0
        public VideosCollection LoadSurveyJson(string filename)
        {
            VideosCollection videos = JsonConvert.DeserializeObject <VideosCollection>(File.ReadAllText(filename));

            return(videos);
        }