Hi all, I can't open my webcam in matlab

1 view (last 30 days)
This is the code i used
vid1 = videoinput('winvideo', 1, 'YUY2_320x240');
src1 = getselectedsource(vid1);
vid1.FramesPerTrigger = 1;
vid1.ReturnedColorspace = 'rgb';
start(vid1);
I = getdata(vid1);
stop(vid1);
when i run this it says 'Invalid ADAPTORNAME specified.' but i have downloaded the required adopter from Support Package Installer. in fact when i open imaqtool box in imformation tool box it shows 'dcam' as a installed adopter.
but in the hardware browser it doesn't show any cameras, when i write preview(webcam) in the command tab a window will come and close immediately.
Any ideas and comments would be greatly appreciated! Thank you, Nipun

Answers (0)

Community Treasure Hunt

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

Start Hunting!