How to obtain image from gige camera compatible
8 views (last 30 days)
Show older comments
My code is very simple. No problem with the object creation. But I can't get any image neither with snapshot or preview function. Running the snapshot function reach the timeout period and give this error :
'Time out occured while trying to get a frame from the camera. Modify the 'Timeout' property to change how many seconds 'snapshot' method waits to return image data.'
The preview function produce a blank figure. In the documentation it appear so simple. Why those two functions doesn't work?
Here is my code :
%%Ini camera
g = gigecam('169.254.135.239');
%%Acquire and display a single image frame.
img = snapshot(g);
imshow(img);
1 Comment
Answers (4)
Walter Roberson
on 6 Oct 2015
Speaking as a sometimes systems administrator:
Using a Link-Local IPv4 address is fragile. If it is the only IP address available then it typically indicates that the network is not configured properly, or that you are using WiFi in Ad Hoc mode. You are almost always better off (in practice) in setting up DHCP to one of the Private Address ranges in 192.168.*.* or 172.16.*.* through 172.31.*.* or 10.*.*.*, or else assigning a static IP address. If you do set up DHCP then you may wish to consider configuring static IP addresses for particular MAC addresses. https://technet.microsoft.com/en-us/windowsserver/dd448608.aspx
0 Comments
Cristina Gonzalo-Tirado
on 9 Nov 2016
Edited: Walter Roberson
on 22 Feb 2021
Good afternoon,
I am experiencing a similar problem. I have three "the imaging source" cameras conected to a Poe switch and my computer connected to that switch. I can open and visualize live video and acquire images with the software of the camera (IC capture) without any problem.
However, I want to acquire images with Matlab with this very simple code, where I want to get three frames (one of each camera) in a row:
camara=gigecam('serialnumber');
pause(2)
fotoAdq=snapshot(camara);
pause(2)
imwrite(fotoAdq,'FotoAdquirida.jpg');
However, Matlab's code works randomly: sometimes an image is saved and sometimes the following error is displayed:
'Time out occured while trying to get a frame from the camera. Modify the 'Timeout' property to change how many seconds 'snapshot' method waits to return image data.'
I don't think it is a programming issue, since sometimes I manage to get a frame from the camera, but I don't see how this can be implemented in and industrial environment since for the time being it is not reliable at all.
Any comment would be appreciated. Thanks in advance
0 Comments
Jhonata Tridapalli
on 6 Apr 2018
Hello!
I get this same problem. Have you found any solutions yet?
0 Comments
M.B
on 22 Feb 2021
Edited: M.B
on 22 Feb 2021
(It's an old post but this might help others)
Check the properties of your network and see if you have a custom filter driver installed by the software that comes with the GigE camera. Desabling all properties and leaving TCP/IPv4 only may solve your problem.
Alternatively, you can check if your camera is GenICam compatible. Mine was and GenICam is more stable than GigE support package.
0 Comments
See Also
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!