  Generally, wave field reconstructions obtained by phase-retrieval algorithms
are noisy, blurred and corrupted by various artifacts such as irregular waves,
spots, etc. These disturbances, arising due to many factors such as
non-idealities of optical system (misalignment, focusing errors), dust on
optical elements, reflections, vibration, are hard to be localized and
specified. It is assumed that there is a generalized pupil function at the
object plane which describes aberrations in the coherent imaging system
manifested at the sensor plane. Here we propose a novel two steps
phase-retrieval algorithm to compensate these distortions. We first estimate
the cumulative disturbance, called background, using special calibration
experiments. Then, we use this background for reconstruction of the object
amplitude and phase. The second part of the algorithm is based on the maximum
likelihood approach and, in this way, targeted on the optimal amplitude and
phase reconstruction from noisy data. Numerical experiments demonstrate that
the developed algorithm enables the compensation of various typical distortions
of the optical track so sharp object imaging for a binary test-chart can be
achieved.
