public static IImageFloat <TType> SobelX <TType>(this IReadOnlyImageFloat <TType> @this, int kernelSize)
     where TType : IImageType, new()
 {
     return(@this.
            HorizontalConvolution(CollinearSobelKernel(kernelSize)).
            VerticalConvolution(TransverseSobelKernel(kernelSize)));
 }
コード例 #2
0
        public static IImageFloat <TType> GaussianBlur <TType>(this IReadOnlyImageFloat <TType> @this, Vector2 stdev, Vector2i kernelSize)
            where TType : IImageType, new()
        {
            var xGaussian = ComputeGaussian(stdev.X, kernelSize.X);
            var yGaussian = ComputeGaussian(stdev.Y, kernelSize.Y);

            return(@this.HorizontalConvolution(xGaussian).VerticalConvolution(yGaussian));
        }