Thursday, July 3, 2025

Create color image using R, G and B three separate planes

 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

Interference in Light vs Quantum States

🔬 The Double-Slit Experiment: Where It All Begins One of the most famous demonstrations of interference is the double-slit experiment. When...