def binary_dilation(input, structure=None, iterations=1, mask=None, output=None, border_value=0, origin=0, brute_force=False):
 input = numpy.asarray(input)
 if (structure is None):
  structure = generate_binary_structure(input.ndim, 1)
 origin = _ni_support._normalize_sequence(origin, input.ndim)
 structure = numpy.asarray(structure)
 structure = structure[tuple(([slice(None, None, (-1))] * structure.ndim))]
 for ii in range(len(origin)):
  origin[ii] = (- origin[ii])
  if (not (structure.shape[ii] & 1)):
   origin[ii] -= 1
 return _binary_erosion(input, structure, iterations, mask, output, border_value, origin, 1, brute_force)

def binary_dilation ( input , structure = None , iterations = 1 , mask = None , output = None , border_value = 0 , origin = 0 , brute_force = False ) : input = numpy . asarray ( input ) if ( structure is None ) : structure = generate_binary_structure ( input . ndim , 1 ) origin = _ni_support . _normalize_sequence ( origin , input . ndim ) structure = numpy . asarray ( structure ) structure = structure [ tuple ( ( [ slice ( None , None , ( - 1 ) ) ] * structure . ndim ) ) ] for ii in range ( len ( origin ) ) : origin [ ii ] = ( - origin [ ii ] ) if ( not ( structure . shape [ ii ] & 1 ) ) : origin [ ii ] -= 1 return _binary_erosion ( input , structure , iterations , mask , output , border_value , origin , 1 , brute_force )
return fast binary morphological dilation of an image .