OpenCV

gamma

728x90
import cv2
import numpy as np

img = cv2.imread('data/images/candle.jpg')

gamma = 0.5

fullRange = np.arange(0,256)

lookupTable = np.uint8(255*np.power((fullRange/255.0),gamma))

#lookuptable의 약자
output = cv2.LUT(img, lookupTable)

combined = np.hstack([img, output])

cv2.imshow('comb', combined)

cv2.waitKey(0)
cv2.destroyAllWindows()

728x90

'OpenCV' 카테고리의 다른 글

convolution  (0) 2021.04.20
warming/cooling  (0) 2021.04.20
contrast HistEq  (0) 2021.04.20
contrast Scaling 대비  (0) 2021.04.20
brightness 밝기 조절  (0) 2021.04.20