[libcamera-devel] RPi algorithm optimal call order

David Plowman david.plowman at raspberrypi.com
Thu Jul 8 11:51:57 CEST 2021


Hi Jean-Michel

So I guess being one frame late isn't greatly significant, we just
like to be as up to date as possible! In particular, every frame
counts more at start-up when you're trying to converge really quickly,
but realistically, what's a frame here or there?

You also have to cover the case of not having an estimate of some of
these parameters for that first frame. Mostly that's just suppressing
any warnings, but you could contrive some awkward corner cases. Here's
an example, it's rather made up, but it is technically possible.

Suppose you run preview for a bit, then you stop and configure for the
full resolution capture mode (a "SwitchMode" in RPi terminology).
Maybe you decide to set some different colour gains of your own before
re-starting the sensor. (Yes, I know, this is a bit weird.) The effect
would be that the CCM chosen might be for the preview colour
temperature, not the one you set for the capture. Do we care?

So mostly I'm saying that I don't think it matters much. Speaking
personally, however, I would want our RPi algorithms to have the exact
behaviour that I've decided they should have, I'm a bit too picky
about that sort of thing, so I don't know if that helps or not... :)

Best regards
David

On Thu, 8 Jul 2021 at 10:14, Jean-Michel Hautbois
<jeanmichel.hautbois at ideasonboard.com> wrote:
>
> Hi David, Naushir,
>
> I want to generalize the algorithm concept you are using in RPi to IPU3
> and then to all IPAs.
>
> I want to use a Factory design pattern, like for PipelineHandler or
> CameraSensorHelper, but a question appears: is there an order to respect
> when calling the algorithms ?
>
> Reading the RPi implementation, I can't find a very strong need for
> algorithms to be called in a specific order. In the case of AWB / AGC if
> you don't have updated values for awb gains, you just use the default
> ones or latest frame ones. So we are one frame off.
>
> The order is implicitly defined by the order in the json file:
> Black level -> DPC -> Lux -> Noise -> geq -> sdn -> awb -> agc -> alsc
> -> contrast -> ccm -> sharpen
>
> But the apply() of each calculated parameter only occurs at the end of
> the sharpen call, so the influence is only on next frame.
>
> Am I missing something here, is there a strong need for ordering or is
> it marginal ?
>
> Thanks for your advices ;-).
>
> JM


More information about the libcamera-devel mailing list