Represents a convolution matrix.
public class ConvolutionMatrix: Object
ObjectConvolutionMatrix
The Convolution is a method used in the treatment of image; it acts on each pixels of the image.
The Convolution method is a treatment of a matrix to one other; the first one is the image to be treated, the second one is the filter also known under the name of "kernel".
// This examples shows how to create and initialize a ConvolutionMatrix.
using System;
using System.Diagnostics;
using System.Drawing.Filters;
public class SampleConvolutionMatrix
{
static void Main()
{
// Creates a new ConvolutionMatrix.
ConvolutionMatrix convolMat = new ConvolutionMatrix(3,3);
// Sets some elements of the ConvolutionMatrix.
convolMat[0]=-2;
convolMat[1]=-1;
convolMat[2]=0;
convolMat[3]=-1;
convolMat[4]=1;
convolMat[5]=1;
convolMat[6]=0;
// Uses the number of the row and column of the ConvolutionMatrix.
convolMat[2,1]=1;
convolMat[2,2]=2;
// Displays the content of the ConvolutionMatrix.
Debug.WriteLine("\nConvolution matrix:" +convolMat
.ToString());}
}
/*
The output of the sample:
Convolution matrix:[-2,-1,0,-1,1,1,0,1,2]
*/
Namespace System.Drawing.Filters Flash Library System.Windows.Forms.scl Flash Library Version 2.0.0.2118 Silverlight Library System.Windows.Forms.dll
| © 2003-2007 NETiKA Technologies. All rights reserved. |