Franck.mh wrote:Hi everybody,
I want to use the ov13850 board on NanoPC-T4 board with the latest friendlyDesktop Image. Unfortunately the driver does not support the AFC.
Is there anyone who found an ov13850 driver supporting Autofocus Control ?
Thank you
The autofocus feature in general works like this:
The camera module (not sensor) has a VCM (voice coil motor) - which is essentially a DAC connected to a magnet that is pulling on a spring-loaded lens. The higher value is sent to DAC, the stronger is magnetic field, and the father away the lens is pulled from it's idle position, thus changing the focus. Note that OV13850 is a sensor. The T4 camera is a module that contains this sensor *and* a VCM. The VCM DAC is an I2C device on the same bus as the sensor itself, but of course with a different address. Typically, it has a single register - a 12 bit DAC value. Writing to the DAC you can manually control focus.
Autofocus is more complex. In order to determine how out-of-focus the camera image is, it is being fed to a block called edge filter. The edge filter outputs a value that has a minimum when the picture is in focus.
The edge filter is typically implemented in either ISP (image signal processor) or the camera sensor itself.
The AF module will read the edge filter value and keep changing the focus length in coarse increments, thus finding the rough interval that contains the desired minimum value. Then it will switch to the fine increments and go through this interval finding the optimum. The reality is a bit more complex, because if you do this very fast (and people want fast focusing), you are risking to encounter resonant frequency of the voice coil when moving the lens, thus overshooting or undershooting the bracket step.
Unfortunately, OV13850 does not contain the edge detector block. So your choices are to do this on ISP or by running CPU-based analysis of received frames. The latter is a bit impractical. As for the ISP - I don't know if RK3399 ISP has edge detector accelerator. If it does then this whole thing is doable.