def adjust_log(image, gain=1, 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 = ((((2 ** (image / scale)) - 1) * scale) * gain)
  return dtype(out)
 out = ((np.log2((1 + (image / scale))) * scale) * gain)
 return dtype(out)

def adjust_log ( image , gain = 1 , 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 = ( ( ( ( 2 ** ( image / scale ) ) - 1 ) * scale ) * gain ) return dtype ( out ) out = ( ( np . log2 ( ( 1 + ( image / scale ) ) ) * scale ) * gain ) return dtype ( out )
performs logarithmic correction on the input image .