<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975</link>
    <title>MATLAB Central Newsreader - *HELP* Problem with videoinput, preview statement</title>
    <description>Feed for thread: *HELP* Problem with videoinput, preview statement</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 15 Jan 2008 23:19:02 -0500</pubDate>
      <title>Re: *HELP* Problem with videoinput, preview statement</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975#409548</link>
      <author>Talal Khan</author>
      <description>hey guys iv resolved the problem... the problem wasnt in &lt;br&gt;
the getsnapshot, it was in the 'pause' i  used... thanx &lt;br&gt;
for everything u guys helped allot....:)&lt;br&gt;
&lt;br&gt;
"Talal Khan" &amp;lt;talaltk@mathwork.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fmj7ku$ilf$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; ok i downloaded the latest version of matlab including &lt;br&gt;
the &lt;br&gt;
&amp;gt; toolbox etc. good news and bad news&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; good news is i managed to get PREVIEW working when i &lt;br&gt;
make &lt;br&gt;
&amp;gt; an executable by a user defined image handle&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The Bad news is i can not get the GETSNAPSHOT to work &lt;br&gt;
&amp;gt; outside matlab enivironment...i.e when i make an &lt;br&gt;
&amp;gt; executable...any solution to that??&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Dave Tarkowski &amp;lt;dave.tarkowski@mathworks.com&amp;gt; wrote in &lt;br&gt;
&amp;gt; message &amp;lt;fmi7rc$4pe$2@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Talal Khan wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; dpb &amp;lt;none@non.net&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;lt;fmh5nf$q8k$2@aioe.org&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; Talal Khan wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; OK thanx. so basically your saying i have to &lt;br&gt;
update &lt;br&gt;
&amp;gt; my &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; matlab version along with the image acquisition &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; toolbox, &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; other wise the PREVIEW wont work. ill try doing &lt;br&gt;
&amp;gt; that. &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; although i think ill have to pay inorder to get &lt;br&gt;
the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; latest &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; version. can i not just update it for free or &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; something.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; You can't do much of anything other than patches of &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; current version "for &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; free or something" from TMW... :)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; --&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; nice...ill get the new matlab from somewhere as long &lt;br&gt;
&amp;gt; as &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; the PREVIEW works on that...btw can u give me some &lt;br&gt;
&amp;gt; advice &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; how i should modify my code so that it works when i &lt;br&gt;
&amp;gt; make &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; it into an executable. ...you already told me that i &lt;br&gt;
&amp;gt; have &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; to use a user defined image handle....then it will &lt;br&gt;
&amp;gt; work &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; when its a .exe file.... as in show me the code for &lt;br&gt;
it&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Talal Khan&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Talal,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The help for PREVIEW in the newer versions of MATLAB &lt;br&gt;
has &lt;br&gt;
&amp;gt; an example of &lt;br&gt;
&amp;gt; &amp;gt; using an image handle.  The code is basically this:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; % Create an image object of the same size as your &lt;br&gt;
video.&lt;br&gt;
&amp;gt; &amp;gt; hImage = image(zeros(480,640,3));&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; % Start the preview.&lt;br&gt;
&amp;gt; &amp;gt; preview(vid, hImage);&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; You should also see the reply by Vihang for a utility &lt;br&gt;
on &lt;br&gt;
&amp;gt; MATLAB Central &lt;br&gt;
&amp;gt; &amp;gt; that will allow you to achieve similar functionality &lt;br&gt;
in &lt;br&gt;
&amp;gt; the version of &lt;br&gt;
&amp;gt; &amp;gt; MATLAB that you are using.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; -Dave&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 15 Jan 2008 21:13:02 -0500</pubDate>
      <title>Re: *HELP* Problem with videoinput, preview statement</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975#409528</link>
      <author>Talal Khan</author>
      <description>ok i downloaded the latest version of matlab including the &lt;br&gt;
toolbox etc. good news and bad news&lt;br&gt;
&lt;br&gt;
good news is i managed to get PREVIEW working when i make &lt;br&gt;
an executable by a user defined image handle&lt;br&gt;
&lt;br&gt;
The Bad news is i can not get the GETSNAPSHOT to work &lt;br&gt;
outside matlab enivironment...i.e when i make an &lt;br&gt;
executable...any solution to that??&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Dave Tarkowski &amp;lt;dave.tarkowski@mathworks.com&amp;gt; wrote in &lt;br&gt;
message &amp;lt;fmi7rc$4pe$2@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Talal Khan wrote:&lt;br&gt;
&amp;gt; &amp;gt; dpb &amp;lt;none@non.net&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fmh5nf$q8k$2@aioe.org&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Talal Khan wrote:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; OK thanx. so basically your saying i have to update &lt;br&gt;
my &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; matlab version along with the image acquisition &lt;br&gt;
&amp;gt; &amp;gt; toolbox, &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; other wise the PREVIEW wont work. ill try doing &lt;br&gt;
that. &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; although i think ill have to pay inorder to get the &lt;br&gt;
&amp;gt; &amp;gt; latest &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; version. can i not just update it for free or &lt;br&gt;
&amp;gt; &amp;gt; something.&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; You can't do much of anything other than patches of &lt;br&gt;
&amp;gt; &amp;gt; current version "for &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; free or something" from TMW... :)&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; --&lt;br&gt;
&amp;gt; &amp;gt; nice...ill get the new matlab from somewhere as long &lt;br&gt;
as &lt;br&gt;
&amp;gt; &amp;gt; the PREVIEW works on that...btw can u give me some &lt;br&gt;
advice &lt;br&gt;
&amp;gt; &amp;gt; how i should modify my code so that it works when i &lt;br&gt;
make &lt;br&gt;
&amp;gt; &amp;gt; it into an executable. ...you already told me that i &lt;br&gt;
have &lt;br&gt;
&amp;gt; &amp;gt; to use a user defined image handle....then it will &lt;br&gt;
work &lt;br&gt;
&amp;gt; &amp;gt; when its a .exe file.... as in show me the code for it&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Talal Khan&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Talal,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The help for PREVIEW in the newer versions of MATLAB has &lt;br&gt;
an example of &lt;br&gt;
&amp;gt; using an image handle.  The code is basically this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; % Create an image object of the same size as your video.&lt;br&gt;
&amp;gt; hImage = image(zeros(480,640,3));&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; % Start the preview.&lt;br&gt;
&amp;gt; preview(vid, hImage);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You should also see the reply by Vihang for a utility on &lt;br&gt;
MATLAB Central &lt;br&gt;
&amp;gt; that will allow you to achieve similar functionality in &lt;br&gt;
the version of &lt;br&gt;
&amp;gt; MATLAB that you are using.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -Dave&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 15 Jan 2008 12:10:20 -0500</pubDate>
      <title>Re: *HELP* Problem with videoinput, preview statement</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975#409454</link>
      <author>Dave Tarkowski</author>
      <description>Talal Khan wrote:&lt;br&gt;
&amp;gt; dpb &amp;lt;none@non.net&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;fmh5nf$q8k$2@aioe.org&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; Talal Khan wrote:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; OK thanx. so basically your saying i have to update my &lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; matlab version along with the image acquisition &lt;br&gt;
&amp;gt; toolbox, &lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; other wise the PREVIEW wont work. ill try doing that. &lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; although i think ill have to pay inorder to get the &lt;br&gt;
&amp;gt; latest &lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; version. can i not just update it for free or &lt;br&gt;
&amp;gt; something.&lt;br&gt;
&amp;gt;&amp;gt; ...&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; You can't do much of anything other than patches of &lt;br&gt;
&amp;gt; current version "for &lt;br&gt;
&amp;gt;&amp;gt; free or something" from TMW... :)&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; --&lt;br&gt;
&amp;gt; nice...ill get the new matlab from somewhere as long as &lt;br&gt;
&amp;gt; the PREVIEW works on that...btw can u give me some advice &lt;br&gt;
&amp;gt; how i should modify my code so that it works when i make &lt;br&gt;
&amp;gt; it into an executable. ...you already told me that i have &lt;br&gt;
&amp;gt; to use a user defined image handle....then it will work &lt;br&gt;
&amp;gt; when its a .exe file.... as in show me the code for it&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Talal Khan&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Talal,&lt;br&gt;
&lt;br&gt;
The help for PREVIEW in the newer versions of MATLAB has an example of &lt;br&gt;
using an image handle.  The code is basically this:&lt;br&gt;
&lt;br&gt;
% Create an image object of the same size as your video.&lt;br&gt;
hImage = image(zeros(480,640,3));&lt;br&gt;
&lt;br&gt;
% Start the preview.&lt;br&gt;
preview(vid, hImage);&lt;br&gt;
&lt;br&gt;
You should also see the reply by Vihang for a utility on MATLAB Central &lt;br&gt;
that will allow you to achieve similar functionality in the version of &lt;br&gt;
MATLAB that you are using.&lt;br&gt;
&lt;br&gt;
-Dave&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 15 Jan 2008 12:08:19 -0500</pubDate>
      <title>Re: *HELP* Problem with videoinput, preview statement</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975#409453</link>
      <author>Dave Tarkowski</author>
      <description>Vihang Patil wrote:&lt;br&gt;
&amp;gt; Hello&lt;br&gt;
&amp;gt; You can try this utility posted in the File Exchange. This&lt;br&gt;
&amp;gt; is better than the preview function and can be compiled&lt;br&gt;
&amp;gt; &lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=5438&amp;objectType=file"&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=5438&amp;objectType=file&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; HTH&lt;br&gt;
&amp;gt; Vihang&lt;br&gt;
&lt;br&gt;
Vihang,&lt;br&gt;
&lt;br&gt;
Thank you, I forgot about that utility.  Yes, that utility will allow &lt;br&gt;
you to achieve something similar to the functionality of the PREVIEW &lt;br&gt;
command and will work with the MATLAB Compiler.  It lacks some of the &lt;br&gt;
capabilities in the currently shipping version of PREVIEW, but it is an &lt;br&gt;
option in this case.&lt;br&gt;
&lt;br&gt;
-Dave Tarkowski&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 15 Jan 2008 05:30:20 -0500</pubDate>
      <title>Re: *HELP* Problem with videoinput, preview statement</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975#409418</link>
      <author>Vihang Patil</author>
      <description>Hello&lt;br&gt;
You can try this utility posted in the File Exchange. This&lt;br&gt;
is better than the preview function and can be compiled&lt;br&gt;
&lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=5438&amp;objectType=file"&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=5438&amp;objectType=file&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
HTH&lt;br&gt;
Vihang&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 15 Jan 2008 03:07:01 -0500</pubDate>
      <title>Re: *HELP* Problem with videoinput, preview statement</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975#409408</link>
      <author>Talal Khan</author>
      <description>dpb &amp;lt;none@non.net&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fmh5nf$q8k$2@aioe.org&amp;gt;...&lt;br&gt;
&amp;gt; Talal Khan wrote:&lt;br&gt;
&amp;gt; &amp;gt; OK thanx. so basically your saying i have to update my &lt;br&gt;
&amp;gt; &amp;gt; matlab version along with the image acquisition &lt;br&gt;
toolbox, &lt;br&gt;
&amp;gt; &amp;gt; other wise the PREVIEW wont work. ill try doing that. &lt;br&gt;
&amp;gt; &amp;gt; although i think ill have to pay inorder to get the &lt;br&gt;
latest &lt;br&gt;
&amp;gt; &amp;gt; version. can i not just update it for free or &lt;br&gt;
something.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; ...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You can't do much of anything other than patches of &lt;br&gt;
current version "for &lt;br&gt;
&amp;gt; free or something" from TMW... :)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; --&lt;br&gt;
nice...ill get the new matlab from somewhere as long as &lt;br&gt;
the PREVIEW works on that...btw can u give me some advice &lt;br&gt;
how i should modify my code so that it works when i make &lt;br&gt;
it into an executable. ...you already told me that i have &lt;br&gt;
to use a user defined image handle....then it will work &lt;br&gt;
when its a .exe file.... as in show me the code for it&lt;br&gt;
&lt;br&gt;
Talal Khan&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 15 Jan 2008 02:23:42 -0500</pubDate>
      <title>Re: *HELP* Problem with videoinput, preview statement</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975#409401</link>
      <author>dpb</author>
      <description>Talal Khan wrote:&lt;br&gt;
&amp;gt; OK thanx. so basically your saying i have to update my &lt;br&gt;
&amp;gt; matlab version along with the image acquisition toolbox, &lt;br&gt;
&amp;gt; other wise the PREVIEW wont work. ill try doing that. &lt;br&gt;
&amp;gt; although i think ill have to pay inorder to get the latest &lt;br&gt;
&amp;gt; version. can i not just update it for free or something.&lt;br&gt;
&amp;gt; &lt;br&gt;
...&lt;br&gt;
&lt;br&gt;
You can't do much of anything other than patches of current version "for &lt;br&gt;
free or something" from TMW... :)&lt;br&gt;
&lt;br&gt;
--&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 15 Jan 2008 01:34:02 -0500</pubDate>
      <title>Re: *HELP* Problem with videoinput, preview statement</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975#409393</link>
      <author>Talal Khan</author>
      <description>OK thanx. so basically your saying i have to update my &lt;br&gt;
matlab version along with the image acquisition toolbox, &lt;br&gt;
other wise the PREVIEW wont work. ill try doing that. &lt;br&gt;
although i think ill have to pay inorder to get the latest &lt;br&gt;
version. can i not just update it for free or something.&lt;br&gt;
&lt;br&gt;
"Talal Khan" &amp;lt;talaltk@mathwork.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fme5s2$kk9$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I use this piece of code and it works perfectly in the &lt;br&gt;
&amp;gt; matlab environment, however when i make an executable &lt;br&gt;
out &lt;br&gt;
&amp;gt; of it,it gives me an error saying&lt;br&gt;
&amp;gt; ----------------------------------------------&lt;br&gt;
&amp;gt; Function 'preview' is not defined for a first argument &lt;br&gt;
of &lt;br&gt;
&amp;gt; class 'videoinput'.&lt;br&gt;
&amp;gt; ----------------------------------------------&lt;br&gt;
&amp;gt; -------------&lt;br&gt;
&amp;gt; MY CODE IS:&lt;br&gt;
&amp;gt; ------------&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; vid = videoinput('winvideo');&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; preview(vid);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; pause;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; frame = getsnapshot(vid);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; subplot(1,1,1);imshow&lt;br&gt;
(frame,'InitialMagnification','fit');&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; %save file&lt;br&gt;
&amp;gt;  saveas(gca,'TTT.jpeg')&lt;br&gt;
&amp;gt;  delete(vid);&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;  closepreview;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -----------------------------------------------&lt;br&gt;
&amp;gt; MATLAB VERSION 7.0.1.24704 (R14) Service Pack 1&lt;br&gt;
&amp;gt; ------------------------------------------------&lt;br&gt;
&amp;gt; Image Axquisition Toolbox  1.7 &lt;br&gt;
&amp;gt; -------------------------------------------------&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 14 Jan 2008 14:21:11 -0500</pubDate>
      <title>Re: *HELP* Problem with videoinput, preview statement</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975#409295</link>
      <author>Dave Tarkowski</author>
      <description>Talal Khan wrote:&lt;br&gt;
&amp;gt; I use this piece of code and it works perfectly in the &lt;br&gt;
&amp;gt; matlab environment, however when i make an executable out &lt;br&gt;
&amp;gt; of it,it gives me an error saying&lt;br&gt;
&amp;gt; ----------------------------------------------&lt;br&gt;
&amp;gt; Function 'preview' is not defined for a first argument of &lt;br&gt;
&amp;gt; class 'videoinput'.&lt;br&gt;
&amp;gt; ----------------------------------------------&lt;br&gt;
&amp;gt; -------------&lt;br&gt;
&amp;gt; MY CODE IS:&lt;br&gt;
&amp;gt; ------------&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; vid = videoinput('winvideo');&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; preview(vid);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; pause;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; frame = getsnapshot(vid);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; subplot(1,1,1);imshow(frame,'InitialMagnification','fit');&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; %save file&lt;br&gt;
&amp;gt;  saveas(gca,'TTT.jpeg')&lt;br&gt;
&amp;gt;  delete(vid);&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;  closepreview;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -----------------------------------------------&lt;br&gt;
&amp;gt; MATLAB VERSION 7.0.1.24704 (R14) Service Pack 1&lt;br&gt;
&amp;gt; ------------------------------------------------&lt;br&gt;
&amp;gt; Image Axquisition Toolbox  1.7 &lt;br&gt;
&amp;gt; -------------------------------------------------&lt;br&gt;
&lt;br&gt;
Talal,&lt;br&gt;
&lt;br&gt;
In R14 SP1, the PREVIEW command could not be compiled.  You can see the &lt;br&gt;
list of functions that will not work with the MATLAB Compiler at &lt;br&gt;
&lt;a href="http://www.mathworks.com/products/compiler/compiler_support.html,"&gt;http://www.mathworks.com/products/compiler/compiler_support.html,&lt;/a&gt; but &lt;br&gt;
that page is only for the current version.  Please note that with the &lt;br&gt;
current version of the MATLAB compiler and the Image Acquisition &lt;br&gt;
Toolbox, the PREVIEW command can be compiled only when used with a user &lt;br&gt;
specified image handle.&lt;br&gt;
&lt;br&gt;
-Dave Tarkowski&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 13 Jan 2008 23:12:02 -0500</pubDate>
      <title>*HELP* Problem with videoinput, preview statement</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161975#409231</link>
      <author>Talal Khan</author>
      <description>I use this piece of code and it works perfectly in the &lt;br&gt;
matlab environment, however when i make an executable out &lt;br&gt;
of it,it gives me an error saying&lt;br&gt;
----------------------------------------------&lt;br&gt;
Function 'preview' is not defined for a first argument of &lt;br&gt;
class 'videoinput'.&lt;br&gt;
----------------------------------------------&lt;br&gt;
-------------&lt;br&gt;
MY CODE IS:&lt;br&gt;
------------&lt;br&gt;
&lt;br&gt;
vid = videoinput('winvideo');&lt;br&gt;
&lt;br&gt;
preview(vid);&lt;br&gt;
&lt;br&gt;
pause;&lt;br&gt;
&lt;br&gt;
frame = getsnapshot(vid);&lt;br&gt;
&lt;br&gt;
subplot(1,1,1);imshow(frame,'InitialMagnification','fit');&lt;br&gt;
&lt;br&gt;
%save file&lt;br&gt;
&amp;nbsp;saveas(gca,'TTT.jpeg')&lt;br&gt;
&amp;nbsp;delete(vid);&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;nbsp;closepreview;&lt;br&gt;
&lt;br&gt;
-----------------------------------------------&lt;br&gt;
MATLAB VERSION 7.0.1.24704 (R14) Service Pack 1&lt;br&gt;
------------------------------------------------&lt;br&gt;
Image Axquisition Toolbox  1.7 &lt;br&gt;
-------------------------------------------------&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
