A camera system that automatically adjusts the lens focus to obtain the sharpest possible image. Most cameras use passive autofocus, in which all adjustments are made on the light entering the lens, rather than sending out some kind of active sensing signal. There are two types of passive autofocus. The first, phase-detection autofocus, splits part of the incoming image to create a form of rangefinder, passes each through different parts of the lens, and then measures how far apart their images are. The lens is then moved until the images coincide. The second approach, contrast-based autofocus, measures the difference in intensity between adjacent image pixels, and adjusts the lens until these differences are maximized.