Auto focus is a very useful and typical function in current digital cameras and cellphone cameras. As I will work on some code about the Android autofocus, I read some martials from Wikipedia and this.
First, we define what is AF. A camera`s autofocus system intelligently adjusts the camera lens to obtain focus on the subject, and can mean the difference between a sharp photo and a missed opportunity. The process of autofocusing generally works as followed:
1) An autofocus processor(AFP) makes a small change in the focusing distance;
2) AFP reads the AF sensor to assess whether and by how much focus has improved;
3) Using the information form (2), the AFP sets the lens to a new focusing distance;
The entire process is usually completed within a fraction of a second. For difficult subjects, the camera may fail to achieve satisfactory focus and will give up on repeating the above sequence, resulting in failed autofocus.
4) The AFP may iteratively repeat steps 2-3 until satisfactory focus has been achieved.