1. Algorithm to evaluate how blurred an image is.
2. Adjust the focus a little bit, is it getting less blurred? Keep going. More blurred? Other direction.
3. Keep adjusting until you find the point where adjusting either way means more blur.
its a passive system where the camera sensor collects image data before the picture is taken and analyzes the image, then activates the focus motor to adjust the focus. No emitter required.