UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
1,563 Views
Registered: ‎08-26-2017

Noisy Output from CCM and YCbCr2RGB conversion IPs

Jump to solution

Hi

 

We are implementing a digital front end for an NTSC camera using Artix 7 FPGA. FPGA drives the necessary control waveforms to the sensor's analog front end, receives the digital data from the analog front end and does pre-processing to extract the RGB data from sensor's mosaic data and send it over USB to host PC for further processing.

(We have a custom application based on libuvc and openCV to receive USB stream data and display it.)

 

We have used a set of equations to convert the mosaic to YUV 4:2:0 and then used chroma resampler to get YUV444. This YUV444 has to be converted to RGB. There are two ways to do it.

 

I have to use the YCbCr convertor or the CCM IP.

 

Since the equations to convert NTSC to RGB were different than that of YUV2RGB, we have used CCM IP giving the required coefficients.

NTSC2RGB

R = Y + 0.956V + 0.621U

G = Y - 0.272V  - 0.647U

B = Y - 1.106V  + 1.703U

(https://in.mathworks.com/help/images/ref/ntsc2rgb.html)

 

Now here is the problem. The CCM IP output is very noisy.

 

We have done a set of experiments

1) We directly passed the YUV data over USB to host and applied the NTSC2RGB transformation.

     Results -> The video stream is clean with expected colors

     Refer Picture _134014869.JPG

 

2) We have used CCM IP with NTSC coefficients and displayed the output

    Results -> The video stream is noisy with dominant magenta/Cyan grains

    Refer Picture _135157666.JPG

 

3) We have tried swapping coefficients of column 2 and column 3 just to check if we have confused U and V order in input.

    Results -> The video stream is noisy with dominant cyan/Magenta grains ]

    Refer Picture : _135157666.JPG

  

   

4) We have used CCM IP with identity matrix on YUV 444 input. Passed the CCM output to host and applied NTSC2RGB transformation

    Results -> The video stream is noisy and in grayscale

    Refer Picture _134328748.JPG

 

4) We used YCbCr2RGB IP using various settings for input(YUV, NTSC ..)

    Results -> The video stream is always noisy as in 2.

    Refer Picture _135313910.JPG (for YUV setting)

 

I have also tried giving YUV2RGB conversion coefficeints in CCM but i do get the same results.

 

Platform Details :

Artix 7 FPGA - XC7A100T-2CSG324C

Xilinx Vivado 2016.4 Webpack

Chroma Resampler - Hardware Evaluation License

Color Conversion Matrix - Hardware Evaluation License.

 

Please suggest on how to get this noise issue resolved.

 

Thanks and Regards,

Ajay Kumar Gurrala.

 

 

 

 

IMG_20170913_134014869.jpg
IMG_20170913_134328748.jpg
IMG_20170913_135157666.jpg
IMG_20170913_135313910.jpg
0 Kudos
1 Solution

Accepted Solutions
Scholar watari
Scholar
2,086 Views
Registered: ‎06-16-2013

Re: Noisy Output from CCM and YCbCr2RGB conversion IPs

Jump to solution

Hi @ajaykumargurrala

 

I'm sure that this is offset value issue.

In general, as you already known, user considers UV, PrPb and IQ as unsigned integer.

 

In this case, I'm sure that you need to change formula to add offset value (0x80) in RGB2YUV and YUV2RGB.

Could you try it ?

 

Thank you.

Best regards,

 

0 Kudos
6 Replies
Scholar watari
Scholar
1,560 Views
Registered: ‎06-16-2013

Re: Noisy Output from CCM and YCbCr2RGB conversion IPs

Jump to solution

Hi @ajaykumargurrala

 

Could you try to input NTSC color bar and color chart on this IP ?

I'm sure that it is helpful to find route cause.

 

Thank you.

Best regards

0 Kudos
Adventurer
Adventurer
1,550 Views
Registered: ‎08-26-2017

Re: Noisy Output from CCM and YCbCr2RGB conversion IPs

Jump to solution

Hi Watari,

 

I will try it out and update you on the results.

 

Thanks and Regards,

Ajay Kumar

0 Kudos
Adventurer
Adventurer
1,451 Views
Registered: ‎08-26-2017

Re: Noisy Output from CCM and YCbCr2RGB conversion IPs

Jump to solution

Hi Watari,

 

Today, i have tried testing Color Correction Matrix IP with NTSC colors. Details below

 

Using an online color tool, i have derived the NTSC color values for White, Red, Green, Blue, Cyan, Magenta, Yellow and few more colors. I have input these values to the IP and ran simulations.Observations -

a) Color Correction Matrix IP results were as matching the expected RGB outputs when we input NTSC values of Red, White, Magenta.

b) The IP results were not as expected when we input NTSC values for Green, Blue, Cyan and Yellow.

 

When we look into the NTSC values of these components,

1) Red, white and Magenta all had positive component values for Y, I, Q

2) Green, Blue, Cyan and Yellow had atlease one of I/Q as negative.

 

From this, it appears that the IP expects unsigned inputs for color components (Y, I and Q).

 

The results of NTSC inputs to YCbCr2RGB IP were always wrong.

 

I am trying to figure out the ways to handle this sign issue. Any ideas/suggestions would be greatly helpful.

 

Thanks

Ajay.

0 Kudos
Scholar watari
Scholar
2,087 Views
Registered: ‎06-16-2013

Re: Noisy Output from CCM and YCbCr2RGB conversion IPs

Jump to solution

Hi @ajaykumargurrala

 

I'm sure that this is offset value issue.

In general, as you already known, user considers UV, PrPb and IQ as unsigned integer.

 

In this case, I'm sure that you need to change formula to add offset value (0x80) in RGB2YUV and YUV2RGB.

Could you try it ?

 

Thank you.

Best regards,

 

0 Kudos
Adventurer
Adventurer
1,409 Views
Registered: ‎08-26-2017

Re: Noisy Output from CCM and YCbCr2RGB conversion IPs

Jump to solution

Hi Watari,

 

Thank you for confirming. I have started working on the corrective measure. Will get back to you once I test the same.

 

Thanks,

Ajay

0 Kudos
Adventurer
Adventurer
1,395 Views
Registered: ‎08-26-2017

Re: Noisy Output from CCM and YCbCr2RGB conversion IPs

Jump to solution

Hi Watari,

 

I have modified the equations as required for unsigned I and Q inputs and could see the expected results. Details below

 

For the conversion equation of the form

Op = Y + A*I + B*Q  (I and Q 8 bit signed)

The transformation used is

Op = Y + A*I' + B*Q' -128(A+B)  (where I' = I + 128 and Q' = Q + 128)

 

I have specified  the value of "-128(A+B)" as offset value for that particular output channel in CCM IP.

 

This gave me the clean output image. (snapshot attached).

 

Thank you very much for your valuable suggestion.It really helped in identifying the root cause quickly.

 

Regards,

Ajay.

 

 

Test888_screenshot_25.09.2017.png
0 Kudos