I am trying to screenshot using mss library add display it using below code but getting same error every time. Is there a fix for this error
TypeError: Expected Ptr<cv::UMat> for argument 'mat'
** I am using this in Macos not windows
import cv2 as cv
import numpy as np
import os
from time import time
from mss import mss
os.chdir(os.path.dirname(os.path.abspath(__file__)))
loop_time = time()
with mss() as sct:
while (True):
monitor_1 = sct.monitors[1] # Identify the display to capture
screenshot = sct.grab(monitor_1)
cv.imshow('result', screenshot)
print('FPS {}',format(1 / (time() - loop_time)))
loop_time = time()
if cv.waitKey(1) == ord('q'):
cv.destroyAllWindows()
break
print('done')