# Filter &#39;GetCapturedImage&#39; Image using OpenCV

**URL:** <https://psychtoolbox.discourse.group/t/filter-39-getcapturedimage-39-image-using-opencv/414>\
**Category:** Uncategorized\
**Created:** [September 11, 2012, 11:51am UTC](https://psychtoolbox.discourse.group/t/filter-39-getcapturedimage-39-image-using-opencv/414 "2012-09-11T11:51:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![neurokillswitch](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@neurokillswitch](https://psychtoolbox.discourse.group/u/neurokillswitch)\
**Post date:** [September 11, 2012, 11:51am UTC](https://psychtoolbox.discourse.group/t/filter-39-getcapturedimage-39-image-using-opencv/414/1 "2012-09-11T11:51:23Z")

</div>

Hi   
  
What's the easiest way to filter a frame that was just captured using Screen('GetCapturedImage, ...). I'd like to use some filters from OpenCV libraries (I uploaded them through the mex function) or even filters provided by Matlab. However, all what Screen('GetCapturedImage'...) returns is a pointer/handle, not a frame. How can I extract the frame?  
  
I know Psychtoolbox provides some obscure functions (shaders) for image processing but there is barely some documentation out there about those and they are not flexible. Manipulating the frame(s) directly would be ideal.  
  
Ex.  
  
while \<cond.\>  
...  
Frame = Screen('GetCapturedImage', ...);  
rgb2gray(Frame); (or any other filter from Matlab/OpenCV)  
Screen('DrawTexture', ...);  
...  
end  
  
  
Any ideas?  
  
Thanks,
