How to detect the format of image captured by usb camera whether it is in RGGB,RGB or JPEG?

Hi all i am working on nvidia drive orin platform. I executed a sample for usb camera in which camera is getting opened. But for some reason,i want to know its format of image and how that image is getting stored in a variable? since i am beginner to this platform,i am not much aware of this.
Please advice

Please provide the following info (tick the boxes after creating this topic):
Software Version
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
1.9.3.10904
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

I cannot tick in the boxes for some reason.
DRIVE OS 6.0.6
Target operating system: Linux
Hardware platform: DRIVE AGX Orin developer kit(not sure its number)
SDK Manager version: other

Which sample application did you run? You can refer to its source in DRIVE OS 6.0.6 to understand the image format and how the image data is stored in a variable.

I ran USB CAMERA CAPTURE sample. I tried printing its image format so it showed 1012. In driveworks, Image formats are stored in numerical values?https://docs.nvidia.com/drive/driveworks-4.0/dwx_camera_usb_sample.html

Dear @akshay.tupkar,
1012 means DW_IMAGE_FORMAT_RGBA_UINT8.
Please find the image format type at DriveWorks SDK Reference: src/dw/image/Image.h Source File

@SivaRamaKrishnaNV is it DW_IMAGE_FORMAT_RGB_UINT8 or DW_IMAGE_FORMAT_RGGB_UINT9 ? a bit confused here

It is a not valid DW Image format type. You can see list of image types in image.h

@SivaRamaKrishnaNV sorry for the mistake it was DW_IMAGE_FORMAT_RGBA_UINT8. Because in the source code they have mentioned DW_IMAGE_FORMAT_RGBA_UINT8 if the image is stored in CUDA memory and i got the format as 1012 so I assumed 1012 refers to DW_IMAGE_FORMAT_RGBA_UINT8

Yes. You are right. It was typo in my previous message and I edited it now.

No worries @SivaRamaKrishnaNV and one more doubt i had is does the CUDA image need to be converted into CPU image to perform operations using opencv?

Dear @akshay.tupkar,
You can access CUDA buffers from DriveWorks SDK Reference: Image Interface and copy to CPU to use openCV on CPU.

okay thanks @SivaRamaKrishnaNV

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