function y = opening2( x, ntimes )
  
% FUNCTION Y = OPENING2( X, NTIMES )
  
  if nargin < 2
    error( [ mfilename ' needs 2 input arguments.' ] );
  end
  
  y = dilation2( erosion2( x, ntimes ), ntimes );
  