Docs @ Psychtoolbox Wiki : GetImage

Search PTB Function help:
homepsychtoolbox.orgpage updateslogin

Revision [14408]

Last edited on 2012-02-13 11:00:34 by DocBot
Additions:
returning a uint8 array.
Calling this function on an onscreen window while an asynchronous flip is
pending on the window due to [[Screen]]('AsyncFlipBegin') is not allowed! Finalize
such flips first. Readback of other onscreen or offscreen windows or textures is
possible during async flip, but discouraged because it will have a significant
impact on performance.
The returned imageArray by default has three layers, i.e. it's an RGB image.
"windowPtr" is the handle of the onscreen window, offscreen window or texture
whose image should be returned. "rect" is the rectangular subregion to copy, and
its default is the whole window. Matlab/Octave will complain if you try to do
math on a uint8 array, so you may need to use DOUBLE to convert it, e.g.
imageArray/255 will produce an error, but double(imageArray)/255 is ok. Also see
[[Screen]] 'PutImage' and 'CopyWindow'. "bufferName" is a string specifying the
buffer from which to copy the image: The 'bufferName' argument is meaningless
for offscreen windows and textures and will be silently ignored. For onscreen
windows, it defaults to 'frontBuffer', i.e., it returns the image that your
subject would see at that moment. If frame-sequential stereo mode is enabled,
'frontLeftBuffer' returns what your subject would see in its left eye,
'frontRightBuffer' returns the subjects right-eye view. If double-buffering is
enabled, you can also return the 'backBuffer', i.e. what your subject will see
after the next [[Screen]]('[[Flip]]') command, and for frame-sequential stereo also
'backLeftBuffer' and 'backRightBuffer' respectively. 'aux0Buffer' - 'aux3Buffer'
returns the content of OpenGL AUX buffers 0 to 3. Only query the AUX buffers if
you know what you are doing, otherwise your script will crash. This is mostly
meant for internal debugging of PTB. If the imaging pipeline is enabled you can
also return the content of the unprocessed backbuffer, ie. before processing by
the pipeline, by requesting 'drawBuffer'.
Deletions:
returning a uint8 array. The returned imageArray by default has three layers,
i.e. it's an RGB image. "windowPtr" is the handle of the onscreen window,
offscreen window or texture whose image should be returned. "rect" is the
rectangular subregion to copy, and its default is the whole window.
Matlab/Octave will complain if you try to do math on a uint8 array, so you may
need to use DOUBLE to convert it, e.g. imageArray/255 will produce an error, but
double(imageArray)/255 is ok. Also see [[Screen]] 'PutImage' and 'CopyWindow'.
"bufferName" is a string specifying the buffer from which to copy the image: The
'bufferName' argument is meaningless for offscreen windows and textures and will
be silently ignored. For onscreen windows, it defaults to 'frontBuffer', i.e.,
it returns the image that your subject would see at that moment. If
frame-sequential stereo mode is enabled, 'frontLeftBuffer' returns what your
subject would see in its left eye, 'frontRightBuffer' returns the subjects
right-eye view. If double-buffering is enabled, you can also return the
'backBuffer', i.e. what your subject will see after the next [[Screen]]('[[Flip]]')
command, and for frame-sequential stereo also 'backLeftBuffer' and
'backRightBuffer' respectively. 'aux0Buffer' - 'aux3Buffer' returns the content
of OpenGL AUX buffers 0 to 3. Only query the AUX buffers if you know what you
are doing, otherwise your script will crash. This is mostly meant for internal
debugging of PTB. If the imaging pipeline is enabled you can also return the
content of the unprocessed backbuffer, ie. before processing by the pipeline, by
requesting 'drawBuffer'.


Revision [14227]

Edited on 2011-07-29 12:16:52 by DocBot
Additions:
""<div class="subfct" id="PsychKinectCore">""===[[GetImage PsychKinectCore('GetImage')]]===
==[[Psychtoolbox]] › [[PsychKinectCore]].{mex*,dll} subfunction==
%%(matlab;Usage)[imageOrPtr, width, height, channels, extType, extFormat] = PsychKinect('GetImage', kinectPtr [, imtype=0][, returnTexturePtr=0]);%%
Return the color image data for the frame fetched via 'GrabFrame'.
If 'returnTexturePtr' is zero (default), a uint8 3D image matrix is returned,
which could be directly fed to image processing toolbox, imwrite() or
[[Screen]]('MakeTexture').
'imtype' if set to 1 returns a color-coded depth image instead of the RGB camera
image.
If 'returnTexturePtr' is one, a double-encoded memory pointer to a RGBA8
rectangle texture buffer is returned, for use with
[[Screen]]('SetOpenGLTextureFromMemPointer') for injection into PTB's texturing
system.
""</div>""


Revision [10014]

Edited on 2010-09-06 12:32:54 by DocBot
Additions:
Slowly copy an image from a window or texture to Matlab/Octave, by default
returning a uint8 array. The returned imageArray by default has three layers,
i.e. it's an RGB image. "windowPtr" is the handle of the onscreen window,
offscreen window or texture whose image should be returned. "rect" is the
rectangular subregion to copy, and its default is the whole window.
Matlab/Octave will complain if you try to do math on a uint8 array, so you may
'bufferName' argument is meaningless for offscreen windows and textures and will
be silently ignored. For onscreen windows, it defaults to 'frontBuffer', i.e.,
are doing, otherwise your script will crash. This is mostly meant for internal
"nrchannels" Number of color channels to return. By default, 3 channels (RGB)
PutImage CopyWindow CreateMovie FinalizeMovie<<""</div>""
Deletions:
If this function is called as 'GetImage' then it does the following:
Slowly copy an image from a window or texture to Matlab, by default returning a
Matlab uint8 array. The returned imageArray by default has three layers, i.e.
it's an RGB image. "rect" is in window coordinates, and its default is the whole
window. Matlab will complain if you try to do math on a uint8 array, so you may
'bufferName' argument is meaningless for Offscreen windows and textures and will
be silently ignored. For Onscreen windows, it defaults to 'frontBuffer', i.e.,
are doing, otherwise your script will crash, this is mostly meant for internal
"nrchannels" Number of color channels to return. by default, 3 channels (RGB)
If this function is called as 'AddFrameToMovie' instead then it does the
following:
It doesn't return the image data to Matlab or Octave, but instead adds it as a
new video frame to the movie with handle 'moviePtr'. The frameduration is set to
'frameduration' movie frame intervals. Movie images are always stored as uint8
images, never as floating point precision images. They are always stored with
four channels, that is as RGBA frames. The function will only accept the
top-left corner of the 'rect' argument, but ignore the width and height of the
'rect', because the size is always defined by the size of movie frames as set in
the 'CreateMovie' function call.
See [[Screen]]('CreateMovie?') for help on movie creation.
PutImage CreateMovie<<""</div>""


Revision [9834]

Edited on 2010-05-27 07:16:33 by DocBot
Additions:
If this function is called as 'GetImage' then it does the following:
If this function is called as 'AddFrameToMovie' instead then it does the
following:
It doesn't return the image data to Matlab or Octave, but instead adds it as a
new video frame to the movie with handle 'moviePtr'. The frameduration is set to
'frameduration' movie frame intervals. Movie images are always stored as uint8
images, never as floating point precision images. They are always stored with
four channels, that is as RGBA frames. The function will only accept the
top-left corner of the 'rect' argument, but ignore the width and height of the
'rect', because the size is always defined by the size of movie frames as set in
the 'CreateMovie' function call.
See [[Screen]]('CreateMovie?') for help on movie creation.
PutImage CreateMovie<<""</div>""
Deletions:
PutImage<<""</div>""


Revision [9170]

Edited on 2008-11-05 06:08:39 by DocBot
Additions:
""<div class="subfct" id="Screen">""===[[GetImage Screen('GetImage')]]===
Deletions:
""<div class="subfct" id="Screen" style="background-color:#eee; padding:1em; border-width:1px; border-style:solid; border-color:#ddd; margin-bottom: 2em;border-top: 5px solid #999999;">""===[[GetImage Screen('GetImage')]]===


Revision [7054]

Edited on 2008-07-10 16:11:37 by DocBot
Additions:
""<div class="subfct" id="Screen" style="background-color:#eee; padding:1em; border-width:1px; border-style:solid; border-color:#ddd; margin-bottom: 2em;border-top: 5px solid #999999;">""===[[GetImage Screen('GetImage')]]===
PutImage<<""</div>""
Deletions:
===[[GetImage Screen('GetImage')]]===
PutImage<<


Revision [4995]

Edited on 2008-04-26 21:26:25 by DocBot
Additions:
===[[GetImage Screen('GetImage')]]===
==[[Psychtoolbox]] › [[Screen]].{mex*,dll} subfunction==
%%(matlab;Usage)imageArray=Screen('GetImage', windowPtr [,rect] [,bufferName] [,floatprecision=0] [,nrchannels=3])%%
double(imageArray)/255 is ok. Also see [[Screen]] 'PutImage' and 'CopyWindow'.
'backBuffer', i.e. what your subject will see after the next [[Screen]]('[[Flip]]')
requesting 'drawBuffer'.
Luminance+Alpha, 3 for RGB and 4 for RGBA.
<<=====See also:=====
PutImage<<
Deletions:
===[[GetImage]]===
==ScreenFunctions==
Usage:
imageArray=Screen('GetImage', windowPtr [,rect] [,bufferName] [,floatprecision=0] [,nrchannels=3])
double(imageArray)/255 is ok. Also see Screen 'PutImage' and 'CopyWindow'.
'backBuffer', i.e. what your subject will see after the next Screen('Flip')
requesting 'drawBuffer'.
Luminance+Alpha, 3 for RGB and 4 for RGBA.
ScreenFunctions


Revision [2522]

The oldest known version of this page was created on 2008-03-15 23:19:03 by DocBot
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0289 seconds