Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python cv2 screen capture

import numpy as np
import cv2
from PIL import ImageGrab

while True:
    img = ImageGrab.grab(bbox=(0, 1000, 100, 1100)) #x, y, w, h
    img_np = np.array(img)
    frame = cv2.cvtColor(img_np, cv2.COLOR_BGR2GRAY)
    cv2.imshow("frame", frame)
    if cv2.waitKey(1) & 0Xff == ord('q'):
        break
    
cv2.destroyAllWindows()
Comment

PREVIOUS NEXT
Code Example
Python :: fill missing values with 0 pandas 
Python :: python how to set the axis ranges in seaborn 
Python :: each line in a text file into a list in Python 
Python :: import sklearn linear regression 
Python :: geopandas set crs 
Python :: stripping /n in a readlines for a pytgon file 
Python :: check if string url python 
Python :: how to plot count on column of dataframe 
Python :: how to override save method in django 
Python :: exception get line number python 
Python :: STandardScaler use example 
Python :: pylint no name in module cv2 
Python :: virtual environment mac 
Python :: django today date in template 
Python :: pandas.core.indexes.base.index to list 
Python :: df.drop index 
Python :: save image requests python 
Python :: f string round 
Python :: selenium exception handling python 
Python :: How to Add a Title to Seaborn Plots 
Python :: python what does yield do 
Python :: django admin prefetch_related 
Python :: string with comma to int python 
Python :: matplotlib show imaginary numbers 
Python :: rename multiple pandas columns with list 
Python :: import NoSuchKey in boto3 
Python :: python pip install from script 
Python :: reload all extensions discord.py 
Python :: how to do pandas profiling 
Python :: how to convert month to number in python 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =