As the development of the measuring technology, laser displacement sensors become the most commonly used ones in the field of dimensional metrology as a result of their versatility and mature technology. However, as the differences of environment conditions and the variation of measured surfaces, the measuring errors of the laser displacement sensor may be large when used in actual application, in which the nominal accuracy of the laser sensor cannot be reached. Therefore, a precsion optimization method for the laser displacement sensor is proposed in the paper based on analysis of the principle of optical trigonometry, which can be used to reduces the measuring errors. The method is a kind of spatial filtering algorithm based on the self-adjusting domain. On the basis of the idea of spatial filtering, the method could determine the measuring errors and the optimization region according to the different measured surfaces automatically. As the experiment results show, the optimization method could be used to describe the measured object precisely and decrease the measuring error to up to 50%, which may deal with the low accuracy of the optical scanning and measuring task. With the accuracy optimization method proposed in the paper, the sensor can reach the measuring accuracy of micrometer level. Therefore, the measurement of high efficiency and high precision can be achieved.