AForge.Imaging.Filters.Convolution.Convolution C# (CSharp) Метод

Convolution() публичный Метод

Initializes a new instance of the Convolution class.

Using this constructor (specifying only convolution kernel), division factor will be calculated automatically summing all kernel values. In the case if kernel's sum equals to zero, division factor will be assigned to 1.

Invalid kernel size is specified. Kernel must be /// square, its width/height should be odd and should be in the [3, 25] range.
public Convolution ( int kernel ) : System
kernel int Convolution kernel.
Результат System
        public Convolution( int[,] kernel ) : this( )
        {
            Kernel = kernel;

            divisor = 0;

            // calculate divisor
            for ( int i = 0, n = kernel.GetLength( 0 ); i < n; i++ )
            {
                for ( int j = 0, k = kernel.GetLength( 1 ); j < k; j++ )
                {
                    divisor += kernel[i, j];
                }
            }
            if ( divisor == 0 )
                divisor = 1;
        }

Same methods

Convolution::Convolution ( ) : System
Convolution::Convolution ( int kernel, int divisor ) : System