[libcamera-devel] [PATCH] utils: raspberrypi: ctt: Fix alsc green averaging

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Oct 19 18:09:20 CEST 2022


Hi Paul,

(CC'ing Naush and David)

Thank you for the patch.

On Wed, Oct 19, 2022 at 08:41:43PM +0900, Paul Elder via libcamera-devel wrote:
> The alsc component of ctt meant to average the two green channels into
> one, but used incorrect indexing resulting in only the first green
> channel being used. Fix this.

Well spotted.

> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

I'd like to have an ack from David or Naush too.

This makes me wonder how different the two green channels can be if this
has never been noticed before.

> ---
>  utils/raspberrypi/ctt/ctt_alsc.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/utils/raspberrypi/ctt/ctt_alsc.py b/utils/raspberrypi/ctt/ctt_alsc.py
> index c0ba7b63..e51d6931 100644
> --- a/utils/raspberrypi/ctt/ctt_alsc.py
> +++ b/utils/raspberrypi/ctt/ctt_alsc.py
> @@ -132,7 +132,7 @@ def alsc(Cam, Img, do_alsc_colour, plot=False):
>      """
>      average the green channels into one
>      """
> -    av_ch_g = np.mean((channels[1:2]), axis=0)
> +    av_ch_g = np.mean((channels[1:3]), axis=0)
>      if do_alsc_colour:
>          """
>          obtain 16x12 grid of intensities for each channel and subtract black level

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list