Algorithm for reduction of noise in ultramicroscopy and application to near-field microwave microscopy