parameters: (input, structure=None, iterations=1, output=None,
                     origin=0)
return_statement: return binary_dilation(tmp, structure, iterations, None, output, 0,
                             origin)
docstring: Multi-dimensional binary opening with the given structuring element.
  
      The *opening* of an input image by a structuring element is the
      *dilation* of the *erosion* of the image by the structuring element.
  
      Parameters
      ----------
      input : array_like
          Binary array_like to be opened. Non-zero (True) elements form
          the subset to be opened.
      structure : array_like, optional
          Structuring element used for the opening. Non-zero elements are
          considered True. If no structuring element is provided an element
          is generated with a square connectivity equal to one (i.e., only
          nearest neighbors are connected to the center, diagonally-connected
          elements are not considered neighbors).
      iterations : {int, float}, optional
          The erosion step of the opening, then the dilation step are each
          repeated `iterations` times (one, by default). If `iterations` is
          less than 1, each operation is repeated until the result does
          not change anymore.
      output : ndarray, optional
          Array of the same shape as input, into which the output is placed.
          By default, a new array is created.
      origin : int or tuple of ints, optional
          Placement of the filter, by default 0.
  
      Returns
      -------
      binary_opening : ndarray of bools
          Opening of the input by the structuring element.
  
      See also
      --------
      grey_opening, binary_closing, binary_erosion, binary_dilation,
      generate_binary_structure
  
      Notes
      -----
      *Opening* [1]_ is a mathematical morphology operation [2]_ that
      consists in the succession of an erosion and a dilation of the
      input with the same structuring element. Opening therefore removes
      objects smaller than the structuring element.
  
      Together with *closing* (`binary_closing`), opening can be used for
      noise removal.
  
      References
      ----------
      .. [1] http://en.wikipedia.org/wiki/Opening_%28morphology%29
      .. [2] http://en.wikipedia.org/wiki/Mathematical_morphology
  
      Examples
      --------
      >>> from scipy import ndimage
      >>> a = np.zeros((5,5), dtype=int)
      >>> a[1:4, 1:4] = 1; a[4, 4] = 1
      >>> a
      array([[0, 0, 0, 0, 0],
             [0, 1, 1, 1, 0],
             [0, 1, 1, 1, 0],
             [0, 1, 1, 1, 0],
             [0, 0, 0, 0, 1]])
      >>> # Opening removes small objects
      >>> ndimage.binary_opening(a, structure=np.ones((3,3))).astype(int)
      array([[0, 0, 0, 0, 0],
             [0, 1, 1, 1, 0],
             [0, 1, 1, 1, 0],
             [0, 1, 1, 1, 0],
             [0, 0, 0, 0, 0]])
      >>> # Opening can also smooth corners
      >>> ndimage.binary_opening(a).astype(int)
      array([[0, 0, 0, 0, 0],
             [0, 0, 1, 0, 0],
             [0, 1, 1, 1, 0],
             [0, 0, 1, 0, 0],
             [0, 0, 0, 0, 0]])
      >>> # Opening is the dilation of the erosion of the input
      >>> ndimage.binary_erosion(a).astype(int)
      array([[0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0],
             [0, 0, 1, 0, 0],
             [0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0]])
      >>> ndimage.binary_dilation(ndimage.binary_erosion(a)).astype(int)
      array([[0, 0, 0, 0, 0],
             [0, 0, 1, 0, 0],
             [0, 1, 1, 1, 0],
             [0, 0, 1, 0, 0],
             [0, 0, 0, 0, 0]])
docstring_summary: Multi-dimensional binary opening with the given structuring element.
docstring_tokens: Multi - dimensional binary opening with the given structuring element .
function: def binary_opening(input, structure=None, iterations=1, output=None,
                     origin=0):
      """
      Multi-dimensional binary opening with the given structuring element.
  
      The *opening* of an input image by a structuring element is the
      *dilation* of the *erosion* of the image by the structuring element.
  
      Parameters
      ----------
      input : array_like
          Binary array_like to be opened. Non-zero (True) elements form
          the subset to be opened.
      structure : array_like, optional
          Structuring element used for the opening. Non-zero elements are
          considered True. If no structuring element is provided an element
          is generated with a square connectivity equal to one (i.e., only
          nearest neighbors are connected to the center, diagonally-connected
          elements are not considered neighbors).
      iterations : {int, float}, optional
          The erosion step of the opening, then the dilation step are each
          repeated `iterations` times (one, by default). If `iterations` is
          less than 1, each operation is repeated until the result does
          not change anymore.
      output : ndarray, optional
          Array of the same shape as input, into which the output is placed.
          By default, a new array is created.
      origin : int or tuple of ints, optional
          Placement of the filter, by default 0.
  
      Returns
      -------
      binary_opening : ndarray of bools
          Opening of the input by the structuring element.
  
      See also
      --------
      grey_opening, binary_closing, binary_erosion, binary_dilation,
      generate_binary_structure
  
      Notes
      -----
      *Opening* [1]_ is a mathematical morphology operation [2]_ that
      consists in the succession of an erosion and a dilation of the
      input with the same structuring element. Opening therefore removes
      objects smaller than the structuring element.
  
      Together with *closing* (`binary_closing`), opening can be used for
      noise removal.
  
      References
      ----------
      .. [1] http://en.wikipedia.org/wiki/Opening_%28morphology%29
      .. [2] http://en.wikipedia.org/wiki/Mathematical_morphology
  
      Examples
      --------
      >>> from scipy import ndimage
      >>> a = np.zeros((5,5), dtype=int)
      >>> a[1:4, 1:4] = 1; a[4, 4] = 1
      >>> a
      array([[0, 0, 0, 0, 0],
             [0, 1, 1, 1, 0],
             [0, 1, 1, 1, 0],
             [0, 1, 1, 1, 0],
             [0, 0, 0, 0, 1]])
      >>> # Opening removes small objects
      >>> ndimage.binary_opening(a, structure=np.ones((3,3))).astype(int)
      array([[0, 0, 0, 0, 0],
             [0, 1, 1, 1, 0],
             [0, 1, 1, 1, 0],
             [0, 1, 1, 1, 0],
             [0, 0, 0, 0, 0]])
      >>> # Opening can also smooth corners
      >>> ndimage.binary_opening(a).astype(int)
      array([[0, 0, 0, 0, 0],
             [0, 0, 1, 0, 0],
             [0, 1, 1, 1, 0],
             [0, 0, 1, 0, 0],
             [0, 0, 0, 0, 0]])
      >>> # Opening is the dilation of the erosion of the input
      >>> ndimage.binary_erosion(a).astype(int)
      array([[0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0],
             [0, 0, 1, 0, 0],
             [0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0]])
      >>> ndimage.binary_dilation(ndimage.binary_erosion(a)).astype(int)
      array([[0, 0, 0, 0, 0],
             [0, 0, 1, 0, 0],
             [0, 1, 1, 1, 0],
             [0, 0, 1, 0, 0],
             [0, 0, 0, 0, 0]])
  
      """
      input = numpy.asarray(input)
      if structure is None:
          rank = input.ndim
          structure = generate_binary_structure(rank, 1)
  
      tmp = binary_erosion(input, structure, iterations, None, None, 0,
                           origin)
      return binary_dilation(tmp, structure, iterations, None, output, 0,
                             origin)
function_tokens: def binary_opening ( input , structure = None , iterations = 1 , output = None , origin = 0 ) : input = numpy . asarray ( input ) if structure is None : rank = input . ndim structure = generate_binary_structure ( rank , 1 ) tmp = binary_erosion ( input , structure , iterations , None , None , 0 , origin ) return binary_dilation ( tmp , structure , iterations , None , output , 0 , origin )