3 ms·
Here's a faster way to get a frame using PyGTK: https://www.pastery.net/xafjmn/ https://www.pastery.net/xafjmn/ Takes around 5ms per frame for me, rather than
by StavrosK 10y ago
Here's a faster way to get a frame using PyGTK:
https://www.pastery.net/xafjmn/ https://www.pastery.net/xafjmn/
Takes around 5ms per frame for me, rather than 50.
Slightly shorter code (still using the same method): https://askubuntu.com/a/400384/73044 https://askubuntu.com/a/400384/73044
- sentdex 10y agoThanks for sharing this, will definitely look into it. With the ever improving FPS, this AI's reflexes are going to be insane.
- StavrosK 10y agoNo problem, glad to have helped!
- gejose 10y agoIs there a cross platform way to do this? I'd like to be able to do this on a Mac, but would prefer not to have to set up GTK (if it even works).
- nbrochu 10y agoThank you so much for sharing this! I'm working on something similar right now (a framework to build game agents using computer vision tools) and I just went from capturing at 10-15fps with ImageGrabber, to 15-25fps with FFMpeg and finally 70-80 fps with this technique. Insane!
- StavrosK 10y agoYou're quite welcome! I used it to capture a single pixel for my Super Hexagon LED strip (https://www.stavros.io/posts/wifi-enabled-rgb-led-strip-controller/ https://www.stavros.io/posts/wifi-enabled-rgb-led-strip-cont...) and it works really well.