Ab initio calculations of the optimized geometry and the electronic structure of lattice defects in incipient perovskite ferroelectrics SrTiO3 and KTaO3 are performed in the framework of the density functional theory. The results are presented for the Li+ impurity ion at the A site in the KTaO3 and SrTiO3 ferroelectrics; the Mn2+, Cd2+, Ca2+, Mg2+, and Zn2+ ions at the A site and the Mn4+ and Mg2+ ions at the B site in the SrTiO3 compound; and the MNTi2+-VO and MgTi2+-VO complexes in the SrTiO3 ferroelectric. The results are obtained by the cluster method with allowance made for the structural relaxation initiated by the defect and, for nonisovalent substitutional impurities, with due regard for the charge and spin states of the defect. It is established that the CaSr2+, CdSr2+, MnTi4+, and MgTi2+ ions have a stable central position, whereas the LiK+ ion in the KTaO3 compound and the LiSr+, MnSr2+, and ZnSr2+ defects in the SrTiO3 ferroelectric are off-center ions. The shape of the multiminimum adiabatic potential and the parameters of dielectric relaxators (activation barrier, dipole moment) for polar defects are obtained. The electronic impurity levels are determined for the LiSr+ and MgTi2+ neutral defects.