harvesters: Error when chunk data is enabled with FLIR Grasshopper camera
Describe the Bug Using a FLIR Grasshopper USB3 camera with the FLIR drivers and .cti file. If I enable chunk data then already the first call to fetch_buffer throws a RuntimeException (every time). It does not matter which parameters are enabled for the chunk data. This happens every time, so it does not appear to be any random data corruption.
To Reproduce Steps to reproduce the behavior:
import os
from harvesters.core import Harvester
h = Harvester()
h.add_file(r'C:\Program Files\FLIR Systems\Spinnaker\cti64\vs2015\FLIR_GenTL_v140.cti')
h.update()
ia = h.create_image_acquirer(0)
ia.remote_device.node_map.ChunkModeActive.value = True
ia.remote_device.node_map.ChunkSelector.value = 'Gain' # or any other supported value
ia.remote_device.node_map.ChunkEnable.value = True
ia.start_acquisition()
with ia.fetch_buffer() as buffer:
component = buffer.payload.components[0]
img = component.data.reshape(component.height, component.width)
img.shape, img.dtype
Expected Behavior fetch_buffer should not throw an exception, and valid chunk data should be available.
Configuration
- OS: Windows 10
- Python: 3.7.9
- Harvester: 1.3.2
- GenTL Producer: FLIR Spinnaker SDK 2.5.0.80 (x64)
- Camera: FLIR/Point Grey Research Grasshopper3 GS3-U3-23S6C both with older firmware 2.14 and latest firmware 2.30
Reproducibility Error happens with the FLIR software (driver and GenTL producer + harvester) as described above.
Tested also with Matrix Vision mvGenTL_Acquire(x64) version 2.45.0 (i.e., MV driver and MV GenTL producer): chunk data works corretly, no error is thrown, and the values returned in the chunks appear to be correct.
Actions You Have Taken Tried upgrading the firmware on the camera, but that provided do help.
Tested with the GUI software from FLIR (“Spinview”): chunk data works correctly with their GUI.
Tested also with Matrix Vision software, and that works correctly with this camera.
- I’ve read the Harvester FAQ page.
There is mention of chunk data problems in the FAQ. The camera and data transmissions seem to be fine, since it works correctly with software from another party. Then the question remains if this is an incompatibility between harvester and FLIR software, or a clear bug in one of them.
Additional context
The full error message:
---------------------------------------------------------------------------
RuntimeException Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_149904\25613793.py in <module>
12 ia.start_acquisition()
13
---> 14 with ia.fetch_buffer() as buffer:
15 component = buffer.payload.components[0]
16 img = component.data.reshape(component.height, component.width)
c:\a\venv-cams\lib\site-packages\harvesters\core.py in fetch_buffer(self, timeout, is_raw, cycle_s)
2804 if _buffer:
2805 #
-> 2806 self._update_chunk_data(buffer=_buffer)
2807
2808 # Then update the statistics using the buffer:
c:\a\venv-cams\lib\site-packages\harvesters\core.py in _update_chunk_data(self, buffer)
2695 )
2696 else:
-> 2697 self._chunk_adapter.attach_buffer(buffer.raw_buffer)
2698 except GenericException as e:
2699 # Failed to parse the chunk data. Something must be wrong.
c:\a\venv-cams\lib\site-packages\genicam\genapi.py in attach_buffer(self, buffer, statistics)
2961 def attach_buffer(self, buffer, statistics=None):
2962 self._buffer = buffer
-> 2963 self._adapter.attach_buffer(self._buffer, statistics)
2964
2965 def detach_buffer(self):
c:\a\venv-cams\lib\site-packages\genicam\genapi.py in attach_buffer(self, pBuffer, pAttachStatistics)
3128
3129 def attach_buffer(self, pBuffer, pAttachStatistics=None):
-> 3130 return _genapi._ChunkAdapterU3V_attach_buffer(self, pBuffer, pAttachStatistics)
3131 _ChunkAdapterU3V_swigregister = _genapi._ChunkAdapterU3V_swigregister
3132 _ChunkAdapterU3V_swigregister(_ChunkAdapterU3V)
RuntimeException: Invalid layout of buffer attached to chunk parser! : RuntimeException thrown (file 'ChunkAdapterU3V.cpp', line 95)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (7 by maintainers)
Thank you @kazunarikudo, your help has been very useful in trying to understand this issue. I’ll contact FLIR and provide them with the things we’ve found out here. Perhaps by default they should use one of the standard payload types, instead of one of their own custom types… Somehow I think that should be possible, since the camera and chunk data work with the Matrix Vision producer, so if I understand this properly the camera can provide standard payloads, but FLIR producer does something strange, so that the buffers are in their custom format. I’ll update here when I here back from them.