Image acquisition in parallel via FireWire
1 view (last 30 days)
Show older comments
Hi everyone,
I am trying to capture images from two cameras via firewire with Matlab. For this I use the parallel toolbox. I have oriented myself on the following example: https://de.mathworks.com/matlabcentral/answers/388286-how-can-i-acquire-images-from-multiple-gige-cameras-using-image-acquisition-toolbox-and-parallel-com . I do not use a GigE interface, so I have adapted the code accordingly.
The code I use is the following:
delete(imaqfind);
parpool(2)
spmd(2)
delete(imaqfind);
vid=videoinput('gentl',labindex, 'Mono8')
img=getsnapshot(vid);
end
This does not work, however. Does someone know what might be the error?
Many thanks in advance
0 Comments
Answers (1)
Image Analyst
on 25 Aug 2023
Post a screenshot of what you see when you run imageAcquisitionExplorer or imaqtool
If there are two cameras you should see two cameras. If they both use the same interface, there should be a unique ID for each one.
imaqfind() is a function and you should not delete it. Maybe you meant to run imaqreset instead?
Type imaqfind into the command window (without deleting it of course) and what does it show?
5 Comments
Image Analyst
on 28 Aug 2023
I don't know how your user interface works. You don't have to snap images from both camera at the same time. You can snap them one at a time, you just need to be sure that when you get the image from camera #1 you use vid1 and when you get the image from camera #2 you use vid2. You can do that by making them globals and call this just in your startup routine.
app.vid1 = videoinput('gentl', 1, 'Mono8'); % Initialize video input object for camera 1.
app.vid2 = videoinput('gentl', 2, 'Mono8'); % Initialize video input object for camera 2.
After that use app.vid1 and app.vid2 (the global instances of those video input objects) in your button callback functions or wherever else you want (as long as app is in scope).
Tech support told me that you only need to get the video inputs once -- you do not want to call them every time you click a button on your GUI. Use getdata or getsnapshot as many times as you want without ever getting (or overwriting) the video input objects.
See Also
Categories
Find more on GigE Vision Hardware in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!