Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]()
我在MATLAB的GUI中有3个网络摄像机和3个轴。如何将webcaminput1放置在axis1上,将webcaminput2放置在axis2上,将webcaminput3放置在axis3上?
回答: 如果您提供有关如何从网络摄像头获取输入并将其显示在屏幕上的更多详细信息,将很有帮助。 我假设您正在使用“图像采集工具箱”。显示网络摄像头输入的常用代码是 vid = videoinput('winvideo'); preview(vid) PREVIEW也可以接受图像对象句柄作为第二个参数。因此,您可以先创建图像对象,然后使用其轴进行预览: vid1 = videoinput('winvideo',1); % create video input object from the 1st source vid2 = videoinput('winvideo',2); % create video input object from the 2nd source subplot(211) h1 = image; % create image object axis ij % flip the image preview(vid1,h1) % display 1st webcam preview subplot(212) % same for the 2nd camera h2 = image; axis ij preview(vid2,h2) 我没有多个网络摄像头,所以我没有测试此代码,但我希望它可以在多个摄像机上使用。 更多&回答... |
![]() |
![]() |