Files
vinniesniper-54816/task1/_lab/remove_grass/main.py
louiscklaw 3b0b154910 update,
2025-02-01 01:19:51 +08:00

14 lines
240 B
Python

import cv2
import numpy as np
# Load the image
img = cv2.imread("image_508.jpg")
# Set the G channel to zero
img[:, :, 1] = 0
# Display the modified image
cv2.imshow("Image without G channel", img)
cv2.waitKey(0)
cv2.destroyAllWindows()