MATLAB无法使用网络摄像头

时间:2016-03-29 20:40:43

标签: linux matlab webcam

我正在尝试在我的项目中连接网络摄像头,但MATLAB会抛出错误。

网络摄像头找不到任何摄像头:

>> webcamlist

ans = 

{}

两个设备ID:

>> imaqhwinfo('linuxvideo')

ans = 

       AdaptorDllName: '/home/voland/Documents/MATLAB/SupportPackages/R2014b/osgenericvideointerfac...'
    AdaptorDllVersion: '4.8 (R2014b)'
          AdaptorName: 'linuxvideo'
            DeviceIDs: {[1]  [2]}
           DeviceInfo: [1x2 struct]

相机可用,但无法启动:

>> vid = videoinput('linuxvideo',1,'YUYV_640x480')

Summary of Video Input Object Using 'UVC Camera (046d:0825)'.

   Acquisition Source(s):  Camera 1 is available.

  Acquisition Parameters:  'Camera 1' is the current selected source.
                           10 frames per trigger using the selected source.
                           'YUYV_640x480' video data to be logged upon START.
                           Grabbing first of every 1 frame(s).
                           Log data to 'memory' on trigger.

      Trigger Parameters:  1 'immediate' trigger(s) on START.

                  Status:  Waiting for START.
                           0 frames acquired since starting.
                           0 frames available for GETDATA.

>> preview(vid)
Warning: Unable to reset the crop area.  Perhaps the device is in use. 
Error using imaqdevice/preview (line 176)
Could not connect to the image acquisition device.  Device may be in use.

dmesg的:

[11484.585199] usb 4-1.1: new high-speed USB device number 7 using 
ehci-pci
[11484.888728] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
[11484.979398] input: UVC Camera (046d:0825) as  
/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.0/input/input23

使用MATLAB 2015b和Cheese(Linux)在Windows 7x64上进行了很好的工作。 我的系统:使用MATLAB 2014b建立Linux x64。 我不知道解决这个问题。我希望得到你的帮助。谢谢!

1 个答案:

答案 0 :(得分:0)

我认为你应该为你的摄像头安装支持包。转到加载项&gt;获取硬件支持包并安装正确的包。