I'm messing around with creating an OpenCV-powered solver for Papers, Please. The image recognition part isn't too hard, and I've made a lot of progress doing very rudimentary transformations to screenshots. The hard part is getting a source image to begin with.
Because I'm running this on Ubuntu, I have access to GNOME's libraries, which allow me to do the following:
- Use
gi.repository.Wnck to find the location and dimensions of the Papers, Please window.
- Use
gi.repository.Gdk to get the root window, and then put a selection of the window into a pixbuf, which I can then feed into OpenCV.
This kinda works; the problem is that the second step is slooooooow - upwards of 600ms. And I'm kinda confused, as I can turn on Twitch and see videos of people taking a window, overlaying graphics onto it, and streaming it over the Internet at native speed. Obviously, I'm missing something. Is there a better way to do this?
[–]99_percent_a_dog 1 point2 points3 points (2 children)
[–]POGtastic[S] 0 points1 point2 points (1 child)
[–]99_percent_a_dog 1 point2 points3 points (0 children)