From 23e15e72f9745d4a11f41b366ff3c9e3dca51bf0 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 28 May 2020 15:51:32 +0100 Subject: ipa: rpi: Add "focus" algorithm Adds FocusStatus to the image metadata, containing contrast measurements across the image. Optionally also prints a contrast measure to the console, to aid in manual adjustment of the lens. Note that it is not an actual auto-focus algorithm that can drive a lens! Signed-off-by: David Plowman Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/focus.hpp | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/ipa/raspberrypi/controller/rpi/focus.hpp (limited to 'src/ipa/raspberrypi/controller/rpi/focus.hpp') diff --git a/src/ipa/raspberrypi/controller/rpi/focus.hpp b/src/ipa/raspberrypi/controller/rpi/focus.hpp new file mode 100644 index 00000000..d53401f7 --- /dev/null +++ b/src/ipa/raspberrypi/controller/rpi/focus.hpp @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ +/* + * Copyright (C) 2020, Raspberry Pi (Trading) Limited + * + * focus.hpp - focus algorithm + */ +#pragma once + +#include "../algorithm.hpp" +#include "../metadata.hpp" + +/* + * The "focus" algorithm. All it does it print out a version of the + * focus contrast measure; there is no actual auto-focus mechanism to + * control. + */ + +namespace RPi { + +class Focus : public Algorithm +{ +public: + Focus(Controller *controller); + char const *Name() const override; + void Read(boost::property_tree::ptree const ¶ms) override; + void Process(StatisticsPtr &stats, Metadata *image_metadata) override; +private: + bool print_; +}; + +} /* namespace RPi */ -- cgit v1.2.1