From: Bharat Reddy on
I am currently attempting to acquire an image from a webcam using the Image acquisition toolbox in Matlab R2009b.

My code is:


vid=videoinput('winvideo',1);
% preview(vid);
pause(10);
data=getsnapshot(vid);
imagesc(data);

The pause exists because otherwise I get a timeout error.

The problem now is that even though it displays the image, I get a mostly blue coloured image. Am I doing something wrong? When I use 'preview', it works fine, and I can see the properly coloured image.

Many Thanks!

Bharat
From: Joel on
Problem has to do with camera warm up. You ned to configure the trigger properly
triggerconfig(vid, 'manual'); start(vid);


"Bharat Reddy" <bharat411(a)gmail.com> wrote in message <hr7gf3$fad$1(a)fred.mathworks.com>...
> I am currently attempting to acquire an image from a webcam using the Image acquisition toolbox in Matlab R2009b.
>
> My code is:
>
>
> vid=videoinput('winvideo',1);
> % preview(vid);
> pause(10);
> data=getsnapshot(vid);
> imagesc(data);
>
> The pause exists because otherwise I get a timeout error.
>
> The problem now is that even though it displays the image, I get a mostly blue coloured image. Am I doing something wrong? When I use 'preview', it works fine, and I can see the properly coloured image.
>
> Many Thanks!
>
> Bharat
 | 
Pages: 1
Prev: Discriminant analysis
Next: Specgram in Simulink