Use nvarguscamerasrc to show image. The image has color deviation

use nvarguscamerasrc to show image. The image has color deviation.
Use the command :
gst-launch-1.0
nvarguscamerasrc sensor-id=0
! ‘video/x-raw(memory:NVMM), width=1920, height=1080, format=(string)NV12, framerate=(fraction)30/1’
! nvvidconv ! ‘video/x-raw,width=768, height=432’
! fpsdisplaysink text-overlay=1 video-sink=xvimagesink sync=0 -v

Do you know how to eliminate the color deviation?


The picture is captured by nvarguscamerasrc. There is color deviation. White is not pure white.

What’s the sesnor? IMX219/IMX477?
What’s APP show normal color?

The sensor is IMX390. The mode is
mode_type = “bayer”;
pixel_phase = “rggb”;
csi_pixel_bit_depth = “12”;

Use opencv to read r g b value, and addWeighted r b value to do white balance. But the CPU performance is poor without GPU acceleration. The following picture color looks normal.


nvarguscamerasrc has GPU acceleration, but has the color deviation. Is there nvvidconv or other tool of gst-launch-1.0 to eliminate the color deviation?

I don’t think nvvidconv would cause the color deviation.
You can try below command without nvvidconv.

gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)1920,height=(int)1080, framerate=30/1' ! nv3dsink sync=0

gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)1920,height=(int)1080, framerate=30/1' ! nvegltransform ! nveglglessink sync=0

Yes. I don’t think nvvidconv would cause the color deviation.
The camera is IMX678 at this time. IMX678 is auto exposure. Color deviation is more obviouse.
IMX678 mode is also
mode_type = “bayer”;
pixel_phase = “rggb”;
csi_pixel_bit_depth = “12”;
IMX390 exposure is too much. High exposure makes all color to be white.

The first picture is captured by nv3dsink command.
The second picture is captured by nveglglessink.
The color of A4 paper in the picture is pure white in fact. But the color is not pure white from two pictures.


Suppose it could be over exposure cause the problem.

No. Now there is no over exposure. But the color deviation is obviouse.

For this kind of problem suppose need image tuning process.
Please consult with camera partner for the IQ process.

Thanks

The color type of the camera is RGGB. Use opencv to do white balance, there is no color deviation.
nvarguscamerasrc changes the color type from RGGB to NV12, then different sinks all show color deviation image.
I think the issue is from the nvarguscamerasrc.

Right, that’s why need image tuning for ISP pipeline.

I don’t understand why camera needs image tunning for ISP pipeline. I think nvarguscamerasrc needs to be checked. How does nvarguscamerasrc change rggb to NV12? Perhaps the formula is not correct.

It’s by ISP debayer function.

Is ISP debayer function in nvarguscamerasrc? Could I get the source code, then compile and build a privacy nvarguscamerasrc to test?

Yes, this code didn’t public, sorry to tell.

Thanks

Could you please provide a patch to change U value or V value in YUV? I will test,and see the effect.

I see a case about color deviation of YUV from the link https://cloud.tencent.com/developer/article/2320861 .
U value and V value are mixed up. U value is V value in fact. V value is U value in fact.



The first image is normal. The second image is color deviation for U value and V value are mixed up.

I don’t think it’s the same issue. The YUV was convert by the ISP HW eng.

Thanks

Yes. I share an example. It’s not the same issue. If U or V value is not correct, the image color is not correct. Could you share the formula of changing rggb to nv12 in ISP HW eng

Is there any progress