def morphological_laplace(input, size=None, footprint=None, structure=None, output=None, mode='reflect', cval=0.0, origin=0):
 tmp1 = grey_dilation(input, size, footprint, structure, None, mode, cval, origin)
 if isinstance(output, numpy.ndarray):
  grey_erosion(input, size, footprint, structure, output, mode, cval, origin)
  numpy.add(tmp1, output, output)
  numpy.subtract(output, input, output)
  return numpy.subtract(output, input, output)
 else:
  tmp2 = grey_erosion(input, size, footprint, structure, None, mode, cval, origin)
  numpy.add(tmp1, tmp2, tmp2)
  numpy.subtract(tmp2, input, tmp2)
  numpy.subtract(tmp2, input, tmp2)
  return tmp2

def morphological_laplace ( input , size = None , footprint = None , structure = None , output = None , mode = 'reflect' , cval = 0.0 , origin = 0 ) : tmp1 = grey_dilation ( input , size , footprint , structure , None , mode , cval , origin ) if isinstance ( output , numpy . ndarray ) : grey_erosion ( input , size , footprint , structure , output , mode , cval , origin ) numpy . add ( tmp1 , output , output ) numpy . subtract ( output , input , output ) return numpy . subtract ( output , input , output ) else : tmp2 = grey_erosion ( input , size , footprint , structure , None , mode , cval , origin ) numpy . add ( tmp1 , tmp2 , tmp2 ) numpy . subtract ( tmp2 , input , tmp2 ) numpy . subtract ( tmp2 , input , tmp2 ) return tmp2
multi-dimensional morphological laplace .