OpenCV

contrast HistEq

728x90

 

import cv2
import numpy as np

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

ycbImage = cv2.cvtColor(img, cv2.COLOR_BGR2YCrCb)

Ychannel, Cr,Cb =cv2.split(ycbImage)

Ychannel = cv2.equalizeHist(Ychannel)

ycbImage = cv2.merge([Ychannel,Cr,Cb])

ycbImage = cv2.cvtColor(ycbImage, cv2.COLOR_YCrCb2BGR)

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


cv2.imshow('comb', combined)


cv2.waitKey(0)
cv2.destroyAllWindows()

728x90

'OpenCV' 카테고리의 다른 글

warming/cooling  (0) 2021.04.20
gamma  (0) 2021.04.20
contrast Scaling 대비  (0) 2021.04.20
brightness 밝기 조절  (0) 2021.04.20
Color Transfer 필터 입히기  (0) 2021.04.20