preprocess/gammaAdjust.py
def adjust_gamma(img, gamma):
        """
        Adjust the gamma for given image
        :param img:
        :param gamma:
        :return:
        """
        inv_gamma = 1.0 / gamma
        table = np.array([((i / 255.0) ** inv_gamma) * 255 for i in np.arange(0, 256)]).astype('uint8')
        img_adjust = cv2.LUT(img, table)
        return img_adjust

        Adjust the gamma for given image
        :param img:
        :param gamma:
        :return:
        
Adjust the gamma for given image
Adjust the gamma for given image
def adjust_gamma(img, gamma):
        inv_gamma = 1.0 / gamma
        table = np.array([((i / 255.0) ** inv_gamma) * 255 for i in np.arange(0, 256)]).astype('uint8')
        img_adjust = cv2.LUT(img, table)
        return img_adjust
def adjust_gamma ( img , gamma ) : inv_gamma = 1.0 / gamma table = np . array ( [ ( ( i / 255.0 ) ** inv_gamma ) * 255 for i in np . arange ( 0 , 256 ) ] ) . astype ( 'uint8' ) img_adjust = cv2 . LUT ( img , table ) return img_adjust
Adjust the gamma for given image
Adjust the gamma for given image
"""
        Adjust the gamma for given image
        :param img:
        :param gamma:
        :return:
        """
None
img
None
gamma
None