Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python capture desktop as video source

import numpy as np
import cv2
from mss import mss
from PIL import Image

bounding_box = {'top': 100, 'left': 0, 'width': 400, 'height': 300}

sct = mss()

while True:
    sct_img = sct.grab(bounding_box)
    cv2.imshow('screen', np.array(sct_img))

    if (cv2.waitKey(1) & 0xFF) == ord('q'):
        cv2.destroyAllWindows()
        break
Comment

PREVIOUS NEXT
Code Example
Python :: two sum python 
Python :: sqlalchemy create engine Microsoft SQL 
Python :: selenium webdriver manager python 
Python :: set the context data in django listview 
Python :: python compute SSIM 
Python :: named tuple python iterate 
Python :: start virtual environment python 
Python :: get sum of a range from user input 
Python :: how to update python 
Python :: python how to check if first character in string is number 
Python :: Python Removing Directory or File 
Python :: axes color python 
Python :: pd df drop columns 
Python :: how to delete json object using python? 
Python :: python turtle commands 
Python :: python datetime module 
Python :: python sorted word frequency count 
Python :: python try except raise error 
Python :: write list to file python 
Python :: how to get username with userid discord.py 
Python :: run multiple function with multiprocessing python 
Python :: loop through python object 
Python :: sqlite query in python 
Python :: python requests response get text 
Python :: python get average of list 
Python :: python left rotation 
Python :: read files and write into another files python 
Python :: how to calculate sum of a list in python 
Python :: python count bits 
Python :: replace string if it contains a substring pandas 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =