how to Create a Black Image in OpenCV

#hellow everyone today i am going to show you#how to create a black image in opencv
#first import opencv and numpy
import cv2
import numpy as np

#creating black image
#width of the image
width = 700
#height of the image
height = 600
Black_image = np.zeros( (width, height), dtype=np.uint8)

#displaying image untill press ESC button
while True:
    cv2.imshow('window', Black_image)
    if cv2.waitKey(1) == 27:
        breakcv2.destroyAllWindows()



Comments

Popular posts from this blog

Playing a video from file with color BGR, RGB, GRAY, HSV in OpenCV

Capturing Video via webcam