[libcamera-devel] Software gathering of image statistics for libcamera on Librem 5

Pavel Machek pavel at ucw.cz
Fri Dec 9 19:23:49 CET 2022


Hi!

> > Anyway, I'm a bit of worried about mapping the frames once in
> > libcamera and second time in application. Syscalls are probably fast
> > enough but it is kind of ugly.
> 
> You certainly pay a price for the double mapping. I'm not sure how it
> compares to the time it take for the actual computations though.

It really depends on how good statistics I'll want to gather.

> > > All of this for AEGC, which produces values to be applied on the
> > > -sensor-. What about AWB ? Are you doing software AWB too ? How
> > > are you realizing it, by changing what parameters ?
> >
> > Yes, millipixels is doing software AWB. I'd not call it important (and
> > don't know details), but it is "fast enough". Code is here:
> >
> > https://source.puri.sm/Librem5/millipixels/-/blob/master/quickpreview.c
> 
> I do there see the colorspace conversion and a software debayering
> implementation. I guess one can plumb AWB there by adjusting the color
> space transfer function matrices coefficients  or by piping some color
> gain adjustment routine after that.

Yes, and we do kind of AWB there, the other half is in
process_pipeline.c -- compute_statistics().

> > > I actually suggest to consider GPU, but seeing a pure software
> > > implementation running would be nice for a comparison. However, I
> > > would be hesitant in having anything like that upstream for the above
> > > mentioned reasons.
> >
> > Well, there's no other good place to put camera support :-(. We should
> > not really AE/AF support in each application, and it would not be
> > acceptable in kernel.
> 
> That's a good point.
> 
> I'm not sure yet how we could model that if not with a module that
> acts a soft-IPA, but that means double mapping, in the library and in
> the application at display time (unless your application is smart and
> does 0 copy rendering)

I guess we can live with double mapping for a while.

And -- I forgot to say this earlier -- debayering is a task that could
use GPU help, especially if we do it in context of movie
recording. But for movie recording, specialized hardware to do the
mp4/avi/...  encoding will be more or less required at resolutions >
1Mpix, anyway.

What I'm saying is that statistics gathering can be done on CPU in
good-enough way.

Best regards,
								Pavel
-- 
People of Russia, stop Putin before his war on Ukraine escalates.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20221209/95f1725e/attachment.sig>


More information about the libcamera-devel mailing list