Exemplo n.º 1
0
        public List <decimal> getCurveLatitude()
        {
            ProcBWValue();
            List <decimal> al = new List <decimal>();

            for (int i = 0; i < ValueBWList.Count; i++)
            {
                al.Add(Convert.ToDecimal(PhotoTest.getBrightness(ValueBWList[i]) * 255));
            }

            return(al);
        }
Exemplo n.º 2
0
        public decimal getBrightChanges(WriteableBitmap b) //测试亮度一致性
        {                                                  //使用中央点的亮度减去四角点的亮度平均值,需要使用CropPhoto
            Color c   = GetPixel(b, b.PixelWidth / 2, b.PixelHeight / 2);
            Color clt = GetPixel(b, 0, 0);
            Color crt = GetPixel(b, b.PixelWidth - 1, 0);
            Color clb = GetPixel(b, 0, b.PixelHeight - 1);
            Color crb = GetPixel(b, b.PixelWidth - 1, b.PixelHeight - 1);
            float lt  = PhotoTest.getBrightness(clt);
            float lb  = PhotoTest.getBrightness(clb);
            float rt  = PhotoTest.getBrightness(crt);
            float rb  = PhotoTest.getBrightness(crb);
            float bb  = lt + lb + rt + rb;

            bb = bb / 4;
            setProcessInfor("BrightChanges_BorderBright", bb);
            setProcessInfor("BrightChanges_LT", lt);
            setProcessInfor("BrightChanges_LB", lb);
            setProcessInfor("BrightChanges_RT", rt);
            setProcessInfor("BrightChanges_RB", rb);
            float cb = PhotoTest.getBrightness(c);

            setProcessInfor("BrightChanges_CBright", cb);
            return(Convert.ToDecimal(Math.Abs(cb - bb) / cb));//相当于四周变暗的比例
        }