解决保存图片为空的错误

This commit is contained in:
2024-09-23 21:34:49 +08:00
parent c8648c04a4
commit 75018880b4
2 changed files with 16 additions and 12 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 11 KiB

+6 -2
View File
@@ -1,11 +1,15 @@
from pickletools import uint8
import cv2 as cv import cv2 as cv
import numpy as np import numpy as np
img=np.ones((512,512)) img = np.ones((512, 512, 3), dtype=np.uint8) * 255
def draw_circle(event, x, y, flags, param): def draw_circle(event, x, y, flags, param):
if event == cv.EVENT_LBUTTONDOWN: if event == cv.EVENT_LBUTTONDOWN:
cv.circle(img,(x,y),20,0,-1) cv.circle(img, (x, y), 20, (0, 0, 0), -1)
cv.namedWindow('show_img') cv.namedWindow('show_img')