Hi,
I’m writing a code where I have to get dwImageNvMedia from camera in raw (DW_CAMERA_RAW_IMAGE) format, and convert it to dwImageNvMedia RGBA. I found an example in driveworks where they are using DW_CAMERA_PROCESSED_IMAGE from camera and converting that dwImageNvMedia directly to RGBA.
I tried to change the code to get dwImageNvMedia camera image in DW_CAMERA_RAW_IMAGE format, but if I try to convert that dwImageNvMedia to RGBA, following the example from camera_multiple_gmsl, I get NvMedia2DBlitEx: Bad surface type combination error.
Sample code:
// image properties
dwImageProperties cameraImageProperties;
dwSensorCamera_getImageProperties(&cameraImageProperties, DW_CAMERA_RAW_IMAGE, sensor);
dwImageProperties displayImageProperties = cameraImageProperties;
displayImageProperties.pxlFormat = DW_IMAGE_RGBA;
displayImageProperties.planeCount = 1;
// init converter!
result = dwImageFormatConverter_initialize(&raw2rgba, cameraImageProperties.type, sdk);
// init rgba dwImageNvMedia
dwImageNvMedia rgba{};
result = dwImageNvMedia_create(&rgba, &displayImageProperties, sdk);
// get image from camera and try to convert it!
result = dwSensorCamera_getImageNvMedia(&frameNVMraw, DW_CAMERA_RAW_IMAGE, frameHandle);
result = dwImageFormatConverter_copyConvertNvMedia(frameNVMrgba, frameNVMraw, raw2rgba);
→ error (NvMedia2DBlitEx: Bad surface type combination)
Furthermore,
what’s the easiest way to change driveworks example to use DW_CAMERA_RAW_IMAGE insted of DW_CAMERA_PROCESSED_IMAGE ?
Also, is it possible to get DW_CAMERA_RAW_IMAGE from camera, convert it to YUV format and get DW_CAMERA_PROCESSED_IMAGE out of it. Like a converter between DW_CAMERA_RAW_IMAGE and DW_CAMERA_PROCESSED_IMAGE?
Thanks in advance,
Anja