imaqhwinfo webcam not detected!

12 次查看(过去 30 天)
Hello,
Working on on progam for hand gesture recognition. Up until now I have been using the stock webcam of my MacBook. I have recently bought a Logitech C920 webcam and would like to use it instead of the stock one. The code used for setting up video is below.
%% Create video input object.
cam = imaqhwinfo; % Get Camera information
cameraName = char(cam.InstalledAdaptors(end));
cameraInfo = imaqhwinfo(cameraName);
cameraId = cameraInfo.DeviceInfo.DeviceID(end);
cameraFormat = char(cameraInfo.DeviceInfo.SupportedFormats(end));
vidDevice = imaq.VideoDevice(cameraName, cameraId, cameraFormat, ... % Input Video from current adapter
'ReturnedColorSpace', 'RGB');
vidInfo = imaqhwinfo(vidDevice); % Acquire video information
%I would think changing this:
cam = imaqhwinfo;
%To this, would fix the issue
cam = imaqhwinfo('macvideo',2);
%But, I recieve the following error.
%ERROR: There is no device with the specified DEVICEID.
I find this strange because I know that the computer is recognizing the c920 webcam as I can use it for Zoom. Any suggestions to be able to access c920 instead of the mac camera? Thanks!
*UPDATE: I have already installed the Image Acquisiton Toolbox support package for OS generic video interface
Best,
Sebastian Caceres

回答(1 个)

Image Analyst
Image Analyst 2021-2-2
Go to the Add-ons explorer on the Home tab. Search for camera or webcam. I think there is a webcam add-on that you need to add to your installation.
  1 个评论
Sebastian Caceres
Forgot to mention that I have already installed that add on, I'll update that in the question!

请先登录,再进行评论。

产品


版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by