Which camera focuses on Quad-Cam 64mp in Quad mode?

I have the quad-camera board and the four cameras i just got, and can use libcamera-still to do an autofocus (though for some reason in libcamera v 0.0.11 i can no longer use picamera2 in scripts?)

but im confused about the camera focusing. I know all the cameras are synced and whatever values get set for one affect them all. but when it is autofocusing, which camera is it looking at? (or is it averaging all the cameras?)

Sorry, may you provide me with the error log or something else that can describe the error?

Do you mean if one of four cameras controls the focus?

Yeah, so like normally im guessing when you use autofocus in single camera mode, it uses the camera and an algorithm to scan through the focus values until an area of the image (probably the center of the image) has sharp lines and is “in focus”

when you have the quad camera setup, does it just do autofocusing on one camera and set all cameras to that same focus? does it do the algorithm on all cameras and average it? how does it work?

the same errors as all the poor folks over here
trying to deal with your libraries getting updated, but lacking the basic commands or documentation for how to use them. We all apparently have to manually downgrade to v10 i guess?

Hi, i would like to bring this up again as it is a pretty basic question for the Quad cam system you sell

@Dion @Edward

When you are using autofocus with the 4 camera system, how does it determine which of the four cameras to use to judge “focus”

for instance here is my quad camera previewing all four cameras

but they are pointed at different things in focus.

is the system:
A) taking an average of the focus of all four cameras?
B) use one camera as a "primary camera?
C) something else?

i’ve been testing myself, but can’t really figure out what’s going on. If i had to make a guess, it seems like it is doing something like A), or treating all four cameras as ONE image, and if a certain amount of the total pixels are in focus, the system things it has reached “focus”

@hikinghack

Is center focus.
image
image

ok thanks,
and so just to clarify:

so it focuses on the corner of each of the four cameras?

is there a way to switch to one camera, run autofocus, read the focus value, and then switch to 4 camera mode and have them all manually focus to that?

@hikinghack

You can switch channels to accomplish this

Don’t worry about the title of the question, the registers for switching channels are unified.

cool, but in between switching the channels how can i read the focus to then manually set the focus?

@hikinghack

You can try

v4l2-ctl -l -d /dev/v4l-subdev1

It corresponds to the focus distance, but it is a mapped value. You can use it to judge whether the setting is successful.

how can one switch channels in python?

@hikinghack

You can try this demo, the simpler way in python is to execute command line operations.

I finally figured out how to READ the focus. (at least on the command line)
from https://www.waveshare.com/wiki/Template:RPi_Camera_Libcamera_Guide

you have to read the diopter value

%lp Diopter of the current lens (1/distance in meters)

a command to do this is like
libcamera-still -t 0 --autofocus-mode auto --info-text "focus %focus diopter %lp"

note that %focus just tells you HOW focused an image is, not the actual focus value

1 Like