[v2,0/6] ipa: Add black level to camera sensor helpers
mbox series

Message ID 20240703104004.184783-1-stefan.klug@ideasonboard.com
Headers show
Series
  • ipa: Add black level to camera sensor helpers
Related show

Message

Stefan Klug July 3, 2024, 10:39 a.m. UTC
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.


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 | 29 +++++++++
 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, 130 insertions(+), 35 deletions(-)