AForge.Imaging.Filters.HitAndMiss.HitAndMiss C# (CSharp) Method

HitAndMiss() public method

Initializes a new instance of the HitAndMiss class.

Structuring elemement for the hit-and-miss morphological operator must be square matrix with odd size in the range of [3, 99].

Invalid size of structuring element.
public HitAndMiss ( short se ) : System
se short Structuring element.
return System
        public HitAndMiss( short[,] se )
        {
            int s = se.GetLength( 0 );

            // check structuring element size
            if ( ( s != se.GetLength( 1 ) ) || ( s < 3 ) || ( s > 99 ) || ( s % 2 == 0 ) )
                throw new ArgumentException( );

            this.se = se;
            this.size = s;

            // initialize format translation dictionary
            formatTranslations[PixelFormat.Format8bppIndexed] = PixelFormat.Format8bppIndexed;
        }

Same methods

HitAndMiss::HitAndMiss ( short se, Modes mode ) : System