Need to take simultanous snapshots from 2 gigE Devices-will parfor work? how?
1 view (last 30 days)
Im not a good programmer and need your help. Having two gige cams connected to my computer, I need them to take one snapshot each simultanously. No external trigger is currently available.
Trying to implement a parfor loop to aquire the simultanous snapshots but it doenst work.
Here the code:
% Accessing both cams
cam = [videoinput('gige', 1),videoinput('gige', 2)];
% Display all valid trigger configurations.
% View the current trigger configuration.
currentConfiguration_cam1 = triggerconfig(cam1)
currentConfiguration_cam2 = triggerconfig(cam2)
% Initiate the acquisition.
% Verify no frames have been logged.
frameslogged_cam1 = cam1.FramesAcquired
frameslogged_cam2 = cam2.FramesAcquired
% Trigger the acquisition.
% Wait for the acquisition to end.
% Determine the number frames acquired.
frameslogged_cam = cam.FramesAcquired
% frameslogged_cam2 = cam2.FramesAcquired
this is the error I get:
An UndefinedFunction error was thrown on the workers for 'getsnapshot'. This might be because the file containing 'getsnapshot' is not accessible on the workers. Use addAttachedFiles(pool, files) to specify the required files to be attached. See the documentation for 'parallel.Pool/addAttachedFiles' for more details.
Caused by: Undefined function 'getsnapshot' for input arguments of type 'struct'.
How can I solve this issue? Is there any other way to get the snapshots?
Thank you in advance