- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I got the green color streaming from OH01A10, like in the below thread.
https://community.infineon.com/t5/USB-low-full-high-speed/Streaming-Raw10-data-OV7251/td-p/105107
I going to do, convert RAW10 to RGB demosaicing using Opencv Library.But I cannot decode OpenCV's output, "YUY2 frame."
I'm trying to print the frame shape in Python-, with three planes for each pixel, like (print(frame.shape) ->640, 480, 3).
I don`t know, how I do to convert the "YUY2 frame – 3 Plane" to "Single-Plane RAW10 Bayer"
CX3 Sensor Config:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The RAW10 data on the GPIF bus will be sample like and appropriately sent over USB by CX3
Clock 1:
DQ[0:9] - P0[0:9] (pixel data) , DQ[10:15] - 000000
Clock 2:
DQ[0:9] - P1[0:9] (pixel data) , DQ[10:15] - 000000
and so on.
Every DMA buffer sent to UVC host will have UVC header (12 bytes) at the start and then the video data (P0,P1,P2...) will start.
The data received by the host is the RAW data should not be treated as planar data. The host should sample 10 bits of data and remove the next 6 bits of data.
Please check the USB traces (captured using Wireshark) to understand the padding of zeroes to pixel data
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I understand that RAW10 is sent in YUV format (packed) to the UVC host. If yes, please refer to this KBA Streaming RAW10 Format Input Data to 16/24-bit Out... - Infineon Developer Community with the packing details
If RAW10 is padded then first 10 bits will be RAW 10 data and 6 bits will be zero padding (if the GPIF II bus width is 16 bits)
On the host side, the RAW 10 data can be sampled according the format in which GPIF II samples it.
Please let me know if the data is padded or packed
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The video on the ecam looks as seen in the photos. I've attached here after I configured CY U3P CSI DF RAW10 and had not make any modifications to the UVCdscr.c file created by the cx3Config.
USB descriptors and probe control structures are as follows:
/* Class specific Uncompressed VS format descriptor */
0x1B, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class-specific VS interface Type */
0x04, /* Subtype : VS_FORMAT */
0x01, /* Format desciptor index */
0x01, /* Number of Frame Descriptors that follow this descriptor: 1 */
/* GUID, globally unique identifier used to identify streaming-encoding format*/
0X55,0X59,0X56,0X59,
0X00,0X00,0X10,0X00,
0X80,0X00,0X00,0XAA,
0X00,0X38,0X9B,0X71,
0x10, /* Number of bits per pixel: 16*/
0x01, /* Optimum Frame Index for this stream: 1 (Vga) */
0x00, /* X dimension of the picture aspect ratio; Non-interlaced */
0x00, /* Y dimension of the pictuer aspect ratio: Non-interlaced */
0x00, /* Interlace Flags: Progressive scanning, no interlace */
0x00, /* duplication of the video stream restriction: 0 - no restriction */
/* Class specific Uncompressed VS Frame Descriptor 1 - Vga */
0x1E, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Descriptor type*/
0x05, /* Subtype: frame interface*/
0x01, /* Frame Descriptor Index: 1 */
0x00, /* No Still image capture method supported */
0x80,0x02, /* Width in pixel: 640 */
0xe0,0x01, /* Height in pixel: 480 */
0x00,0x00,0x5e,0x1a, /* Min bit rate (bits/s): 640 x 480 x No Of Bits per Pixel x FrameRate = 442368000 */
0x00,0x00,0x5e,0x1a, /* Max bit rate (bits/s): Fixed rate so same as Min */
0x00,0x60,0x09,0x00, /* Maximum video or still frame size in bytes(Deprecated): 640 x 480 x 2 */
0x07,0xb2,0x01,0x00, /* Default frame interval (in 100ns units): (1/30)x10^7 */
0x01, /* Frame interval type : No of discrete intervals */
0x07,0xb2,0x01,0x00, /* Frame interval 3: Same as Default frame interval */
/* UVC Probe Control Setting - Vga*/
uint8_t const glVgaProbeCtrl[CX3_UVC_MAX_PROBE_SETTING] = {
0x00, 0x00, /* bmHint : No fixed parameters */
0x01, /* Use 1st Video format index */
0x01, /* Use 1st Video frame index */
0x07,0xb2,0x01,0x00, /* Desired frame interval in 100ns = (1/30)x10^7 */
0x00, 0x00, /* Key frame rate in key frame/video frame units */
0x00, 0x00, /* PFrame rate in PFrame / key frame units */
0x00, 0x00, /* Compression quality control */
0x00, 0x00, /* Window size for average bit rate */
0x00, 0x00, /* Internal video streaming i/f latency in ms */
0x00,0x60,0x09,0x00, /* Max video frame size in bytes = 1920 x 1080 x 2 */
#ifdef CX3_UVC_1_0_SUPPORT
0x00, 0x90, 0x00, 0x00 /* No. of bytes device can rx in single payload: 36KB */
#else
/* UVC 1.1 Probe Control has additional fields from UVC 1.0 */
0x00, 0x90, 0x00, 0x00, /* No. of bytes device can rx in single payload: 36KB */
0x00, 0x60, 0xE3, 0x16, /* Device Clock */
0x00, /* Framing Information - Ignored for uncompressed format*/
0x00, /* Preferred payload format version */
0x00, /* Minimum payload format version */
0x00 /* Maximum payload format version */
#endif
};
My requirement : How to Convert YUY2 Streaming data (3 Plane) to RAW10 (Single Plane)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Thank you for the details.
I understand that no modifications (in CyU3PMipicsiCfg_t) have been made to the firmware generated by the CX3 tool (other than the image sensor settings). Is my understanding correct?
If yes, then the RAW10 data is padded with 6 bits (zeroes/non image data) at every clock cycle and sent to UVC host as YUV format. Please note that there is not video format conversion done by CX3.
Out of 16 bits (GPIF bus width), only 10 bits are actual data and rest 6 bits are additional bits padded for every clock. This increases the pixel size to 1.6 times of actual pixel size. Therefore, the frame size increases to 1.6 times of actual frame size. You should remove additional 6 bits per pixel and display the actual frame size in the host application.
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The RAW10 data on the GPIF bus will be sample like and appropriately sent over USB by CX3
Clock 1:
DQ[0:9] - P0[0:9] (pixel data) , DQ[10:15] - 000000
Clock 2:
DQ[0:9] - P1[0:9] (pixel data) , DQ[10:15] - 000000
and so on.
Every DMA buffer sent to UVC host will have UVC header (12 bytes) at the start and then the video data (P0,P1,P2...) will start.
The data received by the host is the RAW data should not be treated as planar data. The host should sample 10 bits of data and remove the next 6 bits of data.
Please check the USB traces (captured using Wireshark) to understand the padding of zeroes to pixel data
Rashi