Abstract:Under complex background, it is difficult to extract the contour of automobile plate spring. Therefore, an improved Kmeans background segmentation algorithm based on sparrow search optimization is proposed, and the feature points to be measured are extracted by beam laser. Firstly, by traversing the global pixels, the optimal direction is determined according to the gradient threshold, and the step size moving to the optimal direction is reduced. So as to improve the sparrow search optimization algorithm, which can overcome the problem that the algorithm has weak global search ability and is easy to fall into the local optimal. Secondly, the pixel points of interest searched by sparrows were taken as the initial center point of Kmeans algorithm, and the pixels with similar characteristics were grouped into one group, so that the spring could be separated from the complex background environment and the contour of the spring could be obtained. Finally, ray laser is applied to the surface of the spring for auxiliary marking, and the feature points to be measured are extracted by intersecting the contour of the spring. The results show that the proposed detection method of plate spring size based on background segmentation can extract the feature points, and the accuracy can reach 025 mm, forming online measurement data, which is conducive to improving the production process.