From 5d0764988f751b2704a27df3f956412d055d42ba Mon Sep 17 00:00:00 2001 From: jimmy Date: Wed, 20 Jul 2022 23:46:36 +1200 Subject: [PATCH] Add image --- slave/image.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 slave/image.py diff --git a/slave/image.py b/slave/image.py new file mode 100644 index 0000000..dce7871 --- /dev/null +++ b/slave/image.py @@ -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) \ No newline at end of file