Camera using the genTL interface disappears when using imaqreset

10 次查看(过去 30 天)
Hello,
My pc is connected to a USB camera that I want to control through the genTL interface. I have two types of unexpected behavior and you could surely help me solve this problem:
  • If the camera is connected to the PC after matlab has been launch, the camera is not detected using imaqhinfo and imaqreset does not solve this issue (as it should if I understood correctly ?) :
% Camera is not connected
>> camera_list = imaqhwinfo('gentl')
Warning: No devices were detected for the 'gentl' adaptor. For troubleshooting device
detection issues, click here.
% Now I plug the camera and wait a little bit
>> camera_list = imaqhwinfo('gentl')
Warning: No devices were detected for the 'gentl' adaptor. For troubleshooting device
detection issues, click here.
% Again the camera is not found. So I try imaqreset
>> imaqreset
>> camera_list = imaqhwinfo('gentl')
Warning: No devices were detected for the 'gentl' adaptor. For troubleshooting device
detection issues, click here.
  • The second thing is that if I plug the camera, and after launch matlab, then imaqreset makes the camera disappears !
% Matlab is launched after camera connection
>> camera_list = imaqhwinfo('gentl')
camera_list =
struct with fields:
AdaptorDllName: '/home/iscat/Documents/MATLAB/SupportPackages/R2022a/toolbox/imaq/supportpackages/gentl/adaptor/glnxa64/mwgentlimaq.so'
AdaptorDllVersion: '6.6 (R2022a)'
AdaptorName: 'gentl'
DeviceIDs: {[1]}
DeviceInfo: [1×1 struct]
% the camera is detected, great !Let's not try imaqreset
>> imaqreset
>> camera_list = imaqhwinfo('gentl')
Warning: No devices were detected for the 'gentl' adaptor. For troubleshooting device
detection issues, click here.
In the end I would like to be able to connect to a camera that has been connected after Matlab start. Any ideas ?
Thanks for the help !
Additional infos : PC is running on Ubuntu, last versions of GenIcam is installed

回答(1 个)

Akshat Dalal
Akshat Dalal 2024-1-1
Hi Matt,
I understand you are unable to connect your camera using the 'imaqreset' function. Based on both the problems you described, the error seems to be occurring while executing the 'imaqreset' function.
I suggest you go through the following documentations to debug the issue:
  1. https://www.mathworks.com/matlabcentral/answers/183805-usb-camera-not-recognized-by-imaqtool
  2. https://www.mathworks.com/help/releases/R2022b/imaq/genicam-gentl-hardware.html
Additionally, you could try the following to resolve the issue:
  • Try running MATLAB with sudo access, since the way linux permissions work, frequently MATLAB has issues seeing the camera if it does not have the right permissions.
  • If you have firewall enabled, this may also hinder MATLAB in recognizing your camera.
Additionally, You could generate the log files for 'imaqreset' function and try pruning it to find the issue. You could follow the below steps to generate the log files:
% To enable debugging from MATLAB, run GenTL debug commands and command to
% enumerate the GENTL hardware. To get debug output,
% 1. Open terminal and clear syslog file if they are fine with it. This will empty the log file.
$ sudo sh -c 'echo > /var/log/syslog'
% 2. Open MATLAB and run the commands below to capture debug log
imaqreset
imaqmex('feature, '-debug', true)
imaqmex('feature, '-debugGenTLDiscovery', true)
imaqhwinfo gentl
% 3. On Terminal application,
% - grep for "MATLAB" from log file, to confirm if debug statements are captured in the syslog file.
$ sudo grep "MATLAB" /var/log/syslog
If you are still unable to resolve this issue, you could try contacting MathWorks Technical Support with the log files for further assistance.
Hope this helps!

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by