List <Result> TestGray(WriteableBitmap chart) { var rl = new List <Result>(); TestChart.setChart(chart); var Chart = TestChart as GrayChart; BrightChangesValue = Chart.getBrightChangesValue(); rl.Add(new Result() { Value = BrightChangesValue, TestTime = DateTime.Now, Name = "Bright changes", Memo = "", TestCount = 1, Dimension = "%" }); rl.Add(new Result() { Value = GBValue = Chart.ptp.getGBBrightChangedValue(CurrentPhoto, GBSelectAreaNum), TestTime = DateTime.Now, Name = "GB bright changes value", Memo = "", TestCount = 1, Dimension = "%" }); TestGB(chart); return(rl); }
void layer_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) { var layer = sender as Canvas; if (layer == null) { return; } if (layer.Children.Contains(ReferenceLine)) { layer.Children.Remove(ReferenceLine); } layer.PointerMoved -= layer_PointerMoved; layer.PointerPressed -= layer_PointerPressed; ActiveHeight = Convert.ToInt32( e.GetCurrentPoint(layer).Position.Y / layer.ActualHeight * CurrentPhoto.PixelHeight ); TestChart.setChart(CurrentPhoto); if (GradeDis == 0) { GradeDis = 7; } ActiveLatitudeValue = (TestChart as KDGrayChart).getLatitude(GradeDis); DrawLatitude(CurrentPhoto); }
public List <Result> TestLatitude(WriteableBitmap chart) { try { var rl = new List <Result>(); TestChart.setChart(chart); (TestChart as ITEGrayscaleChart).ConstGradeL = ConstL; LatitudeValue = (TestChart as ITEGrayscaleChart).getGrayGrade(TestAreaHeight, TestAreaWidth); Result lp = new Result(); lp.Name = "Latitude"; lp.Memo = "数据表示在一张照片里面可以分辨的灰阶亮度级别"; lp.Dimension = "Grade"; lp.Value = LatitudeValue; rl.Add(lp); if (LatitudeValue == 11) { ChartTestHelper.setGBSign(true, GBControl); } else { ChartTestHelper.setGBSign(false, GBControl); } ShowLatitude(); return(rl); } catch (Exception xe) { SilverlightLFC.common.Environment.ShowMessage(xe.Message); //testHelper.ProcessError(xe, "灰阶计算错误,请检查照片"); return(null); } }
List <Result> TestISO12233(WriteableBitmap chart) { var rl = new List <Result>(); TestChart.setChart(chart); var Chart = TestChart as ISO12233Chart; rl.Add(new Result() { Value = Chart.getLPResoveLines(), Name = "Resolution", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "LW/PH", }); rl.Add(new Result() { Value = Chart.getHEdgeResoveLines(), Name = "Horizontal Resolution", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "LW/PH", }); rl.Add(new Result() { Value = Chart.getVEdgeResoveLines(), Name = "Vertical Resolution", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "LW/PH" }); rl.Add(new Result() { Value = Chart.getHDispersiveness(), Name = "Horizontal Dispersiveness", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "Pix" }); rl.Add(new Result() { Value = Chart.getVDispersiveness(), Name = "Vertical Dispersiveness", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "Pix" }); return(rl); }
List<Result> TestGBAberration(WriteableBitmap photo) { var rl = new List<Result>(); TestChart.setChart(photo); var Chart = TestChart as AberrationChart; double _1l = getDistance(L10.Value, R10.Value); double _5l = getDistance(L50.Value, R50.Value); double _9l = getDistance(L90.Value, R90.Value); GBResult5 = Chart.ptp.getGBAberration(_5l, _1l, 5); GBResult9 = Chart.ptp.getGBAberration(_9l, _1l, 9); double h = 0.05; if (!IsLongFocus) { h = 0.07; } if (Math.Abs(GBResult5) < h && Math.Abs(GBResult9) < h) { ChartTestHelper.setGBSign(true, GBControl); } else { ChartTestHelper.setGBSign(false, GBControl); } Result lp = new Result(); lp.Name = "国标畸变测试0.5处"; lp.Memo = "计算照片变形程度测算畸变"; lp.Dimension = ""; lp.Value = GBResult5; rl.Add(lp); lp = new Result(); lp.Name = "国标畸变测试0.9处"; lp.Memo = "计算照片变形程度测算畸变"; lp.Dimension = ""; lp.Value = GBResult9; rl.Add(lp); return rl; }
public List <Result> TestLatitude(WriteableBitmap photo) { var rl = new List <Result>(); TestChart.setChart(photo); if (GradeDis == 0) { GradeDis = 7; } LatitudeValue = (TestChart as KDGrayChart).getLatitude(GradeDis); DrawLatitude(photo); var lp = new Result(); lp.Name = "宽容度"; lp.Memo = "数据表示在一张照片里面可以分辨的亮度级别"; lp.Dimension = "Grade"; lp.Value = LatitudeValue; rl.Add(lp); return(rl); }
List <Result> TestXRite(WriteableBitmap chart) { var rl = new List <Result>(); TestChart.setChart(chart); var Chart = TestChart as XRiteColorChart; rl.Add(new Result() { Value = Chart.getWhiteBanlance() * 100, Name = "Write banlance error percent", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "%" }); rl.Add(new Result() { Value = Chart.getNoiseNum() * 100, Name = "Noise percent", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "%" }); rl.Add(new Result() { Value = Chart.getColorDistance(), Name = "Average color trend error", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "degree" }); return(rl); }
List <Result> TestGBEv(WriteableBitmap photo) { var rl = new List <Result>(); TestChart.setChart(photo); EVDistance = (TestChart as GrayChart).ptp.getGBDEv(photo, gama, TestParameter); Result lp = new Result(); lp.Name = "曝光量误差"; lp.Memo = "计算照片中央明度来确定曝光量"; lp.Dimension = ""; lp.Value = EVDistance; rl.Add(lp); WriteableBitmap cb = (TestChart as GrayChart).ptp.getImageArea(photo, photo.PixelWidth / 4, photo.PixelHeight / 4, photo.PixelWidth / 2, photo.PixelHeight / 2); CenterL = (TestChart as GrayChart).ptp.getAverageColorL(cb); lp = new Result(); lp.Name = "中央平均明度"; lp.Memo = "照片中央明度"; lp.Dimension = ""; lp.Value = CenterL; rl.Add(lp); if (Math.Abs(EVDistance) >= 1) { ChartTestHelper.setGBSign(false, GBControl); } else { ChartTestHelper.setGBSign(true, GBControl); } return(rl); }
List <Result> TestXMark(WriteableBitmap chart) { var rl = new List <Result>(); TestChart.setChart(chart); var Chart = TestChart as XMarkChart; rl.Add(new Result() { Value = Chart.getAberration() * 100, Name = "Aberration", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "%" }); rl.Add(new Result() { Value = Chart.getBrightChanges() * 100, Name = "Bright Changes", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "%" }); rl.Add(new Result() { Value = Chart.getColorDis(), Name = "Average color trend error", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "degree" }); rl.Add(new Result() { Value = Chart.getHEdgeDispersiveness(), Name = "Center Horizontal Dispersiveness", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "Pix" }); rl.Add(new Result() { Value = Chart.getVEdgeDispersiveness(), Name = "Border Vertical Dispersiveness", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "Pix" }); rl.Add(new Result() { Value = Chart.getHEdgeResoveLines(), Name = "Center Horizontal Resolution", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "LW/PH" }); rl.Add(new Result() { Value = Chart.getVEdgeResoveLines(), Name = "Border Vertical Resolution", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "LW/PH" }); rl.Add(new Result() { Value = Chart.getLatitude(), Name = "Photo Latitude", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "degree" }); rl.Add(new Result() { Value = Chart.getNoiseNum() * 100, Name = "Noise percent", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "%" }); rl.Add(new Result() { Value = Chart.getPurplePercent() * 100, Name = "Purple pixel percent", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "%" }); rl.Add(new Result() { Value = Chart.getWaveQ() * 100, Name = "Wave bright error percent", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "%" }); rl.Add(new Result() { Value = Chart.getWhiteBanlance() * 100, Name = "White banlance error percent", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "%" }); return(rl); }
List <Result> TestAberration(WriteableBitmap chart) { var rl = new List <Result>(); TestChart.setChart(chart); var Chart = TestChart as AberrationChart; AberrationValue = Chart.getAberration(); rl.Add(new Result() { Value = BottomBlackLineDistance = Chart.getBottomBlackLinePix(), TestTime = DateTime.Now, Name = "Bottom black line max distance", Memo = "", TestCount = 1, Dimension = "Pix" }); rl.Add(new Result() { Value = BottomBlackLineNumber = Chart.getBottomBlackLineNum(), TestTime = DateTime.Now, Name = "Bottom black line number", Memo = "", TestCount = 1, Dimension = "" }); rl.Add(new Result() { Value = TopBlackLineDistance = Chart.getTopBlackLinePix(), TestTime = DateTime.Now, Name = "Top black line max distance", Memo = "", TestCount = 1, Dimension = "Pix" }); rl.Add(new Result() { Value = TopBlackLineNumber = Chart.getTopBlackLineNum(), TestTime = DateTime.Now, Name = "Top black line number", Memo = "", TestCount = 1, Dimension = "" }); rl.Add(new Result() { Value = MiddleBlackLineDistance = Chart.getCenterBlackLinePix(), TestTime = DateTime.Now, Name = "Center black line max distance", Memo = "", TestCount = 1, Dimension = "Pix" }); rl.Add(new Result() { Value = MiddleBlackLineNumber = Chart.getCenterBlackLineNum(), TestTime = DateTime.Now, Name = "Bottom black line number", Memo = "", TestCount = 1, Dimension = "" }); rl.Add(new Result() { Value = AberrationValue = Chart.getAberration(), Name = "Aberration percent", Memo = "", TestTime = DateTime.Now, TestCount = 1, Dimension = "%" }); return(rl); }