imaqtool does not see webcam!
34 次查看(过去 30 天)
显示 更早的评论
Hi,
My usb camera works fine with amcap and also with matlab on another computer but when used on this computer, it only works with amcap. If i use 'imqreset' or restart matlab then even amcap fails to detect any camera. Although reinserting the camera in the port makes it to start to work with amcap again but it still fails to appear in imaqtool and also generates error while using 'videoinput('winvideo')'. Could it be the usb access problem? Please help me in this regard.
Best Regards, Rafid
0 个评论
回答(6 个)
José Carlos Ferreira
2019-6-8
编辑:José Carlos Ferreira
2019-6-8
Hello.
I have a Bison webcam that is working in my Debian 9 laptop. However, after I install usb wecam support package and Image Aquisition Toolbox, MatLab can't still "see" my webcam.
This is what command window shows:
>> imaqhwinfo linuxvideo
ans =
struct with fields:
AdaptorDllName: '/home/........./Documents/MATLAB/SupportPackages/R2016b/toolbox/imaq/supportpackages/genericvideo/…'
AdaptorDllVersion: '5.1 (R2016b)'
AdaptorName: 'linuxvideo'
DeviceIDs: {1×0 cell}
DeviceInfo: [1×0 struct]
>> webcam
No webcams have been detected. Please ensure the webcam is connected to the system.
Then I did:
>> dev_info=imaqhwinfo('linuxvideo', 1)
Error using imaqhwinfo (line 143)
There is no device with the specified DEVICEID.
I also tried:
>> vid = videoinput('linuxvideo', 1)
Error using videoinput (line 233)
There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.
but still no way of detecting my webcam.
3 个评论
Image Analyst
2023-3-12
@Ahmed Magdy Use the Add-ons button on the Home tab of the Toolbar to get the webcam package.
Hakan Basargan
2019-11-4
Installing Image Acquisition Toolbox Support Package for OS Generic Video Interface might solve your problem :
Image Analyst
2012-3-2
Is this a Windows system? If so, does it appear in the "Imaging Devices" category in Device Manager? I believe in videoinput you need to specify a mode which has a resolution, like RGB24_640x480 or something like that.
vid = videoinput('winvideo', 1, 'RGB24_640x480');
src = getselectedsource(vid);
vid.FramesPerTrigger = 1;
5 个评论
Madhura Suresh
2015-8-20
Hi Avr Azahgan,
If you are using the inbuilt laptop webcam, its most likely to work with the 'winvideo' adaptor. What is the output of:
imaqhwinfo winvideo
This should list the camera. Then try,
vid = videoinput('winvideo','1');
The command that you are using uses the dcam adaptor. This will work if your camera supports the dcam interface, which I'm pretty sure the dell inbuilt camera won't.
Madhura
beyza bilici
2017-12-2
Hello, my inbuilt camera also don't get recognized. the output of :
imaqhwinfo winvideo
Invalid ADAPTOR specified. Type 'imaqhwinfo' for a list of installed ADAPTORs. Image acquisition adaptors may be
available as downloadable support packages. Open Add-Ons Explorer to install additional adaptors.
I am using matlab 2017b, while I was using 2010 it did recognize my camera. The same codes do not work on the newest version of MATLAB
2 个评论
Image Analyst
2017-12-2
Did you use the hardware explorer to install the webcam add on and the "Image Acquisition Support Package for OS Generic Video Interface" and the "MATLAB Support Package for USB Webcams"?
beyza bilici
2018-3-19
No I didnt at that time, after a while I noticed that and solved the problem. Thank you
riya mathew
2020-3-5
I am using a usb webcam and need to take pictures on it. I installed the required support package (MATLAB Support Package for USB Webcams) But this package is not providing me with an adaptor name in order for me to take the snaps using the usb webcam. However, when I installed another support package (Image Acquisition Toolbox Support Package for OS Generic Video Interface) it took snaps from the laptop's inbuilt camera. But I need to take snaps on an externally mounted Webcam. Kindly suggest a solution
2 个评论
Image Analyst
2020-3-5
If your OS sees your camera (in Windows, check Device Manager under the Imaging Devices category) then it should show up in imaqtool. Does it? Post a screenshot of imaqtool.
Cillian Hayde
2020-11-19
The solution for me on windows 10 was,
device manager -> Action -> scan for hardware changes
Then I returned to Matlab and ran the commands
devices = imaqhwinfo("winvideo");
devices.DeviceInfo
Hope this helps other folks who have this issue.
Ruino Randriamihaja
2023-5-20
Hey everyone!
I'm using MALAB R2018a and I got the same error. First I got this output
h = imaqhwinfo
Warning: No Image Acquisition adaptors found. To install Hardware Support Packages, use Add-Ons Explorer.
For more information on which support packages to install, click here.
h =
struct with fields:
InstalledAdaptors: {}
MATLABVersion: '9.4 (R2018a)'
ToolboxName: 'Image Acquisition Toolbox'
ToolboxVersion: '5.4 (R2018a)'
Then I installed OS Generic support package via Add-Ons Explorer and then
h = imaqhwinfo
h =
struct with fields:
InstalledAdaptors: {'linuxvideo'}
MATLABVersion: '9.4 (R2018a)'
ToolboxName: 'Image Acquisition Toolbox'
ToolboxVersion: '5.4 (R2018a)'
but when I run
h = imaqhwinfo('linuxvideo')
I got the message that there's no device for the 'linuxvideo' adaptor like this
h = imaqhwinfo('linuxvideo')
No devices were detected for the 'linuxvideo' adaptor. For troubleshooting device detection issues, click here.
h =
struct with fields:
AdaptorDllName: '/usr/local/MATLAB/R2018a/SupportPackages/R2018a/toolbox/imaq/supportpackages/genericvideo/adaptor/glnxa64/mwlinuxvideoimaq.so'
AdaptorDllVersion: '5.4 (R2018a)'
AdaptorName: 'linuxvideo'
DeviceIDs: {1×0 cell}
DeviceInfo: [1×0 struct]
Can anyone bring me help please?
1 个评论
Image Analyst
2023-5-20
@Ruino Randriamihaja Do you actually have a camera plugged in? The adapter (middleware) could exist even though there is no camera plugged in (yet). So when you ask the adapter what devices are plugged in, it may say none if you don't have any camera plugged in. What operating system are you using? If Windows, can you see your camera in Device Manager under the Cameras or Imaging Devices categories?
Even if the camera is there and attached, I've found recently that sometimes imaqhwinfo doesn't see it the first time. So I had to put in a loop where I repeatedly try. It seems to find it on the second attempt. Some sort of timing issue I guess. Here's a snippet from my InitializeVideoCamera.m where I do that looping to try to find my Lumenera camera in R2022b:
hardwareInfo = imaqhwinfo % Print what cameras are there.
adaptorNames = hardwareInfo.InstalledAdaptors
% Might look something like:
% adaptorNames = {'dcam' 'gentl' 'gige' 'lumeneraimaq' 'matrox' 'winvideo'} % A sample, possible list.
% Find out which index, if any, is the Lumenera Camera.
LumeneraIndex = find(contains(adaptorNames, 'lumenera', 'IgnoreCase', true))
% LumeneraIndex = find(contains(adaptorNames, 'gentl', 'IgnoreCase', true))
% Sometimes it seems like it doesn't see it right after it was registered. If that happens, wait a second and try again.
if isempty(LumeneraIndex)
numberOfAttempts = 10;
fprintf('Did not find Lumenera camera adaptor at first. Will try up to %d more times.\n', numberOfAttempts);
% Change on 5/19/2023. Added loop to check for camera up to 10 times before failing.
% I noticed that on the second attempt it would usually find it.
for k = 1 : numberOfAttempts
imaqreset
pause(2);
fprintf('Will wait 2 seconds and try again. This is attempt #%d.\n', k+1);
hardwareInfo = imaqhwinfo % Print what cameras are there.
adaptorNames = hardwareInfo.InstalledAdaptors
LumeneraIndex = find(contains(adaptorNames, 'lumenera', 'IgnoreCase', true))
if ~isempty(LumeneraIndex)
fprintf('Found adaptor on attempt #%d.\n', k+1)
break;
end
end
end
listOfInstalledAdaptors = []; % Initialize in case there weren't any at all.
if isempty(LumeneraIndex)
if isempty(adaptorNames)
% No adapters at all were found.
fn = fullfile(handles.settingsFolder, 'imaqsupport.txt');
errorMessage = sprintf('Error 1a: Did not find any installed camera adaptors!\nPlease send this file to Mark Hayworth\n%s', fn);
% Generate a diagnostics file.
if isdeployed
% Need to have the current folder be one imaqsupport() can write to, not one under the pogram files folder.
% So need to change the current folder to be in the settings folder under
% C:Users\Public\Documents\MATLAB Settings\TFC.
currentFolder = pwd;
cd(handles.settingsFolder);
imaqsupport;
cd(currentFolder); % Go back.
else
imaqsupport;
end
if isfile(fn)
winopen(fn);
end
else
% Some adapters were found. List them.
listOfInstalledAdaptors = sprintf('List of camera adaptors that were found: %s', adaptorNames{1});
if length(adaptorNames) > 1
for k = 2 : length(adaptorNames)-1
listOfInstalledAdaptors = sprintf('%s, %s', listOfInstalledAdaptors, adaptorNames{k});
end
listOfInstalledAdaptors = sprintf('%s, and %s', listOfInstalledAdaptors, adaptorNames{end}); % Insert "and"
end
listOfInstalledAdaptors = sprintf('%s.', listOfInstalledAdaptors); % Add final period.
errorMessage = sprintf('Error 1a: Lumenera camera not found in list of installed adaptors!\n %s\n', listOfInstalledAdaptors);
end
WarnUser(errorMessage);
end
if isempty(LumeneraIndex)
% No camera is attached.
UserSettings.useSamplePictures = true;
errorMessage = sprintf('Error 1b in function InitializeVideoCamera().\nMATLAB does not see the Lumenera video camera adapter software.');
ME = MException('CameraDetect:LumeneraSoftwareMissing', errorMessage);
throw(ME);
end
% If we get to here, MATLAB has the Lumenera adapter installed.
fprintf('Success! Found the Lumenera camera at index %d\n', LumeneraIndex);
theLumeneraAdaptor = adaptorNames{LumeneraIndex}
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Acquisition Using Image Acquisition Explorer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!