We have investigated the localization of the two atoms passing through a standing wave in an optical cavity by measuring the field quadrature. It was found that the localization of the two atoms can be better preserved in the absence of the damping of cavity. If the damping of cavity is taken into account, the compromise of atomic-position localization resulting from the damping of cavity can be decreased by feedi...