Elastic cross sections are calculated and compared with the data on π ± scattering on 28 Si, 40 Ca, 58 Ni, 208 Pb nuclei in the energy range from 130 to 290 MeV. To this end, both the folding optical potential (OP) and the local modified Kisslinger-type OP were calculated, and then the πA cross sections were obtained by solving the Klein-Gordon equation to account for the relativization and distortion wave effects. In the folding OPs, the parameters of the elementary πN amplitude were fitted when describing the πA scattering data, and thus the essential in-medium effect on the parameters of the πN amplitude was established since the pion is scattered not on a free but on a bound nuclear nucleon. Fairly good agreement with experimental data was obtained for both models of optical potentials and their forms turn out to be in coincidence in the region of their surfaces.