Please provide the following info (tick the boxes after creating this topic):
Software Version
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
1.9.2.10884
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
extracting Y,UV from a YUV420 image
Using DriveWorks SDK 5.10.
I’m trying to convert a YUV input image to 2 separate input images that are required for the DNN I’m using (code is based on sample_object_detector_tracker).
I’m using the dwImage_copyConvert function for this purpose:
dwImageHandle_t nextFrame = m_camera->readFrame();
dwImageHandle_t yImageHandle = nullptr;
dwImageHandle_t uvImageHandle = nullptr;
// Set the properties of the Y and UV images
dwImageProperties yImageProperties = m_rcbProperties;
yImageProperties.format = DW_IMAGE_FORMAT_R_UINT8;
dwImageProperties uvImageProperties = m_rcbProperties;
uvImageProperties.format = DW_IMAGE_FORMAT_RG_UINT8; // NOT SUPPORTED
// Allocate memory for the Y and UV images
CHECK_DW_ERROR(dwImage_create(&yImageHandle, yImageProperties, m_sdk));
CHECK_DW_ERROR(dwImage_create(&uvImageHandle, uvImageProperties, m_sdk));
// Convert the YUV420 image to Y and UV
CHECK_DW_ERROR(dwImage_copyConvert(yImageHandle, nextFrame, m_sdk));
CHECK_DW_ERROR(dwImage_copyConvert(uvImageHandle, nextFrame, m_sdk));
According to the supported conversion formats (DriveWorks SDK Reference: Image Interface)- only DW_IMAGE_FORMAT_R_UINT8 is supported and would supposedly extract the Y channel given a YUV input. Would this work?
My questions are:
- how do I extract the UV channels since the DW_IMAGE_FORMAT_RG_UINT8 is not supported?
- another gap I have regarding the UV channels extraction is that according to the documentation of dwImage_copyConvert it may not support it since it requires input and output to be of the same size while UV height will be half the size of the original YUV image.
- how else would you recommend to perform this task using the SDK library functions?