Exemplo n.º 1
0
 private void 读入参考数据_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFileDialog opf = new OpenFileDialog();
         opf.Filter = "(*.txt)|*.txt";
         status_text("玩命加载中   请稍等……", Color.Black);
         if (opf.ShowDialog() == DialogResult.OK)
         {
             dis_result[0] = new discriminant_result();
             string       rpath = opf.FileName;            //获得文件地址
             StreamReader sr    = new StreamReader(rpath); //打开文件
             dis_result[0].model_name = sr.ReadLine().Trim();
             while (!sr.EndOfStream)
             {
                 string[] line = sr.ReadLine().Trim().Split(',', ',');
                 int[]    a    = new int[] { int.Parse(line[0]), int.Parse(line[1]) };
                 dis_result[0].model_result.Add(a);
             }
             sr.Close();
         }
         REPORT_show.Text  = "----------------------------------目视解译 线匹配---------------------------------\r\n";
         REPORT_show.Text += "图层1    -->  图层2" + "\r\n";
         for (int i = 0; i < dis_result[0].model_result.Count; i++)
         {
             REPORT_show.Text += "线实体" + dis_result[0].model_result[i][0] + "  -->  " + "线实体" + dis_result[0].model_result[i][1] + "\r\n";
         }
         REPORT_show.BringToFront();
         status_text("读取参考数据成功", Color.Black);
     }
     catch { status_text("读取参考数据失败", Color.Red); }
 }
Exemplo n.º 2
0
 private void 评价_Click(object sender, EventArgs e)      //生成匹配评价精度结果
 {
     if (dis_result[0] == null)
     {
         status_text("请先读取参考数据!", Color.Red);  return;
     }
     try
     {
         一键生成全部ToolStripMenuItem_Click(this, e);
         REPORT_show.Text  = "";
         REPORT_show.Text += "\r\n";
         REPORT_show.Text += "----------------------------------目视解译 线匹配---------------------------------\r\n";
         REPORT_show.Text += "图层1    -->  图层2" + "\r\n";
         for (int i = 0; i < dis_result[0].model_result.Count; i++)
         {
             REPORT_show.Text += "线实体" + dis_result[0].model_result[i][0] + "  -->  " + "线实体" + dis_result[0].model_result[i][1] + "\r\n";
         }
         int real_ture = dis_result[0].model_result.Count;
         REPORT_show.Text += "\r\n";
         REPORT_show.Text += "----------------------------------线匹配结果评价---------------------------------\r\n";
         for (int i = 1; i < 5; i++)
         {
             int model_true = 0;
             REPORT_show.Text += "匹配模型:" + dis_result[i].model_name + "\r\n";
             REPORT_show.Text += "图层1    -->  图层2" + "\r\n";
             for (int ii = 0; ii < dis_result[i].model_result.Count; ii++)
             {
                 REPORT_show.Text += "线实体" + dis_result[i].model_result[ii][0] + "  -->  " + "线实体" + dis_result[i].model_result[ii][1] + "\r\n";
                 for (int j = 0; j < dis_result[0].model_result.Count; j++)
                 {
                     if (dis_result[0].model_result[j][0] == dis_result[i].model_result[ii][0] && dis_result[0].model_result[j][1] == dis_result[i].model_result[ii][1])
                     {
                         model_true++; break;
                     }
                 }
             }
             if (dis_result[i].model_result.Count != 0)
             {
                 REPORT_show.Text += "匹配精度(或叫匹配查准率)Matching precision(P)" + ((double)model_true / dis_result[i].model_result.Count * 100).ToString("0.000") + "%\r\n";
             }
             else
             {
                 REPORT_show.Text += "匹配精度(或叫匹配查准率)Matching precision(P)" + 0.ToString("0.000") + "%\r\n";
             }
             REPORT_show.Text += "匹配查全率 Matching recall(R):" + ((double)model_true / real_ture * 100).ToString("0.000") + "%\r\n";
             REPORT_show.Text += "-------------------------------------------------------------------------------\r\n";
         }
         REPORT_show.BringToFront();
     }
     catch { status_text("请先确保图层信息完整!", Color.Red); return; }
 }
Exemplo n.º 3
0
        private void 基于改进的Hausdorff_SMHD距离_Click(object sender, EventArgs e)
        {
            try
            {
                if (shp1.line.Count == 0 || shp2.line.Count == 0)
                {
                    status_text("请确保有两个图层信息,否则无法进行匹配!", Color.Red); return;
                }
                status_text("努力计算中……,请稍等……", Color.Red);
                status_text("生成报告成功,报告显示", Color.Black);

                List <List <double> > im_hausdorff_D = new List <List <double> >();
                im_hausdorff_D   = creat_report.improve_Hausdorff(shp1, shp2);
                REPORT_show.Text = "";
                data_show(im_hausdorff_D, "基于改进的Hausdorff_SMHD距离");
                REPORT_show.BringToFront();
            }
            catch { status_text("请确保有两个图层信息,否则无法进行匹配!", Color.Red); }
        }
Exemplo n.º 4
0
        private void 基于平均Frechet距离ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (shp1.line.Count == 0 || shp2.line.Count == 0)
                {
                    status_text("请确保有两个图层信息,否则无法进行匹配!", Color.Red); return;
                }
                status_text("努力计算中……,请稍等……", Color.Red);
                status_text("生成报告成功,报告显示", Color.Black);

                List <List <double> > aver_Frechet_D = new List <List <double> >();
                aver_Frechet_D   = creat_report.aver_Feachet(shp1, shp2);
                REPORT_show.Text = "";
                data_show(aver_Frechet_D, "基于平均Frechet距离");
                REPORT_show.BringToFront();
            }
            catch { status_text("请确保有两个图层信息,否则无法进行匹配!", Color.Red); }
        }
Exemplo n.º 5
0
 private void REPORT_window_Click(object sender, EventArgs e)
 {
     REPORT_show.BringToFront();
     status_text("报告窗口显示", Color.Black);
 }