Thursday, July 3, 2025

Write given 2-D data in image file

 import numpy as np 

 import cv2 

 data=np.array([[255,0,255,0],[0,255,0,255],[255,0,255,0],[0,255,0,255]], dtype=np.uint8)

 cv2.imwrite('output_image.png',data) 

 cv2.imshow('image',data) 

 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...