def METHOD_NAME(img):
    """Transform the input image such that the datatype after transformation is uint8, ready for opencv functions
    :param img: numpy.ndarray
    :return: img_: numpy.ndarray
    """
    debug_mode = params.debug
    params.debug = None
    try:
        img_ = rescale(img)
    except RuntimeError:
        img_ = img_as_ubyte(img)
    params.debug = debug_mode
    return img_