📜  cv2 打开空白窗口 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:36.605000             🧑  作者: Mango

代码示例1
# sadly, if you're using cv2.imread(), not many options exist...

import cv2
import numpy as np
# black blank image
blank_image = np.zeros(shape=[512, 512, 3], dtype=np.uint8)
# print(blank_image.shape)
cv2.imshow("Black Blank", blank_image)
# white blank image
blank_image2 = 255 * np.ones(shape=[512, 512, 3], dtype=np.uint8)
cv2.imshow("White Blank", blank_image2)
cv2.waitKey(0)
cv2.destroyAllWindows()