How to snapshot the image using imaq.VideoDevice?

Can I ask some question? I would like to know how to snapshot the image. I cannot use function getsnapshot with imaq.VideoDevice. Thank u.
Error is show that "Too many output argument" How to fixed it?
Thank you :)

4 Comments

Ara - what is the line (or lines) of code that you are using to get a snapshot of the image? The error too many output arguments implies that the code is expecting more outputs than what the function provides.
From getsnapshot, there are two output "signatures"
frame = getsnapshot(obj)
[frame, metadata] = getsnapshot(obj)
Is your code similar, or is it expecting more outputs?
Ara
Ara on 22 Jul 2014
Edited: Ara on 22 Jul 2014
It's about like this
Thank you very much :)
vidDevice = imaq.VideoDevice('winvideo', 1, 'YUY2_640x480');
imag=getsnapshot(vidDevice);
imwrite(imag,'camera.jpg');
pre=imread('camera.jpg');
imshow(pre);
And the error occurs at which line?
Have you checked out imaq.videodevice? In the example, the code uses
frame = step(vidobj);
to acquire a single frame. What happens when you try to use this function?
Thank you, I got it :)

Sign in to comment.

Answers (0)

Asked:

Ara
on 21 Jul 2014

Commented:

Ara
on 22 Jul 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!