Example #1
0
        Bitmap DeconvolutionMoution(Bitmap source, float Length, int Angle, float Nsr)
        {
            var R = BitmapHelpers.BitmapToByteBitmap(source, 1, 0, 0);
            var G = BitmapHelpers.BitmapToByteBitmap(source, 0, 1, 0);
            var B = BitmapHelpers.BitmapToByteBitmap(source, 0, 0, 1);

            R = WienerDeconv.WienerFilterFromMoution(R, Length, Angle, Nsr);
            G = WienerDeconv.WienerFilterFromMoution(G, Length, Angle, Nsr);
            B = WienerDeconv.WienerFilterFromMoution(B, Length, Angle, Nsr);
            return(BitmapHelpers.ByteBitmapToBitmap(R, G, B));
        }
Example #2
0
        Bitmap DeconvolutionOutOfFocus(Bitmap source, float Nsr, float Radius, float Edge)
        {
            var R = BitmapHelpers.BitmapToByteBitmap(source, 1, 0, 0);
            var G = BitmapHelpers.BitmapToByteBitmap(source, 0, 1, 0);
            var B = BitmapHelpers.BitmapToByteBitmap(source, 0, 0, 1);

            R = WienerDeconv.WienerFilterFromOutOfFocus(R, Radius, Nsr, Edge);
            G = WienerDeconv.WienerFilterFromOutOfFocus(G, Radius, Nsr, Edge);
            B = WienerDeconv.WienerFilterFromOutOfFocus(B, Radius, Nsr, Edge);
            return(BitmapHelpers.ByteBitmapToBitmap(R, G, B));
        }
Example #3
0
        Bitmap DeconvolutionGaussian(Bitmap source, int HW, float Nsr, float sigma)
        {
            var R = BitmapHelpers.BitmapToByteBitmap(source, 1, 0, 0);
            var G = BitmapHelpers.BitmapToByteBitmap(source, 0, 1, 0);
            var B = BitmapHelpers.BitmapToByteBitmap(source, 0, 0, 1);

            R = WienerDeconv.WienerFilterFromGaussian(R, HW, sigma, Nsr);
            G = WienerDeconv.WienerFilterFromGaussian(G, HW, sigma, Nsr);
            B = WienerDeconv.WienerFilterFromGaussian(B, HW, sigma, Nsr);
            return(BitmapHelpers.ByteBitmapToBitmap(R, G, B));
        }