Image Processing

image gamma 값 조정 (gamma correction)

민토즈 2020. 10. 14. 11:12
300x250
def gamma_correction(image, gamma=1.0):

   invGamma = 1.0 / gamma

   table = np.zeros((256, 1), dtype='uint8')

   for i in range(256):
      table[i] = ((i / 255.0) ** invGamma) * 255

   return cv2.LUT(image, table) 

 

(원본/gamma correction 0.5/gamma correction 1.5 적용)

 

300x250