How to obtain image from gige camera compatible
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(4 个)
Walter Roberson
2015-10-6
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 个评论
Cristina Gonzalo-Tirado
2016-11-9
编辑:Walter Roberson
2021-2-22
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 个评论
M.B
2021-2-22
编辑:M.B
2021-2-22
(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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 GigE Vision Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!