#1
|
|||
|
|||
Grabbing screen shots (but not to file)
I would like to be able to capture the current screen to a python object of some sort (list, string, I don't really care). Is this possilbe in Vizard, or can I only dump to .BMP files?
I can install PIL then open and read in the BMP file, but reading the file it not optimal as it may begin before the file writing ends (plus it involves using another third-party software along with Vizard). It would be much nicer if it could be done within Vizard. --------- If this is not possible, any suggestions on how to quickly get the screen buffer would be appreciated. Last edited by pbeeson; 08-29-2006 at 04:11 PM. |
#2
|
|||
|
|||
There is no command that will return the raw data of the screen capture. Capturing to a file and reading the file is probably the easiest solution. Do you need this for real-time use?
When you issue the viz.screencapture command the file is not created immediately. It is created at the end of the next frame. So when you issue the command wait until the next frame before reading the file. |
#3
|
|||
|
|||
It would be nice to get this in real-time. I thought it might be possible to install pyopengl and grab the screen buffer, but I'm not sure exactly how to tell the python OpenGl code which OpenGL buffer it should care about. Does Vizard store the ID of the OpenGl window it opens?
This is mostly just for displaying the Vizard display on a linux machine that is running software that interacts with Vizard via an xmlrpc server I set up (using Vizard as a robot simulation environment). I'm thinking the easiest thing might just be to run a vncserver in Windows and view the Windows desktop in Linuz through a vnc-client, but it would have been nice to send the Vizard screen buffer (as a string) through the xmlrpc interface. ---------- Any more suggestions are welcome. BTW, I'm new to Vizard, so where can I report bugs? |
#4
|
|||
|
|||
You want to stream the frame buffer uncompressed at 60 hz? What window size are you running in?
Quote:
A plugin could be made to capture the screen contents of the graphics window and return it as a string in python. If you are using Vizard 3.0 then I could create this plugin for you. Quote:
|
#5
|
|||
|
|||
Quote:
Quote:
Unfortunately, I'm running Vizard 2.53g. Is that a deal breaker? Regardless, I'll contact support to beta test v3.0, but I'll have to ask my employer about his plans to upgrade our Vizard purchase an upgrade to v3 when it comes out. Let me know. Last edited by pbeeson; 08-30-2006 at 08:55 AM. |
#6
|
|||
|
|||
Quote:
|
#7
|
|||
|
|||
I just finished implementing the plugin for 3.0. Here are some notes about the plugin:
- It grabs the screen buffer directly from windows, not OpenGL. The benefit is that it can capture a little faster and it can run in a separate thread. - The image is in raw BGR format. - The image is inverted vertically because in Windows the origin of an image is the top left corner. I've attached a zip file which contains the plugin and an example file. Again, this will only work with Vizard 3.0 |
#8
|
|||
|
|||
Thanks a million. Although I definately plan to beta test v3.0, would it be selfish for me to request a plugin for 2.5 as well ?
I'm assuming of course that it is similar is strucutre, so that I won't steal too much of your time. But, we are trying to get a pilot experiment up and running in a VERY short period, so keeping with Vizard 2.5 for the next few weeks might be the best bet. Again, thanks. And if this is asking too much, please let me know, and I'll make due. Last edited by pbeeson; 08-30-2006 at 04:32 PM. |
#9
|
|||
|
|||
Here is a version of the plugin that should work with Vizard 2.53g. Let me know if it doesn't suite your needs.
|
#10
|
|||
|
|||
This is perfect. Works great. Thanks for all your help.
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|