def adjust_sigmoid(image, cutoff=0.5, gain=10, inv=False):
 _assert_non_negative(image)
 dtype = image.dtype.type
 scale = float((dtype_limits(image, True)[1] - dtype_limits(image, True)[0]))
 if inv:
  out = ((1 - (1 / (1 + np.exp((gain * (cutoff - (image / scale))))))) * scale)
  return dtype(out)
 out = ((1 / (1 + np.exp((gain * (cutoff - (image / scale)))))) * scale)
 return dtype(out)

def adjust_sigmoid ( image , cutoff = 0.5 , gain = 10 , inv = False ) : _assert_non_negative ( image ) dtype = image . dtype . type scale = float ( ( dtype_limits ( image , True ) [ 1 ] - dtype_limits ( image , True ) [ 0 ] ) ) if inv : out = ( ( 1 - ( 1 / ( 1 + np . exp ( ( gain * ( cutoff - ( image / scale ) ) ) ) ) ) ) * scale ) return dtype ( out ) out = ( ( 1 / ( 1 + np . exp ( ( gain * ( cutoff - ( image / scale ) ) ) ) ) ) * scale ) return dtype ( out )
performs sigmoid correction on the input image .