コード例 #1
0
		/// <summary>
		/// Run a blur matrix over the values
		/// </summary>
		/// <param name="values">Values to be blurred</param>
		/// <returns>Array containing the blurred values</returns>
		public static byte[,] BlurValues(byte[,] values)
		{
			ConvolutionMatrix matrix = new ConvolutionMatrix(
				1, 2, 1,
				2, 4, 2,
				1, 2, 1);

			matrix.Factor = 16;

			return ConvolutionMatrix.Apply(values, matrix);
		}
コード例 #2
0
		/// <summary>
		/// Run a sharpening matrix over the values
		/// </summary>
		/// <param name="values">Values to be sharpened</param>
		/// <returns>Array containing the sharpened values</returns>
		public static byte[,] SharpenValues(byte[,] values)
		{
			// sharpen
			ConvolutionMatrix matrix = new ConvolutionMatrix(
				0, -2, 0,
				-2, 11, -2,
				0, -2, 0);

			matrix.Factor = 3;

			return ConvolutionMatrix.Apply(values, matrix);
		}