7 Replies Latest reply on Sep 15, 2020 12:28 AM by HemanthR_06

    Losing values grayscale YUV

    OfOr_1738446

      Hello,

       

      I'm using an 8bit grayscale scale sensor connected to an FPGA that adds 8bit of U/V values set to 0x80 (no color).

       

      The 16bit from the FPGA is connected to the FX3.

       

      My firmware is based on the AN75779 example and everything works well (with my C# application or VLC player) except for one thing.

       

      The problem is: Every software I found converts the YUV to RGB with a conversion formula like this:

       

        Y -= 16;
        U
      -= 128;
        V
      -= 128;
        R
      = 1.164 *+ 1.596 * V;
        G
      = 1.164 * Y - 0.392 * U - 0.813 * V;
        B
      = 1.164 * Y + 2.017 * U;

       

      Because my image is grayscale, U and V are zero so I get Y multiplied be 1.164.

      This cases values larger then 255 (?!?!?!) and when I look at the image histogram I see values of 7, 14, 21, 28, .... are at zero in the pixel count. (6 * 1.164 = 6.984 and 7 * 1.164 = 8.148).

       

      I want my camera to be a standard UVC camera.

       

      How can I solve it at the firmware level?

       

      Ofer.