Setting AF window location and size

Dear Hailo Community,

Can someone please help with the syntax required for the following command to set the AF windows location and size:

root@:~# v4l2-ctl -d /dev/video0 -C isp_af_window
isp_af_window[0]: 10, 10, 310, 170
isp_af_window[1]: 320, 180, 320, 180
isp_af_window[2]: 640, 360, 320, 180
root@:~# v4l2-ctl -d /dev/video0 -c isp_af_window=???

What is the syntax / format of the above command parameters ???, does anybody have an example command for setting the AF window location and size?
Best regards
Nick

Hey @nick.wheatley,

Welcome to the Hailo Community!

To set the AF (Auto Focus) window location and size using the v4l2-ctl command, you’ll need to use the isp_af_window control with specific parameters. Here’s how to structure the command:

v4l2-ctl -d /dev/video0 -c isp_af_window=<hOffset1>,<vOffset1>,<width1>,<height1>,<hOffset2>,<vOffset2>,<width2>,<height2>,<hOffset3>,<vOffset3>,<width3>,<height3>

For the values you provided, the command would be:

v4l2-ctl -d /dev/video0 -c isp_af_window=10,10,310,170,320,180,320,180,640,360,320,180

This sets up three AF windows:

  1. (10, 10) with size 310x170
  2. (320, 180) with size 320x180
  3. (640, 360) with size 320x180

Remember to adjust these values as needed for your specific application.

If you need any clarification or have further questions, please don’t hesitate to ask.

Best regards,

Hi Omria,

Thanks for the quick response, i have tried your example and get the response “control ‘10’ without ‘=’”

root@:~# v4l2-ctl -d /dev/video0 -c isp_af_window=10,10,310,170,320,180,320,180,640,360,320,180
control ‘10’ without ‘=’
root@:~#

Thanks
Nick

v4l2-ctl -d /dev/video0 -c isp_af_window=10,10,310,170,320,180,320,180,640,360,320,180

the command is not executed and the error response is control ‘10’ without ‘=’

it looks like the second value 10 after the first ‘,’ is treated as another setting and is expected to have a ‘=’ character after it with a value assigned.

So assigning arrays using this syntax doesn’t work?

Hi Omria,
Do you have a solution for this isp_af_window command problem?
Thanks
Nick

You can use the following command. Just tested this on the SBC with the latest version from the Developer Zone.

hailo_ctrl -d /dev/video0 --set-ctrl isp_af_window=[[10,10,1,1],[20,20,2,2],[30,30,3,3]]

We will check with our team why the v4l2-ctl does not work.

Thanks Klausk, tested and working, thank you.