In the process of zero-crossing trigger measurement of differential confocal microscope, the sample surface features or tilt will cause the edges can't be triggered. Meanwhile, environment vibration can also cause false triggering. In order to restore the invalid information of sample, and realize high-precision surface topography measurement, Total Variation (TV) inpainting model is applied to restore the scanning images. Emulation analysis and experimental verification of this method are investigated. The image inpainting algorithm based on TV model solves the minimization of the energy equation by calculus of variations, and it can effectively restore the non-textured image with noises. Using this algorithm, the simulation confocal laser intensity curve and height curve of standard step sample are restored. After inpainting the intensity curve below the threshold is repaired, the maximum deviation from ideal situation is 0.0042, the corresponding edge contour of height curve is restored, the maximum deviation is 0.1920, which proves the algorithm is effective. Experiment of grating inpainting indicates that the TV algorithm can restore the lost information caused by failed triggering and eliminate the noise caused by false triggering in zero-crossing trigger measurement of differential confocal microscope. The restored image is consistent with the scanning result of OLYMPUS confocal microscope, which can satisfy the request of follow-up measurement analysis.