[PATCH v3 0/6] ipa: Add black level to camera sensor helpers
Stefan Klug
stefan.klug at ideasonboard.com
Wed Jul 3 15:49:48 CEST 2024
For the tuning process and the BLC block, the sensor black level needs
to be known. The black level usually consists of a pedestal value added
by the sensor and additional physical effects like dark currents. The
sensors are usually programmed with fixed pedestal value or to
target a defined black level using internal algorithms. We are not aware
of any sensor driver that changes these values from the defaults
mentioned in the datasheets. It therefore makes sense to keep that
information inside libcamera. When the need arises to be more flexible
we can extend the sensor drivers to report black level information.
This series adds black level support to the camera sensor helpers and
the corresponding metadata to the rkisp1 ipa. Aditionally it removes the
black level information from the existing tuning files. When we observe
that the hardcoded values are too far off from actual measurements an
additional offset can be added to the tuning files.
My tuning series will be rebased on top of this one.
Best regards,
Stefan
Changes in v2:
- Store a single int16_t black level inside camera sensor helper. This
is sufficient for all known use cases.
- Fix scaling from 16bit down to 12bit for the rkisp1.
- Add more documentation text and (hopefully) clarify some commit
messages.
- Reworked the tuning data handling as proposed by Laurent.
- Updated all tuning files that contained black level values.
Changes in v3:
- Fixed incorrect shift direction in P3/6
- Added missing docs for blackLevel_
- Added comments to the black level values
- Fixed some typos and review suggestions
Stefan Klug (6):
ipa: libipa: Add black levels to camera sensor helper
ipa: rkisp1: Move camHelper into IPAContext
ipa: rkisp1: blc: Query black levels from camera sensor helper
ipa: rkisp1: blc: Report sensor black levels in metadata
ipa: rkisp1: data: Update tuning files for imx219 and imx258
ipa: rkisp1: Move ov4689 and ov5640 black levels into sensor helpers
src/ipa/libipa/camera_sensor_helper.cpp | 42 +++++++++++++
src/ipa/libipa/camera_sensor_helper.h | 3 +
src/ipa/rkisp1/algorithms/blc.cpp | 82 ++++++++++++++++++++++---
src/ipa/rkisp1/algorithms/blc.h | 5 +-
src/ipa/rkisp1/data/imx219.yaml | 4 --
src/ipa/rkisp1/data/imx258.yaml | 1 +
src/ipa/rkisp1/data/ov4689.yaml | 4 --
src/ipa/rkisp1/data/ov5640.yaml | 4 --
src/ipa/rkisp1/data/uncalibrated.yaml | 1 +
src/ipa/rkisp1/ipa_context.h | 6 ++
src/ipa/rkisp1/rkisp1.cpp | 26 ++++----
11 files changed, 143 insertions(+), 35 deletions(-)
--
2.43.0
More information about the libcamera-devel
mailing list