segmentation_functions.py
def shift_HSV(img, amount=(0.9, 0.9, 0.9)):
    """Function to tune Hue, Saturation, and Value for image img"""
    img = Image.fromarray(img, 'RGB')
    hsv = img.convert('HSV')
    hsv = np.array(hsv)
    hsv[..., 0] = np.clip((hsv[..., 0] * amount[0]), a_max=255, a_min=0)
    hsv[..., 1] = np.clip((hsv[..., 1] * amount[1]), a_max=255, a_min=0)
    hsv[..., 2] = np.clip((hsv[..., 2] * amount[2]), a_max=255, a_min=0)
    new_img = Image.fromarray(hsv, 'HSV')
    return np.array(new_img.convert('RGB'))
Function to tune Hue, Saturation, and Value for image img
Function to tune Hue, Saturation, and Value for image img
Function to tune Hue Saturation and Value for image img
def shift_HSV(img, amount=(0.9, 0.9, 0.9)):
    img = Image.fromarray(img, 'RGB')
    hsv = img.convert('HSV')
    hsv = np.array(hsv)
    hsv[..., 0] = np.clip((hsv[..., 0] * amount[0]), a_max=255, a_min=0)
    hsv[..., 1] = np.clip((hsv[..., 1] * amount[1]), a_max=255, a_min=0)
    hsv[..., 2] = np.clip((hsv[..., 2] * amount[2]), a_max=255, a_min=0)
    new_img = Image.fromarray(hsv, 'HSV')
    return np.array(new_img.convert('RGB'))
def shift_HSV ( img , amount = ( 0.9 , 0.9 , 0.9 ) ) : img = Image . fromarray ( img , 'RGB' ) hsv = img . convert ( 'HSV' ) hsv = np . array ( hsv ) hsv [ ... , 0 ] = np . clip ( ( hsv [ ... , 0 ] * amount [ 0 ] ) , a_max = 255 , a_min = 0 ) hsv [ ... , 1 ] = np . clip ( ( hsv [ ... , 1 ] * amount [ 1 ] ) , a_max = 255 , a_min = 0 ) hsv [ ... , 2 ] = np . clip ( ( hsv [ ... , 2 ] * amount [ 2 ] ) , a_max = 255 , a_min = 0 ) new_img = Image . fromarray ( hsv , 'HSV' ) return np . array ( new_img . convert ( 'RGB' ) )
Function to tune Hue, Saturation, and Value for image img
Function to tune Hue Saturation and Value for image img
"""Function to tune Hue, Saturation, and Value for image img"""
img
amount