We study effects produced by an O vacancy and F center in cubic and tetragonal lead titanate (PbTiO3) crystals as well as barium titanate (BaTiO3) (001) surface. Displacements and charges of defect-surrounding atoms, lattice distortion and relaxation energies are carefully analyzed. It is found that the predominant cause of atomic movements in PbTiO3 around an O vacancy is the Coulomb interaction while in the case of F center also changes in the chemical bonding within the atomic planes should be taken into consideration in order to explain atomic movements. We also observe a phenomenon known as bi-stability of the fundamental state, which occurs due to the rotation of some cationic planes. The obtained vibronic energy barriers for bi-stability are found to be around 1.0 eV. In the case of the BaTiO3 crystal the computed average atomic movements around the O vacancies are around 0.12 Angstrom and 0.15 Angstrom for the cubic and tetragonal lattices, respectively. In the case of F center we observe somewhat smaller lattice distortion. In the latter case, however, we find a considerable redistribution of electronic charge leading to a polarization of the defect-surrounding lattice, especially if the F centre is situated within the Ti-O-2 plane. In general, there is a reduction of the ferroelectric dipole moment for the tetragonal phase of the crystal due to the F center presence on BaTiO3 (001) surface.