Highly reflective metal products have a wide range of applications in fields such as aviation,automotive,and machinery,and their surface quality directly affects product performance and safety.Traditional manual visual inspection methods are inefficient,inaccurate,and easily influenced by human factors.Automated inspection techniques based on machine vision can overcome these drawbacks and achieve fast and accurate detection and recognition of surface defects on highly reflective metal.However,the special optical characteristics of highly reflective metal surfaces,such as mirror reflection and specular noise,pose great challenges to defect detection,while the high yield rate in the industrial field results in a small number of defect samples,making defect classification more difficult.Therefore,research on effective methods for defect detection and small sample classification of highly reflective metal surfaces is of great theoretical significance and practical value.This article focuses on the characteristics of high reflectivity and few defects and explores the following aspects:1.High reflection cancellation.To address the problem of high reflectivity,this article first analyzes and experiments with different parameters of light sources,starting from the light source,and ultimately selects a blue dome light source as the light source for this article.Since the light source is easily affected by environmental factors,supplementary research is carried out at the software algorithm level,using a multiexposure fusion algorithm to obtain the final image with reflection elimination by weighting and fusing multiple images taken with selected exposure times.2.Image preprocessing.After reflection elimination,the image is preprocessed.Firstly,experimental and comparative analysis of filtering algorithms is conducted,and Gaussian filtering is selected as the filtering algorithm for this article to reduce noise and better separate foreground and background;then,different segmentation algorithms are compared,and an adaptive threshold segmentation algorithm with better results is selected for image segmentation to increase the weight of useful information and improve the efficiency of subsequent edge detection.3.Rapid defect detection.After preprocessing,experiments and comparisons of multiple pixel-level edge detection algorithms are conducted,and the Canny operator is selected as the basic operator.Then,based on the information obtained from pixel-level edge detection,experiments and comparisons of several sub-pixel edge detection algorithms are conducted,and an interpolation-fitting-based sub-pixel edge detection algorithm is proposed for more precise edge extraction.Finally,based on grey-level cooccurrence matrix feature analysis,five feature values are determined as the basis for quick defect detection through calculation and experimentation.The defect detection process is completed by comparing feature values with threshold values.4.Small sample classification.After defect detection,based on the small sample characteristic,a relationship network model based on small sample learning is selected as the basic model,and the relationship network model is improved with reference to the idea of the meta network model.The activation function and loss function are also improved,and the defect classification task is completed by training on the miniImage Net dataset and the dataset of this article based on the relationship network and improved relationship network.This article conducted experimental verification on the dataset provided by the project party and achieved fast and accurate detection of high-reflective defects in a small sample situation,with a classification accuracy of over 92%. |