I’ve already convert dwImageCUDA to OpenCV GpuMat and ran my algorithm on it. Now I need to convert it back to show in the streaming window. Is there a way to convert cv::cuda::GpuMat to a dwImageCUDA?
Suppose you can use this function to create a buffer for dwRenderEngine:
DW_API_PUBLIC dwStatus dwRenderEngine_createBuffer ( uint32_t * bufferId, dwRenderEnginePrimitiveType type, uint32_t vertexStrideBytes, uint32_t offsetBytes, uint32_t primitiveCount, dwRenderEngineHandle_t engine )
We will check if there is an example can share with you later.
You should be able to declare a DriveWorks image from GpuMat like this:
dwImageCUDA oriImage; ... // oriImage -> cv::cuda::GpuMat ... dwImageCUDA updatedImage; memcpy(&updatedImage, oriImage, sizeof(dwImageCUDA)); updatedImage.dptr = opencvImg.data; dwImageStreamer_postCUDA(&updatedImage, state.cuda2gl); dwImageStreamer_receiveGL(&outputGL, -1, state.cuda2gl);
Thank you for the example. I am using 1.2.400 Release (v0.9.8) and I could not find the functions “dwImageStreamer_postCUDA” and “dwImageStreamer_receiveGL” in the documentation. When I try to compile the code (using my variables), I got an error that the functions don’t exist.
Maybe this will be available in a new SDK version?
It should be ‘dwImageStreamer_post’ and ‘dwImageStreamer_waitPosted’.
Could you give it a try?
I found this two functions in SDK 0.6 version but not in the 1.2.400 one. The only functions I have in ImageStreamer.h are:
Maybe they have been replaced or just removed.
We will check this issue this week.
Will update information with you later.
Thanks for your patience.
Sorry for the late update.
Would you mind to update to our latest release and see if this issue still remains first.