Ejemplo n.º 1
0
        public void Test(List <WriteableBitmap> b)
        {
            if (b.Count == 0 || b == null)
            {
                return;
            }
            bl = b;
            try
            {
                HB.Photo = (b[1]);
                VB.Photo = (b[2]);
                xt       = new XMarkChart();
                decimal d = xt.getBrightChanges(b[0]);//原始
                textBoxBrightChanges.Text = d.ToString();
                textBoxBB.Text            = xt.ProcessInfor["BrightChanges_BorderBright"].ToString();
                textBoxCB.Text            = xt.ProcessInfor["BrightChanges_CBright"].ToString();
                LT.Text = xt.ProcessInfor["BrightChanges_LT"].ToString();
                LB.Text = xt.ProcessInfor["BrightChanges_LB"].ToString();
                RT.Text = xt.ProcessInfor["BrightChanges_RT"].ToString();
                RB.Text = xt.ProcessInfor["BrightChanges_RB"].ToString();

                List <int> hl, vl;
                DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest();
                hl           = pt.getImageGrayHLine(b[1], b[1].PixelHeight / 2);
                vl           = pt.getImageGrayVLine(b[2], b[2].PixelWidth / 2);
                dg.ForeColor = Colors.Blue;
                dg.DrawBrightLines(hl);
                dg.ForeColor = Colors.Red;
                dg.DrawBrightLines(vl);
            }
            catch (Exception xe)        //未知的异常
            {
                if (xe is LFCException) //已经是系统约定的错误类型,直接往上抛
                {
                    SilverlightLFC.common.Environment.ShowMessage(xe.Message);
                }
                else
                {
                    SilverlightLFC.common.Environment.ShowMessage("测试错误,请检查照片");
                }
            }
        }
Ejemplo n.º 2
0
        public void XMarkTest()//测试XMark卡的各种参数
        {
            processbar.Value = 0;
            ResultPanel.Children.Clear();
            sw.Stop();
            sw.Start();

            Button     li;
            XMarkChart xm = new XMarkChart(SourcePhoto);

            xm.CorrectChart();
            xm.BeginAnalyse();
            processbar.Value = 10;

            decimal r;

            r          = xm.getAberration() * 100;
            li         = new Button();
            li.Click  += new RoutedEventHandler(XMarkMTF_Click);
            li.Name    = "WAberration";
            li.Content = "广角端畸变:" + r.ToString() + " %";
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示照片里面几何变形程度,正表示桶形畸变,负表示枕型畸变,0为无畸变");
            ResultPanel.Children.Add(li);
            processbar.Value = 20;

            r          = Convert.ToDecimal(xm.getLatitude());
            li         = new Button();
            li.Name    = "DynamicLatitude";
            li.Content = "动态范围:" + r.ToString() + " 级";
            li.Click  += new RoutedEventHandler(XMarkLatitude_Click);
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示在一张照片里面可以分辨的灰度等级的数量");
            ResultPanel.Children.Add(li);
            processbar.Value = 30;

            r          = xm.getColorDis();
            li         = new Button();
            li.Name    = "ColorTrendValue";
            li.Content = "色彩趋向差异:" + r.ToString() + " 度";
            li.Click  += new RoutedEventHandler(XMarkColorDis_Click);
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示在拍摄标准颜色时候色调的偏差,完全准确时为0");
            ResultPanel.Children.Add(li);
            processbar.Value = 40;

            r          = xm.getNoiseNum() * 100;
            li         = new Button();
            li.Name    = "Noise";
            li.Content = "噪点:" + r.ToString() + " %";
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示在一张照片里面可以分辨的噪点数量");
            ResultPanel.Children.Add(li);
            processbar.Value = 50;

            r          = xm.getWhiteBanlance() * 100;
            li         = new Button();
            li.Name    = "AutoWhiteBalanceDistance";
            li.Content = "白平衡能力:" + r.ToString() + " %";
            li.Click  += new RoutedEventHandler(XMarkWhiteBalance_Click);
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示拍摄灰度的时刻偏离灰度的程度,完全准确时为0");
            ResultPanel.Children.Add(li);
            processbar.Value = 60;

            r          = Convert.ToDecimal(xm.getVEdgeDispersiveness());
            li         = new Button();
            li.Name    = "Dispersiveness";
            li.Content = "色散:" + r.ToString() + " Pxl";
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示红绿蓝三原色在边界分离的程度,也就是平均分离到几个像素,无色散时为0");
            li.Click += new RoutedEventHandler(XMarkDispersiveness_Click);
            ResultPanel.Children.Add(li);
            processbar.Value = 70;

            r          = xm.getBrightChanges() * 100;
            li         = new Button();
            li.Name    = "TLightingEquality";
            li.Content = "亮度一致性:" + r.ToString() + " %";
            li.Click  += new RoutedEventHandler(XMarkBrightChanges_Click);
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示在照片里面中心亮度和四周亮度的差异,无差异时为0");
            ResultPanel.Children.Add(li);
            processbar.Value = 80;

            r          = xm.getHEdgeResoveLines();
            li         = new Button();
            li.Name    = "ResolvingPower";
            li.Content = "分辨率:" + r.ToString() + " lw/ph";
            li.Click  += new RoutedEventHandler(XMarkMTF_Click);
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示在一张照片里面可以分辨的水平线条的数量");
            ResultPanel.Children.Add(li);
            processbar.Value = 90;

            r          = xm.getWaveQ() * 100;
            li         = new Button();
            li.Name    = "WaveQ";
            li.Content = "成像一致性:" + r.ToString() + " %";
            li.Click  += new RoutedEventHandler(XMarkWaveQ_Click);
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示照片里面还原正弦灰度区域的能力,完全还原时为0,差异越大数据越大");
            ResultPanel.Children.Add(li);
            processbar.Value = 100;

            sw.Stop();
            li.SetValue(ToolTipService.ToolTipProperty, "测试共花费" + sw.Interval.Milliseconds.ToString() + "ms");

            Logo.Source = xm.AnalysePhoto;
        }