コード例 #1
0
        public static Mat GetSobelY(Mat source, BorderWrapType borderWrapType)
        {
            Mat dy = source.Clone();

            ConvolutionHelper.NonSeparable(source, dy, SobelKernelY, borderWrapType);
            return(dy);
        }
コード例 #2
0
        public static Mat SobelNonSeparable(Mat source, Mat dx, Mat dy)
        {
            ConvolutionHelper.NonSeparable(source, dx, SobelKernelX, BorderWrapType.Copy);
            ConvolutionHelper.NonSeparable(source, dy, SobelKernelY, BorderWrapType.Copy);

            var target = new Mat(source.Width, source.Height);

            for (var x = 0; x < source.Width; x++)
            {
                for (var y = 0; y < source.Height; y++)
                {
                    target.Set(x, y, MathHelper.SqrtOfSqrSum(dx.GetAt(x, y), dy.GetAt(x, y)));
                }
            }

            return(target);
        }