Add image

This commit is contained in:
jimmy 2022-07-20 23:46:36 +12:00
parent c9c0dd14b5
commit 5d0764988f
1 changed files with 23 additions and 0 deletions

23
slave/image.py Normal file
View File

@ -0,0 +1,23 @@
from PIL import Image, ImageDraw
import cv2
import numpy
from time import sleep
def blank(x, y):
image = Image.new('RGB', (1920, 1080), color='black')
draw = ImageDraw.Draw(image)
draw.ellipse((0, 0, 500, 500), fill='Black')
draw.ellipse((10, 10, 490, 490), fill='White')
opencvImage = cv2.cvtColor(numpy.array(image), cv2.COLOR_RGB2BGR)
cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
cv2.moveWindow("window", 0, 0)
cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
cv2.imshow("window", opencvImage)
if __name__ == "__main__":
blank(0, 0)
cv2.waitKey(1000)