I’m currently developing with DPX2 base on Driveworks 18.104.22.168a using Driveworks Version6.0. I have a question about extracting image data array of RGBA format from dwImageCPU.
Here, dwImage_streamer is used for posting dwImageNVMEDIA to dwImageCPU (dwImageType of dwImageNVMEDIA has already covert to RGBA through an ImageFormatCoverter), in this way, we can extract the uint8_t * image data array from the dwImageCPU struct theoretically. But we got an data array of size 0(which means there is no handle pointing to any Rgba image data array in dwImageCPU>>(uint8_t ) data[DW_MAX_IMAGE_PLANES]). By the way, we have already confirmed that the input dwImageNVMEDIA is valid by passing through a dwImage_streamer to dw_Image_GL, and receiving display successfully. More to mention, both dwImageStreamer_postNVMEDIA and dwImageStreamer_receiveCPU resulted as DW_SUCCESS.
Is there some determinant parameter causing this error? And what is the difference between DW_CAMERA_PROCESSED_IMAGE and DW_CAMERA_RAW_IMAGE in dwCameraOutputType while using function dwSensorCamera_getImageProperties? Will it be the key point of initializing dwImage_streamer?
DW_CAMERA_RAW_IMAGE captures the image in RAW format, DW_CAMERA_PROCESSED_IMAGE captures image in processed(yuv) format. Have you checked printing data array? can you double check dwImageProperties of dwImageCPU?
I believe, you have captured image DW_CAMERA_PROCESSED_IMAGE flag and used dwImageFormatConverter_copyConvertNvMedia to convert to RGBA format before sending it to CPU using imageStreamer.
Thank you for your quick reply. And I do process the image frame as you described. I have double checked the dwImageProperties of dwImageCPU, and the properties seem to be normal(type=0[dwImageCPU], width=1280, height=1080, pixelFormat=3000[RGBA],pxlType=64).By the way, the image size should be 12801080,however dwImageCPU.pitch equals to 5120(which should be 12801080*4), and data prints to be empty.
Did something wrong? Or is there any other way to extract the RGBA image and save it?
We will look into it. Can you quickly check printing data, data… before writing it to file. Also, I do not see any dwImageFormatConverter_copyConvertNvMedia calls in the code as you mentioned.