You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

11 lines
235 B

# 実験課題2
# 3.2 グレースケール化
import cv2
image_path = 'sample.jpg'
img = cv2.imread(image_path)
if img is not None:
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imwrite('3_2_grayscale.jpg', gray_img)