The optical device is an important part of the optical transceiver.Metal wire plays an important role in connecting elements and transmitting signals in optical devices.With the increasing market demand for optical devices,the quality requirements are becoming higher and higher.At present,the quality inspection of metal wire of optical devices in enterprises mainly relies on manual work,which is inefficient,difficult to unify the standards,and easy to be subjectively affected.In order to solve the above problem,this paper studies the technology and implementation of on-line quality detection of optical devices based on machine vision,proposes a complete solution of machine vision,and develops a new vision algorithm.Firstly,the quality detection system of Metal wire of optical device is designed,including hardware design and software design.The hardware design includes the selection of camera and lens,the design of illumination mode and the structure design of inspection platform,and the principle analysis of illumination mode.The software is designed to extract the center line of the metal wire and design the algorithm for detecting the defects of the metal wire.Then,the image fusion and the metal wire centerline extraction algorithm are designed.Image fusion uses gray-level-based image fusion rules to enhance image quality.Centerline extraction includes two stages of coarse and fine positioning.The first stage uses the idea of dichotomy search to achieve the coarse positioning of the center line.The second stage uses template-based central line positioning method to achieve the precise positioning of the center line.The precise positioning includes two positioning stages,namely rectangular template positioning and dynamic adaptive template positioning.Experiments show that the effect and efficiency of the proposed centerline extraction method can meet the project requirements.Second,according to the extracted metal wire center line and region,two-dimensional defect detection and three-dimensional defect detection algorithm are designed.In the twodimensional defect detection of metal wire,the relative parameters of the contrast of gold line area are obtained and compared with the standard threshold value to determine whether the metal wire has gray-scale defects or not,and the distance and intersection point between the metal wire centerlines are obtained to determine whether the metal wire has geometric defects or not.The three-dimensional defect detection of metal wire is to reconstruct its three-dimensional coordinates according to the center line of the left and right drawing of metal wire and calculate the three-dimensional distance between metal wires to judge whether it meets the requirements.Experiments show that the effectiveness and efficiency of the defect detection method in this paper can meet the actual needs.Finally,this paper tests the system performance using multiple samples provided by enterprises.The root mean square error of system repetitive lifting accuracy is not more than 1.1 pixels,the false alarm rate is 3%,and the false alarm rate is 0%.The algorithm can adapt to the changes of illumination and product type.The experiment shows that the algorithm has high accuracy and adaptability,which can meet the requirements of enterprises. |