The production process of metal mobile phone shell is very complex and requires multiple processes,and quality issues such as dimension exceeding limits and surface defects often occur during this process.In order to ensure the quality meets standards,effective inspection methods are necessary.Due to the large production volume,traditional manual inspection methods are no longer able to meet the demand.Therefore,this paper studies the measurement of metal phone shell dimensions and surface defect detection based on machine vision technology.The main research contents are as follows:(1)The hardware platform of the visual inspection system was built.Considering the practical application requirements and economic benefits,the selection of camera,lens,and light source was completed.In the dimension measurement study,a spherical integration light was used for camera calibration,and a backlight was used for dimension measurement.In the surface defect detection study,a spherical integration light and a backlight were used simultaneously.(2)The principle of camera calibration and the cause of image distortion were introduced,and the distortion was corrected using a calibration algorithm.The camera’s internal and external parameters obtained through calibration effectively eliminate radial distortion and tangential distortion of the image.(3)The algorithm for measuring the dimensions of metal phone shell was studied.After comparing the detection effects of several common edge detection algorithms,the Canny edge detection algorithm was finally selected for rough positioning of the phone shell edge.At the same time,a sub-pixel edge detection method based on weighted gray-scale integration median and Lagrange interpolation was proposed for accurate detection of the phone shell edge.The sub-pixel edge points solved were fitted into a line using least squares,and distance was calculated based on the obtained line equation to achieve dimension measurement.(4)The algorithm for surface defect detection of metal phone shell was studied.The guided filter method was used to suppress metal sanding texture noise while protecting the original features of defects as much as possible.To address the issue of uneven illumination and noise interference in surface images of phone shell,a defect segmentation algorithm based on area threshold and local threshold was proposed.A classification algorithm based on common defects of metal phone shell was proposed by quantifying the defect features,ultimately completing the detection of the four common surface defects of metal p hone shell.(5)Relevant experiments were conducted for the above algorithm research,verifying the feasibility,accuracy,and robustness of the dimension measurement algorithm and surface defect detection algorithm,and a visual inspection system software was designed.The experimental results show that the accuracy of the dimension measurement algorithm is within 0.03 mm,and the average time consumption is 354 ms.The accuracy of the surface defect detection algorithm reaches 95.11%,and the average time consumption is 376 ms.Both algorithms have good application value and can meet the requirements of actual production. |