728x90
import cv2
import numpy as np
img = cv2.imread('data/images/candle.jpg')
scaleFactor = 2.5
ycbImage = cv2.cvtColor(img, cv2.COLOR_BGR2YCrCb)
ycbImage = ycbImage.astype('float')
Ychannel, Cr,Cb =cv2.split(ycbImage)
Ychannel = np.clip(Ychannel*scaleFactor,0,255)
ycbImage = cv2.merge([Ychannel,Cr,Cb])
ycbImage = np.uint8(ycbImage)
ycbImage = cv2.cvtColor(ycbImage, cv2.COLOR_YCrCb2BGR)
combined = np.hstack([img, ycbImage])
cv2.imshow('comb', combined)
cv2.waitKey(0)
cv2.destroyAllWindows()
728x90
'OpenCV' 카테고리의 다른 글
gamma (0) | 2021.04.20 |
---|---|
contrast HistEq (0) | 2021.04.20 |
brightness 밝기 조절 (0) | 2021.04.20 |
Color Transfer 필터 입히기 (0) | 2021.04.20 |
desaturation (0) | 2021.04.20 |