Author Topic: focus follow without intervention  (Read 1042 times)


  • Just arrived
  • *
  • Posts: 1
focus follow without intervention
« on: October 21, 2018, 06:01:26 AM »
Is it possible (during a video shoot) to program a camera to focus follow without intervention by making the camera recognize a qr code (or a pattern)?  Just like cameras recognizing faces, is it possible to program the camera to lock on to a specific pattern, no matter what and stay in focus on that pattern?  If this is possible, it will be a boon for youtubers!


  • Administrator
  • Hero Member
  • *****
  • Posts: 12545
Re: focus follow without intervention
« Reply #1 on: October 21, 2018, 03:27:19 PM »
Face detection is done outside main CPU and is currently a black box for us - we don't understand how it works and don't know how to reprogram it for different patterns, for example.

If the marker is simple enough to track from the (weak) general-purpose CPU, it might be possible. You need to find out whether the AF motor should:
- stay still (i.e. is the subject still focused?)
- focus closer (i.e. did the subject move towards the camera?)
- focus farther (i.e. did the subject move away from the camera?)

If your camera doesn't have DPAF, answering the above is going to be difficult. If it has, I assume it already has this feature (I have not tested any of these models yet).

In some cases, you might be able to tell where the subject moved from its relative size - if it became larger, it must have moved towards the camera. However, I'm pretty sure its size won't show a noticeable change when fine-tuning focus, so this would only help with very large subject movements.

Currently it's not a priority for me, but I can provide advice for those willing to look into it, and not afraid of coding image processing routines in plain C.

You may want to provide some sample footage with the pattern you have in mind; this would allow anyone to experiment with it and try to write a PoC (in any language) that answers the above questions. If that works well enough, who knows, I might even try to implement it.

Another possible approach (not tested): add some sort of distance sensor to the camera (maybe even a small TOF camera) and calibrate the lens to focus exactly at the measured distance (possible, but not implemented yet). That still won't achieve critical focus on the subject's eyes, for example; it will just focus on the closest object detected by that sensor. You can interface that sensor with any development board that can act as USB host, via PTP.