import cv2
import numpy as np
height, width = 300, 300
R = np.full((height, width), 255, dtype=np.uint8) # Red plane (fully red)
G = np.zeros((height, width), dtype=np.uint8) # Green plane (zero)
B = np.full((height, width), 100, dtype=np.uint8) # Blue plane (some blue)
color_image = cv2.merge([B, G, R])
cv2.imshow("Color Image from R, G, B Planes", color_image)
cv2.waitKey(0)
cv2.destroyAllWindows()
No comments:
Post a Comment