OpenCV

hueHistogram

728x90
import cv2
import numpy as np
# from utils import get_four_points

img = cv2.imread("data/images/sample.jpg", 1)

gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

hsv_img = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)

print(hsv_img)

#hue
hsv_img[2]=hsv_img[2]-100

bgr_img = cv2.cvtColor(hsv_img, cv2.COLOR_HSV2BGR)

cv2.imshow('color',img)
cv2.imshow('gray',gray_img)
cv2.imshow('hsv',hsv_img)
cv2.imshow('bgr',bgr_img)
cv2.waitKey(0)
cv2.destroyAllWindows()

728x90

'OpenCV' 카테고리의 다른 글

Color Transfer 필터 입히기  (0) 2021.04.20
desaturation  (0) 2021.04.20
virtual Bilbord(빌보드 전광판 사진 바꾸기)  (0) 2021.04.20
perspective Correction(클릭해서 이미지 추출)  (0) 2021.04.20
homography_book  (0) 2021.04.20