How to change the image format? If the image type is DW_IMAGE_CPU?

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.10.0
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
2.1.0
other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

Issue Description
<Please provide details about your query/application pipeline/usecase/pictures here >

Error String
< Please provide just the error messages here >

Logs
Provide logs in text box instead of image

Please paste the complete application log here. If there are multiple logs, please use multiple text code:

I tried using the following code to retrieve an image with type DW_IMAGE_CPU and format DW_IMAGE_FORMAT_RGB_UINT8, but the code threw an error. I looked at the source code and found that the problem comes from dwImage_copyConvertAsync, which only supports CUDA or NvMedia images. However, CameraFramePipeline modifies the type and format in sequence, so the code below throws an error. Therefore, I was wondering if there is a function that supports modifying the format of an image with type DW_IMAGE_CPU?

std::unique_ptr<SimpleCamera> camera;

    camera.reset(new SimpleCamera(paramsClient, sal, context, DW_CAMERA_OUTPUT_CUDA_RGBA_UINT8));
    dwImageProperties outputProps = camera->getOutputProperties();
    outputProps.type = DW_IMAGE_CPU;
    outputProps.format = DW_IMAGE_FORMAT_RGB_UINT8;
    camera->setOutputProperties(outputProps);

    while (true)
    {
        dwImageHandle_t nextFrame = camera->readFrame();
        if (nextFrame == nullptr)
        {
            camera->resetCamera();
        }
        else
        {
            dwImageCPU *imageCPU = nullptr;
            CHECK_DW_ERROR(dwImage_getCPU(&imageCPU, nextFrame));

            std::cout << "ok" << std::endl;
        }
    }

Dear @deng.shigang ,
Is it like to you want to use the image from CPU into DW framework, if so, you can use dwImagestreamer for CPU-> NvMedia transformation to feed in the pipeline.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.