[SOLVED] RGB/RGBA to RCB/RCCB conversion

Hello there,

According to DriveWorks documentation, the DriveNet detector requires a frame with RCB pixel format.

I have RGB-encoded frames in input (from network, no video file, no camera) and I would like to convert it to RCB/RCCB pixel format. Knowing that this format is the ONE accepted by all DNN detectors, why isn’t there any conversion any_format → RCB available or documented in the DriveWorks (imageConverter)?

How strange ?

I certainly missed something, can anybody advise me on a secret DriveWorks method to perform the RGB/RGBA → RCB/RCCB conversion ? Is it even necessary ?

Thank you very much.

Dear bcollado-bougeard,
There is no internal API conversion from RGB to RCB. The input video to drivenet(any network) sample is a video captured with RCCB sensor camera.

Dear SivaRamaKrishna,

Thank you for your reply.
I understand what you say, but in this case, why can the DriveNet detector (among others) process videos with a YUV420 pixel format (all the sample videos typically)? Is the YUV420 pixel format accepted ?
In this case could I convert my frames from RGB->RGBA->YUV420 (which I know is possible) before I feed the DriveNet with it ?

Thank you.

Dear bcollado-bougeard,
Drivenet expects input video as raw format recorded or live camera from RCCB sensor. If you want to use drivenet with a recorded video, you can use recorder tool to capture raw video and feed it to drivenet to get accurate results. If you use other format the network performs poorly as it is trained with RCCB raw format.
For RGBA to YUV conversions you can check format converter in driveworks.
External Media

Dear SivaRamaKrishna,

Thank you for your reply.
Just to clarify. Knowing that all .h264’s encoded sample videos provided with the DriveWorks have a YUV420 pixel’s color encoding, does it mean that any test with those videos will theoretically lead to poor results?
Indeed it would explain the high rate of false negative detections made by the DriveNet DNN for example.

Thank you for your clarifications.

Yes. You get poor results as network trained on different input type.

Dear SivaRamaKrishna,

Thank you for your reply.
When feeding the DriveNet detector with a dwImageCuda frame holding RGB data, can the pixelType (i.e
DW_TYPE_UINT8) be a problem during inference ?
Because when I try to infer my RGB CUDA frame I get this error (from the DataConditioner):
Driveworks exception thrown: DW_CUDA_ERROR: DataConditioner: Could not create texture object : invalid channel descriptor
Info: the pixel format is interleaved (1 plane: RGBRGBRGB…) with UINT8 pixel type, and dwImageCUDAMemoryType = DW_IMAGE_CUDA_PITCH.

Furthermore, I noticed that the usual input (using sample .h264 videos) is a RGB frame with planar pixel type, i.e RRRRRR / GGGGG /BBBB (planeCount = 3). Is there any way to convert a dwImageCuda from interleaved to planar pixel type ? Because when I try to initialize my final dwImageCuda frame with planeCount=3 (specified in cuda_RGB_properties) I get this error:
CALL: dwImageCUDA_create(&cuda_RGB_FRAME, &cuda_RGB_properties, DW_IMAGE_CUDA_PITCH);
ERROR: Driveworks exception thrown: DW_INVALID_ARGUMENT: calculatePlaneSizes: plane count and format combination is invalid

And no error with planeCount = 1 (wich doesn’t suit my needs)

Thank you for your help.