Video source object does not acquire data - USB Vision
Show older comments
Hello, i have a problem where i am unable to get the video source object to acquire video frames.
Using a USB Vision 3.0 Camera from HIKROBOT
I have tried a few varieties, with a Manual Trigger and automatic trigger, but whenever i try to get the data from the camera it times out.
The reason for the timeout i assume to be that the src.Parent status is:
Acquisition Parameters: 'Stream0' is the current selected source.
10 frames per trigger using the selected source.
'Mono8' 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: Logging data.
0 frames acquired since starting.
0 frames available for GETDATA.
Is there something obvious i am missing?
vid = videoinput("gentl");
src = getselectedsource(vid);
commands(src);
start(vid);
data = getsnapshot(vid);
3 Comments
Umar
on 28 Jun 2024
Edited: Walter Roberson
on 28 Jun 2024
Hi Lukas,
The issue you are facing is that the code times out when trying to acquire video frames from the camera. This timeout is likely due to the camera not being triggered to capture frames properly.
To resolve the timeout issue and successfully acquire video frames, you need to ensure that the camera is triggered appropriately. You can modify the trigger settings to initiate frame capture.
vid = videoinput('gentl');
src = getselectedsource(vid);
% Configure trigger settings
triggerconfig(vid, 'manual');
src.TriggerMode = 'On'; % Set trigger mode to 'On'
src.TriggerSelector = 'FrameStart'; % Select trigger type
src.TriggerSource = 'Line0'; % Set trigger source
start(vid);
trigger(vid); % Send trigger to start capturing frames
data = getsnapshot(vid);
Hope this will help resolve your issue.
Lukas
on 28 Jun 2024
Umar
on 28 Jun 2024
Hi Lucas,
After reviewing your code, there is a semi colon missing after [‘memory’]; vid.LoggingMode = ['memory']
My other suggestion would be that
The line vid.LoggingMode = ['memory'] should be modified to vid.LoggingMode = 'memory'; to correctly set the logging mode to memory.
For more information regarding logging data to disk, please refer to https://www.mathworks.com/help/imaq/logging-data-to-disk.html
Hope this will help resolve your issue.
Answers (0)
Categories
Find more on GigE Vision Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!