techoverload/slave/image.py

23 lines
751 B
Python
Raw Normal View History

2022-07-20 11:46:36 +00:00
import cv2
2022-07-21 12:09:36 +00:00
import numpy as np
2022-07-20 11:46:36 +00:00
from time import sleep
2022-07-21 12:09:36 +00:00
class Image:
def __init__(self, x, y):
self.x = x
self.y = y
2022-07-20 11:46:36 +00:00
2022-07-21 12:09:36 +00:00
def show(self, path):
image = cv2.imread(path)
cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
cv2.moveWindow("window", self.x, self.y)
cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
cv2.imshow("window", image)
2022-07-20 11:46:36 +00:00
2022-07-21 12:09:36 +00:00
def blank(self):
blank_image = np.zeros(shape=[512, 512, 3], dtype=np.uint8)
cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
cv2.moveWindow("window", self.x, self.y)
cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
cv2.imshow("window", blank_image)