Beispiel #1
0
        public Bitmap BackCorrectionFunction()
        {
            int width  = MyImage.Width;
            int height = MyImage.Height;

            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    int r = CorrectionFunctionImage.GetPixel(i, j).R *CorrectionFunctionImage.GetPixel(i, j).R;
                    int g = CorrectionFunctionImage.GetPixel(i, j).G *CorrectionFunctionImage.GetPixel(i, j).G;
                    int b = CorrectionFunctionImage.GetPixel(i, j).B *CorrectionFunctionImage.GetPixel(i, j).B;
                    BackCorrectionFunctionImage.SetPixel(i, j, Color.FromArgb(r, g, b));
                }
            }
            return(BackCorrectionFunctionImage);
        }
Beispiel #2
0
        public void CorrectionFunction()
        {
            int width  = MyImage.Width;
            int height = MyImage.Height;

            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    //int partR = (int)(Math.Sqrt((double)MyImage.GetPixel(i, j).R / 255) * Math.Sqrt(255));
                    //int partG = (int)(Math.Sqrt((double)MyImage.GetPixel(i, j).G / 255) * Math.Sqrt(255));
                    //int partB = (int)(Math.Sqrt((double)MyImage.GetPixel(i, j).B / 255) * Math.Sqrt(255));
                    int partR = (int)Math.Sqrt(MyImage.GetPixel(i, j).R);
                    int partG = (int)Math.Sqrt(MyImage.GetPixel(i, j).G);
                    int partB = (int)Math.Sqrt(MyImage.GetPixel(i, j).B);
                    CorrectionFunctionImage.SetPixel(i, j, Color.FromArgb(partR, partG, partB));
                }
            }
        }