Using pyautogui and opencv for screenshot

Viewed 8439

I am using the following code:

import cv2

import numpy as np

import pyautogui
import sys


img = pyautogui.screenshot()
cv2.imshow('image',img)

When I run this, it tells me

mat is not a numpy array, neither a scalar

I have tried to use different functions from opencv and it seems they all return the same. What do I need to do in order to take a screenshot then work with it in Open CV?

1 Answers
Related