There are two types of autofocus systems: active and passive. Some cameras may have a combination of both types. In general, less expensive point-and-shoot cameras use an active system, while more expensive SLR (single-lens reflex) cameras with interchangeable lenses use the passive system.
Active autofocus uses an infrared signal instead of sound waves.
Passive autofocusing can be achieved by contrast measurement. Contrast measurement is achieved by measuring contrast within a sensor field, through the lens. The microprocessor searches for the point where there is maximum intensity difference between adjacent pixels -- that's the point of best focus (n = (I_max - I_min) / (I_max + I_min)).
A typical autofocus sensor is a charge-coupled device (CCD) that provides input to algorithms that compute the contrast of the actual picture elements
Passive autofocus must have light and image contrast in order to do its job. The image needs to have some detail in it that provides contrast. If you try to take a picture of a blank wall or a large object of uniform color, the camera cannot compare adjacent pixels so it cannot focus. AF does not involve actual distance measurement at all and is generally slower than phase detection systems, especially when operating under dim light. This is a common method in video cameras and consumer-level digital cameras that lack shutters and reflex mirrors
Difficult-to-Focus at the following subjects:
- Low-contrast subjects such as the blue sky, highly reflective surfaces like shiny cars or water, and single-color wall.
- Subjects with continuous and repeated patterns.
- Both near and far subjects are within the autofocus bracket at the same time.
- Strongly backlit subjects or those having a bright shiny background.
- The subject is moving fast.