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 Comments

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.
Hello Umar, unfortunately no luck. The issue appears that regardless of trigger mode the source does not acquire any images, and the below code also returns:
Acquisition Source(s): Stream0 is available.
Acquisition Parameters: 'Stream0' is the current selected source.
5 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: Waiting for START.
0 frames acquired since starting.
0 frames available for GETDATA.
vid = videoinput('gentl');
src = getselectedsource(vid);
% Configure trigger settings
logfile = VideoWriter("logfile.mj2", "Motion JPEG 2000")
vid.LoggingMode = ['memory']
triggerconfig(vid, 'immediate');
vid.FramesPerTrigger = 5;
start(vid);
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.

Sign in to comment.

Answers (0)

Products

Release

R2024a

Asked:

on 28 Jun 2024

Commented:

on 28 Jun 2024

Community Treasure Hunt

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

Start Hunting!