Issue on White Balance using nvcamerasrc and gstreamer

This post follows the exposure-time post :

[url]Unable to change exposure-time of a camera - Jetson TX2 - NVIDIA Developer Forums

On this post I used alternative libgstnvcamera.so provided by nvidia in the other post.

I can’t manage to change white balance in this version. On the original version of the lib I don’t know if the white balance change because I can’t disable the auto exposure mode. And when the image became lighter or darker I can’t know if it due to exposure or white balance.

In the previous post I have put all command lines I’ve tried and all lines of code I’ve tried. Expecially in [url]https://devtalk.nvidia.com/default/topic/1044552/jetson-tx2/unable-to-change-exposure-time-of-a-camera/post/5300767/#5300767[/url]
and
[url]https://devtalk.nvidia.com/default/topic/1044552/jetson-tx2/unable-to-change-exposure-time-of-a-camera/post/5301697/#5301697[/url]

hello nicolas.hilaire,

I check again of your experiments in Topic 1044552, comment #10.
assume you’re testing this in the in-door environment, it is expect that you had same results after configure wbmode=auto and wbmode=fluorescent.

reference:

Enum "GstNvCamWBMode" Default: 1, "auto"
                           (0): off              - GST_NVCAM_WB_MODE_OFF
                           (1): auto             - GST_NVCAM_WB_MODE_AUTO
                           (2): incandescent     - GST_NVCAM_WB_MODE_INCANDESCENT
                           (3): fluorescent      - GST_NVCAM_WB_MODE_FLUORESCENT
                           (4): warm-fluorescent - GST_NVCAM_WB_MODE_WARM_FLUORESCENT
                           (5): daylight         - GST_NVCAM_WB_MODE_DAYLIGHT
                           (6): cloudy-daylight  - GST_NVCAM_WB_MODE_CLOUDY_DAYLIGHT
                           (7): twilight         - GST_NVCAM_WB_MODE_TWILIGHT
                           (8): shade            - GST_NVCAM_WB_MODE_SHADE
                           (9): manual           - GST_NVCAM_WB_MODE_MANUAL

I would like to narrow down the issue to check if this related to AWB or manual white balance modes.
could you please have another try to change other wbmode to confirm the issues.
thanks

Yes I’m indoor lighted with neon lights

For each test my procedure is :

  • use the command line,
  • check the picture,
  • use a lamp to saturate a part of the camera, wait for 10 seconds and see if the image global luminosity change

Here are my tests where I try all values of wbmode :

  • (0) off :
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=0 ! nvoverlaysink

The picture is a little dark and colours are ok
With light, the global luminosity doesn’t change

  • (1): auto
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=1 ! nvoverlaysink

Exactly the same results

  • (2): incandescent
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=2 ! nvoverlaysink

The picture is a little dark and the image looks more blue
With light, the global luminosity doesn’t change

  • (3): fluorescent
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=3 ! nvoverlaysink

The picture is a little dark and the colours are ok
With light, the global luminosity doesn’t change

  • (4): warm-fluorescent
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=4 ! nvoverlaysink

The picture is a little dark and the image looks more blue
With light, the global luminosity doesn’t change

  • (5): daylight
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=5 ! nvoverlaysink

The picture is a little dark and the image looks more yellow
With light, the global luminosity doesn’t change

  • (6): cloudy-daylight
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=6 ! nvoverlaysink

The picture is a little dark and the image looks more yellow than daylight
With light, the global luminosity doesn’t change

  • (7): twilight
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=7 ! nvoverlaysink

The picture is a little dark and the image looks more yellow than daylight
With light, the global luminosity doesn’t change

  • (8): shade
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=8 ! nvoverlaysink

The picture is a little dark and the image looks more yellow than daylight
With light, the global luminosity doesn’t change

  • (9): manual and wbManualMode = 0 (off)
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=9 wbManualMode=0 ! nvoverlaysink

The picture is a little dark and the colors are ok
With light, the global luminosity doesn’t change

  • (9): manual and wbManualMode = 1 (reset)
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=9 wbManualMode=1 ! nvoverlaysink

The picture is a little dark and the colors are ok
With light, the global luminosity doesn’t change

  • (9): manual and wbManualMode = 2 (restore)
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=9 wbManualMode=2 ! nvoverlaysink

The picture is a little dark and the colors are ok
With light, the global luminosity doesn’t change

  • (9): manual and wbManualMode = 3 (external-gains)
gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=.03 wbmode=9 wbManualMode=3 ! nvoverlaysink

The picture is a little dark and the image get only green component no red or blue, but I have the picture.
With light, the global luminosity doesn’t change

On this test I don’t know how to change luminosity in command line. In my preivous post I show programmatic method I’ve used to check the wbgain. These gains can make the imgae more green or more blue but I can’t manage to change global luminosity.

Hope these tests could help to solve my problem.

hello nicolas.hilaire,

according to your experiments, it seems AWB works since different wbmodes actually changes the color temperature.
I would like to understand your expectation result of taking a lamp to saturate a part of the camera.
also, may I know what’s the color temperature of your lamp. (for example, white light or yellow light)
thanks

I use a lamp to saturate the picture because when I’m with the classical library and white balance auto, it increases the light of a big part of the picture.
Due to that global luminosity to high, the awbgains will all decrease to make the global image less lighted.
Here is a demo of the expected result with exposure fixed and white balance auto : https://gph.is/2SxP8Jn

I will expose my full need:

I need to aquire outdoor pictures on a vehicle that’s moving.
Sometimes, the camera is front of the sun sometimes on the back. So I need an automatic adjustment of the global luminosity of the pictures.

But my vehicle moves, and if i let the exposure-time in automatic, the exposure time is really high (by default it is 33ms cf doc). With An high exposure time luminosity is ok but all my pictures are very blurry and unusable.

When I set the exposure-time manually to 5 ms and an automatic white balance on JetPack 3.1, it is okay, my photos are not blurry and global luminosity is ok too.

Hope it helps to understand the full problem

hello nicolas.hilaire,

I got your points,
we’ll investigate this internally and update to you once we come out conclusions.
thanks

Thanks.

If it can help you to investigate, I have re-made some tries with JetPack 3.1.

Without doing anything more than a fresh install, i can do :

gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=0.001 ! nvoverlaysink

and

gst-launch-1.0 nvcamerasrc fpsRange="15 15" auto-exposure=1 exposure-time=0.01 ! nvoverlaysink

I can easily see the difference between the two exposure time and I can confirm that the global white balance gain works also very well.

hello nicolas.hilaire,

you should expect AE algorithm to control the scene brightness, AWB does not impact scene brightness if ambient light changes.
seems your use-case has fixed exposure time and sensor analog gains also reached to its minimum limits, is expected that you’ll not see scene brightness decreasing for increasing surrounding light.

you may need tuning support for your camera solutions, I would suggest you contact Jetson Preferred Partners for your camera solutions. thanks

Thanks for your answer.

I’m not sure to understand your answer.

you should expect AE algorithm to control the scene brightness

Like I previously said, I can’t change the exposure time because images are blurry with an exposure time higher than 2ms.

AWB does not impact scene brightness if ambient light changes

The link I have previously provided (https://gph.is/2SxP8Jn) show gstreamer picture in JetPack 3.1 with auto exposure disabled and fixed to 10ms and white balance activated. The global luminosity change. If it is not AWB that make the global luminosity change what does make the changes ?

sensor analog gains also reached to its minimum limits

What are these gains ? How I can tune them ?

hello nicolas.hilaire,

sorry for late reply.
as I mentioned in comment #10, AWB does not impact scene brightness.
you should configure the exposure time range by setting maximum to 5ms for your use-case.
given below example to configure exposure time range 34ms~50ms

$ gst-launch-1.0 nvarguscamerasrc exposuretimerange="34000 50000 " ! nvoverlaysink

also, since JetPack-4.2 is now available. JetPack SDK | NVIDIA Developer
suggest you have verification with our latest release.
thanks