Abstract:In this paper, aiming at the highlight phenomenon on the surface of optical device metal wire in the process of visual detection, a method for detecting and removing the highlight area of optical device metal wire image is proposed. First, according to the feature analysis of the collected metal wire image, the highlight area is segmented by the OTSU algorithm. Then, the bwareaopen function in MATLAB is called to delete small-area objects, that is, the highlight closed area, and the highlight area image is extracted through the image difference operation. Finally, the pixel value of the highlight area is updated by the method of the average value of the eight-neighborhood pixels. This method not only removes the highlight area, but also ensures the balanced distribution of the pixel value of this area in the image. Through the analysis of simulation experiment results, the effectiveness and feasibility of the method for detecting and removing the highlights of the metal wire image are verified. Meanwhile, it provides a strong guarantee for the subsequent quality inspection of the metal wire.