Is webcam support available in MATLAB 2009? If not, is there any other way to capture images from webcams at variable time intervals?
1 次查看(过去 30 天)
显示 更早的评论
In my project, I have 2 webcams. I want to capture images with them alternately and automatically, and then do further processing. The time elapsed between the capturing of any 2 images(1 from camera_1 and the other from camera_2) is variable (it depends on the result of processing on previous image)... So I used state alternation, and passed those variables as arguments in the alternateState function.
So, state alternation should take care of alternating between the 2 cameras, and 'persistent' will help in automation (since I want infinite loop for it). That is working properly. But now I'm not sure how to move forward.
Here is my code. Instead of the 2 'disp' functions, I need to capture an image from each camera and store them. I don't need to store the image in a new array every time the loop executes. The image from 1 camera can be stored in the same variable. I just need different variables for images from different cameras.
function alternateState(t,time1,time2)
persistent on
if isempty(on)
on = true;
end
stop(t)
if on
disp('3 seconds hav passed') % here instead of disp, I need to capture image from camera_1
t.StartDelay = time2; %%5
on = false;
else
disp('5 seconds hav passed') % here instead of disp, I need to capture image from camera_2
t.StartDelay = time1; %%3
on = true;
end
start(t)
end
If I use the snapshot function, what will the syntax be? Also, snapshot function requires MATLAB 2014a or 2014b. I'm currently using 2009 version. So is there any other method to do all this, if snapshot won't work on the 2009 version?
Please help, Thank you...
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Support Package for IP Cameras 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!