There are no devices installed for the specified ADAPTORNAME

来源:互联网 发布:软件编写工具 编辑:程序博客网 时间:2024/05/18 05:04

目标: matlab_r2014a利用mac电脑自带摄像头录制avi视频
步骤: 1.在matlab窗口命令行输入info=imaqhwinfo,查看已安装的图像采集设备。
2. info =

InstalledAdaptors: {'dcam'}    MATLABVersion: '8.3 (R2014a)'      ToolboxName: 'Image Acquisition Toolbox'   ToolboxVersion: '4.7 (R2014a)'

3. 创建一个视频输入对象:
obj=videoinput(‘dcam’,1,’YUY2_320x240’);
问题:There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.
原因:没有在matlab中安装对象摄像头的支持包
解决方法:1. 输入supportPackageInstaller,安装OS Generic Video Interface,GigE Vision Hardware(如果只用电脑自带摄像头可不安装)
2. 再次info=imaqhwinfo
3. info =

InstalledAdaptors: {'dcam'  'gige'  'macvideo'}    MATLABVersion: '8.3 (R2014a)'      ToolboxName: 'Image Acquisition Toolbox'   ToolboxVersion: '4.7 (R2014a)'

4. 终于,adaptorname为 ‘macvideo’, 输入imaqhwinfo(‘macvideo’) 查看相关信息:

ans =

   AdaptorDllName: '/Users/Bill_Wong/Documents/MATLAB/SupportPackages/R2014a/genericvideo/adaptor/mac...'AdaptorDllVersion: '4.7 (R2014a)'      AdaptorName: 'macvideo'        DeviceIDs: {[1]}       DeviceInfo: [1x1 struct]  

得到deviceID为1, 视频的格式查看命令:ans.DeviceInfo

ans =

         DefaultFormat: 'YCbCr422_1280x720'   DeviceFileSupported: 0            DeviceName: 'FaceTime \u9ad8\u6e05\u6444\u50cf\u5934'              DeviceID: 1 VideoInputConstructor: 'videoinput('macvideo', 1)'VideoDeviceConstructor: 'imaq.VideoDevice('macvideo', 1)'      SupportedFormats: {'YCbCr422_1280x720'}

即为:’YCbCr422_1280x720’
5. 最终正确的命令应该为:
obj=videoinput(‘macvideo’,1,’YCbCr422_1280x720’)

0 0