How to save dwImageCUDA to jpg files?


I want to convert .raw file to .jpg image squence.
How to convert?


How to access image data of dwImageCUDA?
Is it possible using cudaMemcpytoArray? (Copy dwImageCUDA.dptr to uint8*??)

Could you explain how to access image array in driveworks?

Dear mwpark,
Do you want to convert .raw file to jpg format just to view the output. May I know the purpose.
dwImageCUDA can stores data in pitch linear(dptr) format and block linear format(cudaArray). So you need to corresponding cudamemcpy function to copy the data from GPU to CPU to access it on CPU. Please check

If you want to access the data inside a CUDA kernel on GPU, please refer runKernel function in image_streamer_simple sample.

Dear SivaRamaKrishna

Thank you for your reply.

My purpose is to make labeling data from converted jpg files.

I’ll try the cudaMemcpy.


Dear mwpark,
Could you explain a bit more about your usecase like do you connect camera to PX2 and get raw images first and then convert them to jpeg? or you already have set of raw image and you planning to convert to jpeg?

Actually, I already have image set.
So, I want to convert raw file to bmp file on offline.

But, I have another problem.
I use the cudaMemcpy to convert.
But, It cannot convert.

I use the cudaMemcpyFromArray in order to copy the image data.
<ex. frameCUDArgba(dwImageCUDA) -> m_frameCPU(dwImageCPU)>

After copying, all data is blank (0,0,0,0)

what is problem?

Dear mwpark,
Please check with cudaMemcpy2D function. You can check <driveworks_PATH>/samples/src/sensors/camera_gsml_raw/main.cpp as a reference to check cudaMemcpy2D usage.

I solved my problem.