7 Replies Latest reply on May 27, 2019 10:35 PM by KandlaguntaR_36

    Streaming Raw10 data OV7251

    user_4067446

      I have OV7251 image sensor. Resolution 640x480 @100fps. It also has an IR filter that allows the image sensor to only see IR light between 850nm and 940nm.

       

      I am able to initialize the camera correctly and get RAW10 data on the MIPI data and clock pins.

       

      When i stream the video using ecam, I am able to see the images, but they have a green overlay.

       

      I have used CyU3PMipicsiGetErrors() to check for MIPI errors. I get:  0 0 0 0 0 0 0 0 0

       

      Does this mean i have a problem with the MIPI configuration on the CX3 or is there any other thing that can cause this?

       

      I have attached my Sensor configurations and the video with green overlay.

        • 1. Re: Streaming Raw10 data OV7251
          KandlaguntaR_36

          Hello,

           

          The UVC host applications (Like E-cam) cannot stream the RAW 10 data. You need a custom application for this.

          Please refer the following KBA Streaming RAW10 Format Input Data to 16/24-bit Output Format in CX3 MIPI CSI-2 - KBA224387 .

          • 2. Re: Streaming Raw10 data OV7251
            user_4067446

            Hi

            Thanks for the quick response.

             

            I have implemented the 16-bit output data format (CY_U3P_CSI_DF_YUV422_8_2)

             

            I used the following settings:

            a. Width in pixel                  : 640

            b. Height in pixel                : 300

            c. Bits per pixel                  : 16

            d. Frames per second       : 100

            e. Frame size                      : 640 x 300 x 16 bits

            f. Bit rate                             : 640 x 300 x 16 x 100 bits per second

             

             

            Here are the MIPI settings

            /* OV7251_RAW10_Vga :  */

            CyU3PMipicsiCfg_t OV7251_RAW10_Vga = 

            {

            CY_U3P_CSI_DF_YUV422_8_2 ,  /* CyU3PMipicsiDataFormat_t dataFormat */

                1,                          /* uint8_t numDataLanes */

                2, /* uint8_t pllPrd */

                79, /* uint16_t pllFbd */

                CY_U3P_CSI_PLL_FRS_500_1000M, /* CyU3PMipicsiPllClkFrs_t pllFrs */ 

                CY_U3P_CSI_PLL_CLK_DIV_8, /* CyU3PMipicsiPllClkDiv_t csiRxClkDiv */

                CY_U3P_CSI_PLL_CLK_DIV_8, /* CyU3PMipicsiPllClkDiv_t parClkDiv */

                0,                 /* uint16_t mClkCtl */

                CY_U3P_CSI_PLL_CLK_DIV_2, /* CyU3PMipicsiPllClkDiv_t mClkRefDiv */

                640,         /* uint16_t hResolution */

                80                         /* uint16_t fifoDelay */

            }; 

             

            Here is my UVC descriptor settings

             

            /* GUID, globally unique identifier used to identify streaming-encoding format*/

             

                0x59, 0x55, 0x59, 0x32, /*MEDIASUBTYPE_YUY2 GUID: 32595559-0000-0010-8000-00AA00389B71 */

                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 */ // changed to 640

                0x2C,0x01,                        /* Height in pixel: 480 */  // changed to 300

                0x00,0x80,0x4f,0x12,              /* Min bit rate (bits/s) 640 x 300 x No Of Bits per Pixel x FrameRate*/

                0x00,0x80,0x4f,0x12,              /* Max bit rate (bits/s): Fixed rate so same as Min */

                0x00,0xDC,0x05,0x00,              /* Maximum video or still frame size in bytes(Deprecated): changed to 640 x 300 x 2*/

                0x9f,0x86,0x01,0x00,              /* Default frame interval (in 100ns units): (1/30)x10^7 */ //  leave it as is

                0x01,                              /* Frame interval type : No of discrete intervals */

                0x9f,0x86,0x01,0x00,              /* Frame interval 3: Same as Default frame interval */

             

             

            Here are the UVC probe settings

             

            /* 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 */

                0x9f,0x86,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,0xDC,0x05,0x00,             /* Max video frame size in bytes = 640 x 300 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

            };

             

            When i stream the video on ecam, The window size changes to 640x300 as specified in the UVC descriptor, but the video is green and completely distorted (has vertical green lines)

             

            I have a feeling that the UVC and probe settings i am using are not correct. Is that the case?

             

            The image of how the video appears is attached here

            • 3. Re: Streaming Raw10 data OV7251
              user_4067446

              I also tried width in pixel as 480 and height in pixel as 400 and still get the same issue

              • 4. Re: Streaming Raw10 data OV7251
                user_4067446

                When leave the mipi data format as CY_U3P_CSI_DF_RAW10 and do not make any changes to the UVCdscr.c file generated by the cx3Config, the video on ecam appears as shown in the images i have attached here.

                 

                WIN_20190511_16_52_42_Pro.jpg

                • 5. Re: Streaming Raw10 data OV7251
                  KandlaguntaR_36

                  Timothy,

                   

                  Since you are streaming RAW video, the host application decoding it as per YUY2 format. Hence you see the green color in the image.

                   

                  You need to customize your host application as per video format.

                  • 6. Re: Streaming Raw10 data OV7251
                    user_4067446

                    Thanks Kandlaguntar

                     

                    Do you have any suggestion of host application that supports Raw10 streaming, or i have to do the customization myself

                    • 7. Re: Streaming Raw10 data OV7251
                      KandlaguntaR_36

                      You need to customize it. Use OpenCV to do the same.