My CV2 slider keeps starting with the value "None", but I need it to be an int instandly. The error code I'm getting is this: TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
The solution I tried is as follows:
def on_change(value):
pass
windowname = 'settings'
cv2.imshow(windowname, 0)
fovx = cv2.createTrackbar('fov x', windowname, int(640), int(1920), on_change)
fovy = cv2.createTrackbar('fov y', windowname, int(640), int(1080), on_change)
while True:
with mss() as sct:
dimensions = sct.monitors[1]
WINDOW_SIZEX = fovx
WINDOW_SIZEY = fovy
monitor = {"top": int((dimensions['height'] / 2) - (int(WINDOW_SIZEY) / 2)), "left": int((dimensions['width'] / 2) - (int(WINDOW_SIZEX) / 2)), "width": int(WINDOW_SIZEX), "height": int(WINDOW_SIZEY)}