Hi, we are implementing the AstraDotNet library (https://github.com/bibigone/AstraDotNetDemo) for VL and it is working out very well, except for one problem. The Astra SDK is providing the depth data, color data etc. as “streams”. Those can be listened to in an Async Region and a “Frame” can be retrieved, that basiacally is an Int Pointer, that can be interpreted as a texture. So far so good, everything works for color and detph. However what I really need is the “PointStream” which is the world position in mm and also has the lens undistorted. This stream works exactly like the others, except that the IntPtr points to a Vector3. So everything is sorted incorrectly.
Now the question: Is there a way to control how data from a pointer is interpreted as an image?
The PointStream with a DataPtr as Vector3:
And the result as an image:
Here the ColorStream, which is working correctly:
Note, that the StreamToImage is doing the exact same thing as in the above screenshot.
In c++ the same thing works something like this:
astra_rgb_pixel_t* vizBuffer = visualizer_.get_output();
for (int i = 0; i < width * height; i++)
int rgbaOffset = i * 4;
displayBuffer_[rgbaOffset] = vizBuffer[i].r;
displayBuffer_[rgbaOffset + 1] = vizBuffer[i].b;
displayBuffer_[rgbaOffset + 2] = vizBuffer[i].g;
displayBuffer_[rgbaOffset + 3] = 255;
As you can see there is some reallocation going on here.