[libcamera-devel,RFC,v2,0/4] RPi: Introduce AF algorithm
mbox series

Message ID 20220323160145.90606-1-jeanmichel.hautbois@ideasonboard.com
Headers show
Series
  • RPi: Introduce AF algorithm
Related show

Message

Jean-Michel Hautbois March 23, 2022, 4:01 p.m. UTC
Hello !

I proposed to add the lens controls with ancillary links support in a
previous series [1] but it seems more interesting to have it on top of
an AF algorithm.

The first patch in this series introduces Kate's algorithm used by the
IPU3IPA which is a contrast-based one. I adapted it a bit, as the
statistics on RPi are not the same, and I simplified it a bit, using
only one of the filters and all the regions (ie, it calculates a focus
on the scene, and not only on the center of this scene).

This is posted as a RFC, as it lacks a few things:
- Kieran mentionned that the entityControls in the RPi pipeline handler
  should be emplaced into a map using an enum. I tried to do it, but I
  am no jinja2 expert, and it takes me too much time for something
  supposed to be easy :-). Help appreciated here (;-) ;-)).
- The algorithm is not using any controls while David proposed those in
  [3]. I am planning to do it, at least to pass a region and send back
  the focus lens position but -ENOTIME yet.

In v2, I also included the namespace renaming, I wanted it in v1 but
missed it...

David, Naushir, Laurent, Kieran, I am not sure about the copyrights and
licenses, please comment :-).

Thanks !

---
[1]: https://patchwork.libcamera.org/project/libcamera/list/?series=2969 
[2]: https://patchwork.libcamera.org/project/libcamera/list/?series=2957

Jean-Michel Hautbois (4):
  ipa: RPi: Move the IPA to the ipa::RPi namespace
  ipa: raspberrypi: Introduce an autofocus algorithm
  libcamera: raspberrypi: Control the lens from pipeline
  ipa: raspberrypi: Control the lens position

 include/libcamera/ipa/raspberrypi.mojom       |   1 +
 .../raspberrypi/controller/af_algorithm.hpp   |  20 ++
 src/ipa/raspberrypi/controller/af_status.h    |  31 +++
 src/ipa/raspberrypi/controller/focus_status.h |   3 +
 src/ipa/raspberrypi/controller/iob/af.cpp     | 231 ++++++++++++++++++
 src/ipa/raspberrypi/controller/iob/af.h       |  55 +++++
 src/ipa/raspberrypi/meson.build               |   1 +
 src/ipa/raspberrypi/raspberrypi.cpp           |  84 +++++--
 .../pipeline/raspberrypi/raspberrypi.cpp      |  17 ++
 9 files changed, 423 insertions(+), 20 deletions(-)
 create mode 100644 src/ipa/raspberrypi/controller/af_algorithm.hpp
 create mode 100644 src/ipa/raspberrypi/controller/af_status.h
 create mode 100644 src/ipa/raspberrypi/controller/iob/af.cpp
 create mode 100644 src/ipa/raspberrypi/controller/iob/af.h