Resize/change the width and Height of a dwimage before or after streaming

Is it possible to resize the image properties of a dwimage once extracted from a streamer?
below is the code of image streamer simple.
I tried modifying the width of “cudaProp.width” to a different value I got the below error.

How do I change the width in such an example before or after streaming.

// create a new imageStreamer to stream CUDA to GL and get a openGL texture to render on screen
    // properties are the same as cpu image except for the type. For demonstration purposes the image is
    // created as RGB, format converted in CUDA to rgba and then streamed to gL
    dwImageProperties cudaProp = cpuProp;
    cudaProp.type = DW_IMAGE_CUDA;
    cudaProp.format = DW_IMAGE_FORMAT_RGBA_UINT8;
    cudaProp.width = 500;

    status = dwImage_create(&m_rgbaCUDA, cudaProp, m_context);
    if (status != DW_SUCCESS) {
        logError("Cannot create m_rgbaCUDA: %s\n", dwGetStatusName(status));
        return false;

    status = dwImageStreamer_initialize(&m_streamerCUDA2GL, &cudaProp, DW_IMAGE_GL, m_context);
    if (status != DW_SUCCESS) {
        logError("Cannot init gl image streamer m_streamerCUDA2GL: %s\n", dwGetStatusName(status));
        return false;


[10-3-2020 17:4:49] Driveworks exception thrown: DW_INVALID_ARGUMENT: FormatConverter (cuda): width output != input

terminate called after throwing an instance of ‘std::runtime_error’
what(): Cannot format convert: DW_INVALID_ARGUMENT

Dear a.a.menezes,
As I understand, you are hitting issue in format converter function where the input and output image sizes are not matching. They have to be same for format conversion.

  1. Is there any reference code where I can crop a dwCUDAimage to a specific roi.?
  2. If not is it possible to do the cropping in Nvmedia Type?

Dear a.a.menezes,
Image transformation APIs are not available in last release of DRIVE PX 2 platform. We are targeting our DRIVE SW releases for DRIVE AGX platform which has Image transformation APIs in last release(DRIVE SW 10.0). Please consider upgrading to DRIVE AGX to get latest DRIVE SW releases.

You can write CUDA kernel to select specific ROI region from input image and fill a separate buffer which can be used later in application.