An exemplary automatic focusing system adopted in a camera includes a
brightness detecting unit, a recording unit, a correcting unit, and a
selecting unit. The brightness detecting unit is configured for detecting
a general brightness value of an environment of a subject prior to a
focusing operation of the camera and outputting a correction factor
associated with the general brightness value. The recording unit is
configured for storing a first set of brightness values and the first set
of contrast values. The correcting unit stores a preset brightness value
and a preset contrast value. The correcting unit is configured for
calculating a number of second contrast values according to the
correction factor, the first set of brightness values, a preset
brightness value, and a preset contrast value. The selecting unit is
configured for choosing a maximum contrast value from the number of
second contrast values of the subject.