1,matlab输入imaqhwinfo检测摄像头是否可以使用。一般的需要安装对应的安装包。

 

matlab 播放window摄像头。

2,检测安装包:

matlab 播放window摄像头。

打印如上面所是,即我们可以用摄像头了。

3,软件测试:新建一个video_test.m

function [] = video_test()
vid = videoinput('winvideo', 1, 'YUY2_640x480');

set(vid,'ReturnedColorSpace','rgb');

vidRes=get(vid,'VideoResolution');

width=vidRes(1);

height=vidRes(2);

nBands=get(vid,'NumberOfBands');

figure('Name', 'Matlab调用摄像头', 'NumberTitle', 'Off', 'ToolBar', 'None', 'MenuBar', 'None');

hImage=image(zeros(vidRes(2),vidRes(1),nBands));

preview(vid,hImage);

运行vedio_test,我们可以看到如下的结果:

matlab 播放window摄像头。

 

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2021-08-23
  • 2021-10-21
  • 2022-01-07
  • 2021-11-08
  • 2022-01-03
  • 2022-02-22
猜你喜欢
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-07-27
  • 2021-04-26
相关资源
相似解决方案