Abstract For spot scanning dark-field scattering technology, the defocus caused by the change in wafer surface height decreases the defect detection rate and size measurement repeatability. The demand for accurately and rapidly measuring the wafer surface height online is becoming increasingly urgent. The defect detection system integrates scattering, reflection, film thickness, and topography defect detection channels. The integration of laser-triangulation-based defocus measurement into the bright-field optical path is proposed. The laser beam is directed onto the surface of the wafer, and the reflected light is transmitted through a lens onto the photosensitive surface of a four-quadrant detector. This detector captures both the strength and position of the reflected signal simultaneously. In this paper, a triangulation-modified model is established to obtain the height of each inspection spot on the wafer surface through the position signal of the reflected image. When the signal-to-noise ratio of the simulated reflection image position is 20 dB, the signal-to-noise ratio of the height measurement resolved by the triangulation-modified model is 41 dB, and the measurement error is less than 0.2 μm, indicating that the model has a noise suppression effect. The spot-scanning imaging system is established, and the height measurement results of the triangulation measurement model are verified using a laser interferometer. Within the travel range of 69 μm, the system has a measurement accuracy better than ±1 μm and a measurement repeatability better than ±0.2 μm, which meet the measurement requirements of the spot-scanning imaging system. The system is utilized for defect detection and defocus measurement of the wafer surface, along with the motion mechanism, to accurately and rapidly obtain the height distribution of the wafer surface.