code: public static GrayU8 erode4(GrayU8 input, int numTimes, GrayU8 output) {
  		output = InputSanityCheck.checkDeclare(input, output);
  
  		if( numTimes <= 0 )
  			throw new IllegalArgumentException("numTimes must be >= 1");
  
  		if( BoofConcurrency.USE_CONCURRENT ) {
  			ImplBinaryInnerOps_MT.erode4(input, output);
  		} else {
  			ImplBinaryInnerOps.erode4(input, output);
  		}
  		ImplBinaryBorderOps.erode4(input, output);
  
  
  		if( numTimes > 1 ) {
  			GrayU8 tmp1 = new GrayU8(input.width,input.height);
  			GrayU8 tmp2 = output;
  
  			for( int i = 1; i < numTimes; i++ ) {
  				if( BoofConcurrency.USE_CONCURRENT ) {
  					ImplBinaryInnerOps_MT.erode4(tmp2, tmp1);
  				} else {
  					ImplBinaryInnerOps.erode4(tmp2, tmp1);
  				}
  				ImplBinaryBorderOps.erode4(tmp2, tmp1);
  
  				GrayU8 a = tmp1;
  				tmp1 = tmp2;
  				tmp2 = a;
  			}
  
  			if( tmp2 != output ) {
  				output.setTo(tmp2);
  			}
  		}
  
  		return output;
  	}
docs: <p>
  Erodes an image according to a 4-neighborhood.  Unless a pixel is connected to all its neighbors its value
  is set to zero.
  </p>
  
  @param input  Input image. Not modified.
  @param numTimes How many times the operation will be applied to the image.
  @param output If not null, the output image.  If null a new image is declared and returned.  Modified.
  @return Output image.