Video source object does not acquire data - USB Vision
显示 更早的评论
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 个评论
Umar
2024-6-28
编辑:Walter Roberson
2024-6-28
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
2024-6-28
Umar
2024-6-28
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.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 GigE Vision Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!