I would like to set the white balance for my pipeline to match my light sources, which are all 4000k, which is a standard, time-tested way to describe colour temperature. I do not want to use one of the presets in wbmode, instead I would like to use mode(9): manual and set this parameter exactly.
This question is not about my sensor (imx219), it is about my light source.
Daylight (mode (5)) is around 6000k, incandescent (mode (2)) is around 2000k. I would like to set mode (9) to 4000k.
you may using Argus API to configure as AWB_MODE_MANUAL, and Argus::IAutoControlSettings::setWbGains.
please see-also Argus sample, userAutoWhiteBalance for reference.
Thank you for your very brief response, this is clearly an area that is not to be ventured into lightly and it would appear that you are not minded to encourage such venturing.
Moving on, when I run:
“$ cat main.cpp” from /usr/src/jetson_multimedia_api/argus/samples/userAutoWhiteBalance
If I keep scrolling down through the C++ code eventually, just before the bottom, we find:
"printf("Intensity: r:%0.3f gO:%0.3f gE:: %0.3f b:%0.3f "
“WBGains: r:%0.3f gO:%0.3f gE:: %0.3f b:%0.3f\n”,
bayerAverages[0],
bayerAverages[1],
bayerAverages[2],
bayerAverages[3],
whiteBalanceGains[0],
whiteBalanceGains[1],
whiteBalanceGains[2],
whiteBalanceGains[3]);
This appears to be the code for GST_NVCAM_WB_MODE_AUTO (1), but it mentions"AWB_MODE_MANUAL", which may not be the same as GST_NVCAM_WB_MODE_MANUAL (9).
If I have this correct please may I request that you point me in the direction of the equivalent code relating to GST_NVCAM_WB_MODE_INCANDESCENT (2) and GST_NVCAM_WB_MODE_ DAYLIGHT (5), or better still provide it. If I have mis-interpreted the code, please advise.
I hope this post will be useful to anyone else who is tempted to go beyond the presets provided by nvarguscamerasrc.
I did not get your point.
it’s setting AWB mode to manual, so that internal code flow has pause to update the AWB params.
and… you may assign different WBgains for your own use-case.
In the Jetson Linux API, in the Sample Applications directory there are two sample apps that might be appropriate:
09_camera_jpeg_capture
10_camera_recording
neither of these contain the string “WBGains” in the main.cpp
“WBGains” is found in /usr/src/jetson_multimedia_api/argus/samples/userAutoWhiteBalance/main.cpp, as I mentioned above.
Both 09_camera_jpeg_capture and 10_camera_recording include the declaration: "include <Argus/Argus.h>
So I need to revise “WBGains: r: %0.3f gO:%0.3f gE:: %0.3f b:%0.3f\n”, in argus/samples/userAutoWhiteBalance/main.cpp and then build and run (e.g) 10_camera_recording , don’t I?
I have made the symbolic links, described in “Building and Running”, with the command:
$ sudo ln -sf libv4l2.so.O libv4l2.so
When I run $ sudo make to re-compile some of the jetson_multimedia_samples with my revised WBGains values, I am getting “/usr/bin/ld: cannot find -lv4l2”. Can you advise on what the problem might be?
In order to follow the guidance in README.TXT, please may I ask:
"Start in the source directory (e.g. ‘~/ArgusSDK/’).
What is ‘the source directory’ in this case?
(is it /usr/src/jetson_multimedia_api/argus/samples/userAutoWhiteBalance)?
If I add the prop “wbmode=9” after gst-nvarguscamerasrc-1.0 , does it simply point to userAutoWhiteBalance, it is not clear from the nvarguscamerasrc documentation or the Jetson Linux API/Libargus Camera API documentation.
it means you should copy the MMAPI sources from root to user folder to grant user permission.
you should under ~/ArgusSDK to build and install the sources.
for instance, $ mkdir ~/ArgusSDK $ cp /usr/src/jetson_multimedia_api/argus ~/ArgusSDK
no. it’s only the option for nvarguscamerasrc.
you may running $ gst-inspect-1.0 nvarguscamerasrc to view all available controls.
README.TXT says:
"Start in the source directory (e.g. ‘~/ArgusSDK/’).
Create and go into a build directory:
‘mkdir build && cd build’
I am therefore in ~/ArgusSDK/build, while the copied directory ‘argus’, for which I have permissions, is also in ~ArgusSDK.
The next instruction is also numbered 1). It says:
Create the makefiles:
‘cmake …’
The reason I am doing this is because I need to remake the userAutoWhiteBalance sample: path ~/ArgusSDK/argus/userAutoWhiteBalance
If I enter:
cmake samples
I get a cmake source error. I can see why, but I am following the instructions, so do I need to place the ‘argus’ directory inside the ‘build’ directory, which is what cmake appears to want, or is there some preferred solution to this please?
Running ‘cmake …’ gives the error ‘The source directory “/path/to/ArgusSDK” does not appear to contain CMakeLists.txt’.
CMakeLists.txt can be found in ~/ArgusSDK/argus, but we are in ~/ArgusSDK/build and CMakeLists.txt is not one of the files that has been copied across from /argus, however each of the samples in the /build/samples directory has its own CMakeLists.txt.
Do I:
Copy ‘CMakeLists.txt’ to ~/ArgusSDK/build and rerun ‘cmake …’
or
Modify ‘cmake …’ to point explicitly to 'userAutoWhiteBalance
or
had you also read the jetson_multimedia_api/argus/README.TXT to install those utilities mentioned in the [Requirements] section?
let me share my steps.
(1) $ cp /usr/src/jetson_multimedia_api ~/jetson_multimedia_api
(2) $ cd argus
(3) $ mkdir build && cd build
(4) $ cmake ..
please check it’s all complete with below messages.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nvidia/jetson_multimedia_api/argus/build
(4) you should now have app/ and samples/ folder under build.
~/jetson_multimedia_api/argus/build$ ls
CMakeCache.txt CMakeFiles/ CPackConfig.cmake CPackSourceConfig.cmake Makefile apps/ cmake_install.cmake samples/
(5) $ cd samples/userAutoWhiteBalance && make
...
[ 94%] Building CXX object samples/userAutoWhiteBalance/CMakeFiles/argus_userautowhitebalance.dir/main.cpp.o
[100%] Linking CXX executable argus_userautowhitebalance
[100%] Built target argus_userautowhitebalance
(6) here’s binary file you may running on the target. argus_userautowhitebalance
When I run (4) $ cmake …
At line 53 in the messages cmake fails to find module ‘gtk±3.0’
“CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:419 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:597 (_pkg_check_modules_internal)
samples/utils/CMakeLists.txt:41 (pkg_check_modules)”
– Configuring incomplete, errors occurred!
See also “~/jetson_multimedia_api/argus/build/CMakeFiles/CMakeOutput.log”.
See also “~/jetson_multimedia_api/argus/build/CMakeFiles/CMakeError.log”.
CMakeError.log reads:
"Determining if the pthread_create exist failed with the following output:
it’s reporting a required package was not found failure.
for instance,
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
please double check you’re using the L4T release version with the same version of MMAPI package.
for example,
L4T release version, $ cat /etc/nv_tegra_release # R35 (release), REVISION: 4.1, GCID: 33958178, BOARD: t186ref, EABI: aarch64, DATE: Tue Aug 1 19:57:35 UTC 2023
MMAPI package version. $ apt show nvidia-l4t-jetson-multimedia-api Version: 35.4.1-20230801124926
after that,
you should follow readme file for the steps to install all necessary utilities.