Alternative for depracted dwImageFormatConverter ?

Hi guys,

I updated the PX2 to the newest SDK (5.0.10.3). I saw the dwImageFormatConverter was depracted.Also the methods dwImageFormatConverter_initialise and dwImageFormatConverter_copyConvertNvMedia are not available anymore. Do some other methods replace the functionality? or
is there any simple way to convert now YUV formats (read from Camera) to rgb format?

Thanks for any help.
Marcel

The replacement for dwImageFormatConverter is dwImage_copyConvert which is defined in Image.h. The type of conversion is now automatically determined based on the opaque dwImageHandle_t pointer.

Hi Marcel,

I may assume the answer of ‘Maghoumi’ solved your issue already?

  • Fabian

Hi Fabian,

yes partly. I still don’t understand how I get back to a dwImageNvMedia type after i called the copyConvert method of the dwImage_copyConvert. This function gives me as a Output a dwImage_Handle_t. Do you have any ideas for this?

I need to find the same functionality for the following methods in the new SDK.

// Get Camera Image
dwSensorCamera_getImageNvMedia(&frameYUV, DW_CAMERA_PROCESSED_IMAGE, frameHandle));
// Old Method Convert from YUV to RGBA (Output dwImageNvMedia)
dwImageFormatConverter_copyConvertNvMedia(frameRGBA, frameYUV, cam2rgba));

Thanks for your effort and help,
Marcel

Hi Marcel,

I guess you are looking for this function here:

DW_API_PUBLIC dwStatus dwSensorCamera_getImage (dwImageHandle_t * image,
                                                dwCameraOutputType type,
                                                dwCameraFrameHandle_t frame)

And then simply call

DW_API_PUBLIC dwStatus dwImage_copyConvert (dwImageHandle_t output,
                                            dwConstImageHandle_t input,
                                            dwContextHandle_t context)

Now you have your ImageHandle that you need to pass over to the following function:

DW_API_PUBLIC dwStatus dwImage_getNvMedia (dwImageNvMedia ** imageNvMedia,
                                           dwImageHandle_t image)

Be aware, that beforehand you need to have declared a pointer to:

struct dwImageNvMedia

Further information can also be found in the egomotion sample, just see ll. 1222-1224.

FYI with the following release, we will also publish a bunch of crisp and fresh tutorials. They will range from bringing you on board with your DDPX until complex development tutorials. Each one build on top of the previous one.
As we start out with the basic ones, we will add more as we go. I will consider this example here as base for a future tutorial.

  • Fabian

Hallo Fabian,

Thank you very much for your help. No its working fine.

Best regards,
Marcel

Hi Marcel,

you are welcome.

  • Fabian