Sinewave-based measurement of the modulation transfer function for noisy and distorted images