Hi @chee0007, I have issue is partly like yours. I’m trying to access pixel value of dwImageCUDA. Say std::cout the R channel pixel value.
This is the information I have:
image width, image height, pixel format is 3000(R0G0B0A010G1B1A1…), pixel type is uint8_t, image plane number is 1.
I’m struggling to access to member variable [array] as well as [dptr].
Now I’m trying to use [cudaMemcpy2DFromArray] with [thrust::host_vector<uint8_t> h_data(width*height, 0);] to dump cudaArray data in to c++ like vector.
Here is my thought, since the cudaArray is a low level data structure to store data, maybe I should do some research on CUDA side to access in DW?
Did you manage to solve the issue? I am facing a similar problem. I am suspecting that the issue is with dptr, because a using cudaMemcpy on dptr[0] to an array in the host as a Mat yields a blank image. I have checked the size of bytes to copy and made sure I am copying the whole size of the image.
My dwImageCuda was streamed from the compressed h264 video via nvmedia using the DW image streamer, not sure if the streamer has already decoded the image in dptr to a raw version, but strangely streaming the dwImageCuda directly to dwImageGl with gl_texture_2d target and rendering it somewhat works(?)
Hi Chee0007,
Just for your information, CUDA can stores data in pitch linear(dptr) format and block linear format(cudaArray).
Can you please copy the data from cudaArray to host memory and check if it actually contains data instead of dptr? Please refer to appropriate cuda Memcpy function at CUDA Runtime API :: CUDA Toolkit Documentation