Closed maxlklaxl closed 8 years ago
I guess this is related to #5. I should probably check the result of the image grep. However CGrabResult
only exposes access to its internal CGrabResultData via CGrabResultData * operator->()
- which is unfortunately not available inside cython...
I resort to casting to IImage (operator IImage & () const
), which is less powerful, but also exposes the image data.
In any case, I've pushed another check which will raise a runtime error if the IImage claims to be not valid. I could not test it however, since I left the cam at the university.
Okay, so I "solved" the access problem with an almighty super beautiful macro... Neither looks nice nor scales nicely, but we finally might be able to get a true error message for your issue.
This solved it, no more errors ... I'll start a longer test run
I thought I only added debug checks :-D I would be surprised to see the actual error going away.
Sorry, that was to early ... crashed
Frames until crash: 8056
Traceback (most recent call last):
File "test1_pypy.py", line 34, in <module>
for i, im in enumerate(cam.grap_images(100000000)):
File "PyPylon/cython/factory.pyx", line 226, in grap_images (cython/factory.cpp:4579)
RuntimeError: The buffer was incompletely grabbed. This can be caused by performance problems of the network hardware used, i.e. network adapter, switch, or ethernet cable. To fix this, try increasing the camera's Inter-Packet Delay in the Transport Layer category to reduce the required bandwidth, and adjust the camera's Packet Size setting to the highest supported frame size.
Yep, but at least now you know what is wrong. ;-)
So I guess it is because I have the camera on full framerate and a bas network card
also PylonViewerApp is unhappy, displaying corrupted frames and complaining
Type Time Source Message
Error 2016-02-13 18:00:03.843 Basler acA640-120gm (21625707) Image acquisition on "Basler acA640-120gm (21625707)" failed! Error: 0xe1000014 "The buffer was incompletely grabbed. This can be caused by performance problems of the network hardware used, i.e. network adapter, switch, or ethernet cable. To fix this, try increasing the camera's Inter-Packet Delay in the Transport Layer category to reduce the required bandwidth, and adjust the camera's Packet Size setting to the highest supported frame size."
I guess that is it. I've seen quite an extensive documentation by Basler on Ethernet performance, ranging from using Intel Ethernet Cards to Jumbo Frames and tuning the MTU.
If you do not mind missing frames you can now catch the Exception in Python and just restart grepping images.
rarely this happens