Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]()
我想知道如何使用网络摄像头在MATLAB中录制视频。
回答: 注意: 由于某些较旧的功能已被取代并删除,因此现在已更新此版本以与新版本的MATLAB一起使用。 如果您已经知道如何从网络摄像头捕获单个图像 ,则只需将图像缝合在一起即可。您可以使用VideoWriter对象打开影片文件,然后使用writeVideo方法添加连续图像。例如: aviObject = VideoWriter('myVideo.avi'); % Create a new AVI file for iImage = 1:100 % Capture 100 frames % ... % You would capture a single image I from your webcam here % ... writeVideo(aviObject, I); % Add the image to the AVI file end close(aviObject); % Close the AVI file 我只是使用了for循环作为简单示例,但是如果您想捕获图像并将其以固定的时间间隔添加到AVI文件中,则可能需要使用timer 。 更多&回答... |
![]() |
![]() |