public byte[,] Reconstruct() { // Erosion without a mask MorphologicalFilter f1 = new Erosion(this.Ekernel, 1); var image = f1.Morph(this.Input, MorphologicalFilter.UseMask.No); byte[,] lastImage = new byte[this.Input.GetLength(0), this.Input.GetLength(1)]; HelperFunctions.GlobalMask = this.Input; while (!IsEqual(image, lastImage)) { lastImage = image; // Dilation with a mask MorphologicalFilter f2 = new Dilation(this.Dkernel, 1); image = f2.Morph(image, this._e); } return(lastImage); }