Video Object wont get accepted

조회 수: 2 (최근 30일)
Vijay Singh
Vijay Singh 2014년 5월 25일
댓글: Vijay Singh 2014년 5월 29일
I was trying the following code to accept video from webcam:
vidobj = videoinput('winvideo', 1, 'RGB24_640x480');
set(vidobj, 'FramesPerTrigger', 60);
triggerconfig(vidobj, 'manual');
start(vidobj);
trigger(vidobj);
data = getdata(vidobj, [1 Inf]);
........
which is giving me the error: No method 'getdata' with matching signature found for class 'imaq.winvideo1_1'.
Error in test2 (line 19) data = getdata(vidobj, [1 Inf]);
Any help will be appreciated, thanks

채택된 답변

David Tarkowski
David Tarkowski 2014년 5월 28일
The second argument to the getdata command should be a single number, not a vector. You set the FramesPerTrigger property to 60, so if you call getdata with only one argument, it will return 60 frames:
data = getdata(vidobj); % Will return 60 frames.
  댓글 수: 1
Vijay Singh
Vijay Singh 2014년 5월 29일
Thanks a lot, it worked!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2014년 5월 25일
Maybe try getsnapshot(), or the new webcam add-on "Webcam support package" in R2014a http://www.mathworks.com/help/matlab/import_export/installing-the-webcams-support-package.html

Community Treasure Hunt

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

Start Hunting!

Translated by