Camera preview shows with webcam objects but does not with imaqtool or videoinput
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am using a Leopard IMX490 GMSL2 camera through their UVC compliant USB3.0 interface.
Using webcam objects, I can connect to the camera and view video using preview() and snapshot().
>> cam = webcam
cam =
webcam with properties:
Name: 'LI-IMX490'
AvailableResolutions: {'2896x1876' '2896x1872'}
Resolution: '2896x1876'
Zoom: 0
Tilt: 0
Gain: 16
Pan: 0
ExposureMode: 'manual'
Focus: 0
Exposure: -2
However, when I try to use videoinput() and getsnapshot(), I get the following error:
>> vid = videoinput('winvideo')
Summary of Video Input Object Using 'LI-IMX490'.
Acquisition Source(s): input1 is available.
Acquisition Parameters: 'input1' is the current selected source.
10 frames per trigger using the selected source.
'YUY2_2896x1872' 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.
>> start(vid)
>> img = getsnapshot(vid);
Error using imaqdevice/getsnapshot (line 65)
A timeout occurred during GETSNAPSHOT.
When I try to use imaqtool, I only get a white box with a red "X" in the preview window. I am also unable to release the camera using delete(vid) or clear vid after I have attempted to open the camera with videoinput or imaqtool and I have to power cycle the camera to connect to it again.
Is there a step I am missing here?
0 Kommentare
Antworten (1)
Rishabh Singh
am 30 Nov. 2021
Issue you are facing can be caused due the incorrect "image acquisition adaptor". Currently you are using 'winvideo' might not support your specific hardware. You can check for installed adaptors using command "imaqhwinfo" and could try other adaptors available on "Add-on Explorer".
One more possible cause could be the "webcam" object created by you, as both might be trying to access the hardware at the same time. If that is the case consider deleting the "cam" object.
Alternatively you can try,
cam = webcam;
img = snapshot(cam);
Hope this helps.
Siehe auch
Kategorien
Mehr zu Acquisition Using Image Acquisition Explorer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!