コード例 #1
0
        private void btnGetResultForTrecEvalColor_Click(object sender, EventArgs e)
        {
            // load index for search
            Dictionary <string, string> pctIndexingDataEval = PCTIndexing.LoadImageIndexStrorageV2(ConfigCommon.PCT_INDEX_STORAGE_EVAL);

            // read queries
            Dictionary <string, string> dicQueries = ReadTopicFile(ConfigEvaluation.topicFile_color);

            foreach (var item in dicQueries)
            {
                Console.WriteLine(string.Format("'{0}'", item.Value));
            }

            // search for each query
            FileStream fs = File.Create(ConfigEvaluation.resultsFile_color);

            fs.Close();
            StreamWriter sw = new StreamWriter(ConfigEvaluation.resultsFile_color);

            foreach (var query in dicQueries)
            {
                // example: 301	Q0	FR940202-2-00150	104	  2.129133	STANDARD
                List <float>  listScores;
                List <string> listFrameName = SearchByColor(pctIndexingDataEval, query.Value);
                if (listFrameName == null)
                {
                    sw.Write(query.Key + "\tQ0\tNULL\tNULL\tNULL\tNULL\n");
                    continue;
                }

                HashSet <string> hsDocRetrieval = new HashSet <string>();
                for (int i = 0; i < listFrameName.Count; i++)
                {
                    string docRetrieval = GetDocRetrieval(listFrameName[i]);
                    if (!hsDocRetrieval.Contains(docRetrieval))
                    {
                        hsDocRetrieval.Add(docRetrieval);
                    }

                    if (hsDocRetrieval.Count == 100)
                    {
                        break;
                    }
                }
                for (int i = 0; i < hsDocRetrieval.Count; i++)
                {
                    //string docRelevanced = GetDocRelevanced(((TextCaption)listTextCaptions[i]).FrameName);
                    string record = string.Format("{0}\tQ0\t{1}\t{2}\t{3}\tRUN_0", query.Key, hsDocRetrieval.ElementAt(i), (i + 1), 0);
                    //Console.WriteLine(record);
                    sw.Write(record + "\n");
                }
                Console.WriteLine(query.Key);
            }
            sw.Close();
            Console.WriteLine("Finish");
        }
コード例 #2
0
        void VideoBrowsingForm_Load(object sender, EventArgs e)
        {
            textSpotingIndexStorage = new IndexStorage(ConfigCommon.TEXTSPOTTING_INDEX_STORAGE);
            textSpotingIndexStorage.OpenIndexStore();

            textCaptionIndexStorage = new IndexStorage(ConfigCommon.CAPTION_INDEX_STORAGE);
            textCaptionIndexStorage.OpenIndexStore();

            mappingVideoName = FileManager.GetInstance().GetDictionaryVideoName(ConfigCommon.MAPPING_VIDEO_NAME_PATH);
            mappingFPS       = XMLParser.GetFPSDictionary(ConfigCommon.FPS_VIDEO_PATH);

            pctIndexingData = PCTIndexing.LoadImageIndexStrorageV2(ConfigCommon.PCT_INDEX_STORAGE);
        }
コード例 #3
0
        private void btnPCTIndexing_Click(object sender, EventArgs e)
        {
            if (ConfigPCT.COLOR_SPACE_USING == ConfigPCT.ColorSpace.RGB)
            {
                PCTIndexing.RunIndexing_RGB(ConfigCommon.PCT_INDEX_STORAGE);
            }
            else if (ConfigPCT.COLOR_SPACE_USING == ConfigPCT.ColorSpace.Lab)
            {
                PCTIndexing.RunIndexing_Lab(ConfigCommon.PCT_INDEX_STORAGE);
            }

            //PCTIndexing.RunIndexing_LabColor(Config.PCT_INDEX_STORAGE);

            //Dictionary<String, List<String>> dic = PCTIndexing.LoadImageIndexStrorage(Config.PCT_INDEX_STORAGE);
        }