# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # 作業
#
# 使用 [Lena](http://optipng.sourceforge.net/pngtech/img/lena.png)
#
# - 改變圖片的 color space (`HLS`, `LAB`) 並呈現

# +
import cv2

img_path = 'lena.jpg'
img = cv2.imread(img_path, cv2.IMREAD_COLOR)

img_hsv = cv2.cvtColor(img,cv2.COLOR_BGR2HSV)
img_hls = cv2.cvtColor(img, cv2.COLOR_BGR2HLS)
img_lab = cv2.cvtColor(img, cv2.COLOR_BGR2LAB)

cv2.imshow('bgr', img)
cv2.imshow('hsv',img_hsv)
cv2.imshow('hls', img_hls)
cv2.imshow('lab', img_lab)
cv2.waitKey(0)

StarcoderdataJupyterScriptsDedupFiltered