B
B
Bla Bla2022-04-10 10:22:21
OpenCV
Bla Bla, 2022-04-10 10:22:21

How to FAST set screen array for opencv (selenium)?

There is a game in which, if you want to play, you need to look at the whole screen (the whole screen is canvas). How can I pass this canvas to opencv FAST (0.1 sec)? Now I stupidly take screenshots with selenium(drive.save_screenshot("foo.png")), but this method is too slow (0.3-0.5 sec).

Is there a way to save screenshots faster or another way to give opencv access to the screen or something.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2022-04-10
@rPman

so quickly it definitely won’t work
between the browser screen and the python abyss of buffers and interlayers
, and most importantly there png compression occurs, you won’t be able to do it quickly (and you’ll still be compressing it back)
Try instead of using selenium to work with the screen using the remote desktop api , but how exactly this will work with a headless browser, you need to test it, the main thing is that this api implies high responsiveness and fast transfer of screen content, but you will need to study how this screen accepts
ps the browser has its own webgl and webcl was once released (but browser support is now in question) , i.e. Can you try to work with graphics directly in the browser?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question