Path: news.mathworks.com!not-for-mail
From: Dave Tarkowski <dave.tarkowski@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: *HELP* Problem with videoinput, preview statement
Date: Mon, 14 Jan 2008 09:21:11 -0500
Organization: The MathWorks, Inc.
Lines: 45
Message-ID: <fmfr4n$pf0$1@fred.mathworks.com>
References: <fme5s2$kk9$1@fred.mathworks.com>
NNTP-Posting-Host: tarkowskid.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1200320471 26080 172.31.57.200 (14 Jan 2008 14:21:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 14 Jan 2008 14:21:11 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
In-Reply-To: <fme5s2$kk9$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:445623


Talal Khan wrote:
> I use this piece of code and it works perfectly in the 
> matlab environment, however when i make an executable out 
> of it,it gives me an error saying
> ----------------------------------------------
> Function 'preview' is not defined for a first argument of 
> class 'videoinput'.
> ----------------------------------------------
> -------------
> MY CODE IS:
> ------------
> 
> vid = videoinput('winvideo');
> 
> preview(vid);
> 
> pause;
> 
> frame = getsnapshot(vid);
> 
> subplot(1,1,1);imshow(frame,'InitialMagnification','fit');
> 
> %save file
>  saveas(gca,'TTT.jpeg')
>  delete(vid);
>  
>  closepreview;
> 
> -----------------------------------------------
> MATLAB VERSION 7.0.1.24704 (R14) Service Pack 1
> ------------------------------------------------
> Image Axquisition Toolbox  1.7 
> -------------------------------------------------

Talal,

In R14 SP1, the PREVIEW command could not be compiled.  You can see the 
list of functions that will not work with the MATLAB Compiler at 
http://www.mathworks.com/products/compiler/compiler_support.html, but 
that page is only for the current version.  Please note that with the 
current version of the MATLAB compiler and the Image Acquisition 
Toolbox, the PREVIEW command can be compiled only when used with a user 
specified image handle.

-Dave Tarkowski