I'm trying to create a new image of size 1920 x 1080 with opencv and currently do not care what color it is. I am having trouble finding how to do this. I found this however it is outdated and imports cv rather than cv2, which apparently does not contain CreateImage().
CodePudding user response:
OpenCV in Python use numpy.ndarray
as its data container. So if you want to create an 3 channels 8 bits image with all-zero pixels, just use numpy.zeros([1920, 1080, 3], np.uint8)