Closed THD2-team closed 11 months ago
nevermind, issue resolved with np.squeeze, thanks a lot @ivalaginja.
To clarify a little bit: the DataStream.submit_data()
is very strict on the memory structure of the data that you're trying to submit. Inside the submit_data()
there is just a memcpy()
happening that copies memory from Numpy into the DataStream. This is for speed reasons, where any slowdown should be visible explicitly in the Python code rather than implicitly by converting the incoming array to the right format. That avoids having unexpected slowdowns. In your case, the squeeze does not take very long (read: microseconds), but you could imagine allowing dtype conversions or non-contiguous arrays, which would take way longer.
Hi, During our work with the AlliedVision camera's service, we had an issue with the array shape when submitting the data to the data stream (with submit_data). To check if the shape was good, we printed the shape of the array that we submitted and compared it to the data stream size defined in make_data_stream and it looks equals: "[1088, 1456]" for make_data_stream and "(1088, 1456, 1)" for the numpy.ndarray submitted. When adding a one value dimension to match the last one in the shape of the numpy.array to test, another error appears saying there is a dimension missmatch.
Here the exact error message we have with make_data_stream argument "[1088, 1456]", which is the sensor size: