function y = closure( x, ntimes )
  
% FUNCTION Y = CLOSURE( X, NTIMES )
  
  if nargin < 2
    error( [ mfilename ' needs 2 input arguments.' ] );
  end
  
  y = erosion( dilation( x, ntimes ), ntimes );
  