예제 #1
0
        /// <summary>
        /// Applies laplacian operator to image
        /// </summary>
        /// <param name="imagePath">input image path</param>
        /// <param name="outputImagePath">output image path.</param>
        public void Apply(string imagePath, string outputImagePath)
        {
            var endResult          = this.Apply(imagePath);
            var endResultRGBMatrix = MatrixUtils.ConvertMatrixToRGBMatrix(endResult);

            MatrixUtils.CreateImageFromMatrixParalleled(endResultRGBMatrix, outputImagePath);
        }
예제 #2
0
        /// <summary>
        /// Blurs image with Gaussian filter
        /// </summary>
        /// <param name="sourceImagePath">source image path</param>
        /// <param name="outputImagePath">output image path</param>
        /// <param name="kernelSize"></param>
        /// <param name="standardDeviation"></param>
        public void Apply(string sourceImagePath, string outputImagePath, int kernelSize = 5,
                          float standardDeviation = 1f)
        {
            if (string.IsNullOrWhiteSpace(outputImagePath))
            {
                throw new ArgumentNullException(nameof(outputImagePath));
            }

            var convolutedImageMatrix = (RGBMatrix)this.Apply(sourceImagePath, kernelSize, standardDeviation);

            MatrixUtils.CreateImageFromMatrixParalleled(convolutedImageMatrix, outputImagePath);
        }