CN-121998977-A - Visual detection and grading evaluation method for product bulge defects
Abstract
The invention discloses a visual detection and grading evaluation method for a product bulge defect, which comprises the steps of collecting a product image through a multi-view angle area array camera, filtering interference through self-adaptive pretreatment based on gray scale median and median absolute deviation, analyzing and extracting a bulge abnormal region through a communication region, calculating shape weights by combining region compactness, region area and the like, merging gray scale difference indexes and shape weight generation region scoring and weighting to obtain an integral defect severity score, grading and judging according to a threshold interval, and synchronizing the result to a control system to realize automatic sorting of a production line. The invention solves the problems of low sensitivity, poor environmental adaptability and incapability of fine classification in the existing detection method, improves the detection stability and the anti-interference capability, realizes the quantification and objectification of defect evaluation, ensures that the classification result meets the actual quality requirement, has strong system universality and can adapt to the appearance detection requirements of various precise products.
Inventors
- Die Mingzhi
- LIU JIEFENG
- ZHENG ZILIANG
Assignees
- 上海帆声图像科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260409
Claims (10)
- 1. The visual detection and grading evaluation method for the product bulge defects is characterized by comprising the following steps of: a) Positioning and localized shooting are carried out on the areas where the protruding defects are easy to occur on the edges and the surfaces of the products, and product images are obtained; b) Performing self-adaptive preprocessing on the acquired image, firstly determining a region to be detected, cutting the image, regenerating a saturation mask to exclude saturated highlight pixels, extracting a low-frequency illumination component through a quick box-type mean value, calculating the weakening absolute brightness influence of a ratio residual image, then constructing a bright/dark region segmentation model based on gray scale median and median absolute deviation, determining a bright region segmentation threshold and a dark region segmentation threshold to realize bright/dark region segmentation, and filtering the low-frequency illumination component and saturated highlight interference; c) Carrying out connected region analysis on the preprocessed image, extracting potential protruding abnormal regions, calculating and analyzing gray features, texture differences and edge connectivity of each region, and judging the authenticity and boundary range of the abnormal regions; d) Establishing a morphological weight model for each identified defect region, calculating the compactness, the actual pixel area and the boundary perimeter of each region, determining the shape weight according to the region compactness, and improving the shape weight for the slender and irregular abnormal region; e) Calculating gray scale difference indexes of each abnormal region, taking the gray scale difference indexes and the obtained shape weights as inputs, generating scoring results of each region, carrying out weighted summation on the scoring results of all the regions, and carrying out normalization processing to form the overall defect severity score of the product; f) Setting a multi-level threshold interval according to the product quality requirement, and carrying out grading judgment on the product according to the obtained overall defect severity score; g) And outputting the detection result, the grading data and the image with the abnormal region mark, and synchronizing the grading judgment result to a production line control system in real time at the same time, so as to realize automatic sorting, online alarming and technological parameter linkage adjustment of the products.
- 2. The method of claim 1, wherein the determination method of the area to be detected in the step b) is that after the product area in the original image is precisely positioned, the area to be detected is initially determined through an inward corrosion operation, then an actual area to be detected is determined according to typical positions of the convex defects corresponding to the edge glue injection and the fixing piece, and the image is cut based on the area to be detected so as to improve the processing efficiency of a subsequent algorithm.
- 3. The method of claim 1, wherein the saturation mask generation formula in step b) is: Wherein I (p) is the original gray value of the pixel p, I max is the maximum value of the gray of the pixel of the image, the low-frequency illumination component is obtained by fast box-type mean value filtering, and the filtering radius r=0.1 And a calculating formula of the ratio residual image is R (x, y) =I (x, y)/(L (x, y) +epsilon), wherein I (x, y) is an original gray level image, L (x, y) is a low-frequency illumination image, and epsilon is a minimum value for avoiding zero division.
- 4. The method according to claim 1, wherein the gray scale median and the median absolute deviation in step b) are calculated by the formula m=mean { R (p) |p, respectively P},MAD=median{|R(p)-m||p P, R (P) is the ratio residual gray value of the pixel P, P is the effective pixel set, and the calculation formulas of the bright area segmentation threshold and the dark area segmentation threshold are respectively as follows: 、 K takes a value of 1 to generate a bright area initial mask And dark area initial mask R is the ratio residual image R (x, y), and the final bright/dark area is obtained by morphological processing and area filtering of the initial mask.
- 5. The method of claim 4, wherein the morphological processing of the initial mask includes removing isolated noise using an open operation, restoring region continuity using a closed operation and hole filling.
- 6. The method of claim 1, wherein the area compactness in step d) is calculated by the formula: Wherein c i is the compactness of the ith communication area, A i is the actual pixel area of the ith communication area, P i is the sum of the circumferences of all the boundaries of the ith communication area, and the calculation formula of the shape weight is as follows: Gamma is the maximum amplification amplitude and takes a value of 0.3.
- 7. The method of claim 6, wherein the gray scale difference index in step e) is calculated by the formula: Wherein, the Is the area ratio of the i-th communication area, For the area of the area to be detected, M is the number of bright areas, ω 1 is the background area duty ratio of the bright areas, ω 2 is the background area duty ratio of the dark areas, μ i is the average gray scale of the ith connected area, and μ is the average gray scale of the whole product area.
- 8. The method of claim 7, wherein calculating the overall defect severity score for the product in step e) comprises first calculating an unnormalized score Then normalized to obtain Where N is the total number of connected regions, F i is the shape weight of the ith connected region, G i is the gray scale difference index of the ith connected region, α is the scaling factor, MAD is the median absolute deviation of the image, ε=1e-6.
- 9. The method of claim 1, further comprising a human eye consistency assessment step of organizing a plurality of empirically enriched inspectors to perform blind assessment on the same batch of product samples, ranking and ordering the severity of defects, performing a correlation analysis on the overall severity score of defects output by the algorithm and a manual average score, and adaptively adjusting a classification threshold interval according to the analysis result so as to keep consistency between algorithm judgment and manual vision judgment.
- 10. The method of claim 1, wherein the output form of the detection result in the step g) comprises an abnormal region result graph with color overlay marks, a judgment index and judgment conclusion containing an overall score, a single connected region score and a shape weight, a CSV format data record and a PDF format detection report which are derived in batches, wherein the CSV format data record contains a product number, a time stamp, an algorithm version, various indexes and judgment results.
Description
Visual detection and grading evaluation method for product bulge defects Technical Field The invention relates to the technical field of digital image processing and intelligent defect identification, in particular to a surface morphology anomaly detection and grading evaluation method based on statistical distribution modeling and regional characteristic weighted analysis, which can be applied to appearance consistency detection of products such as display panel components, glass cover plates, transparent structural members, precise glue injection members, electronic assembly structural members and the like. Background In the manufacturing process of electronic products, structural members and appearance members, in order to meet the assembly strength or sealing requirements, glue injection treatment is often performed at the edge positions of the products, or structural assembly is completed through fixing members such as screws, buckles and the like. The process can improve the overall reliability of the product, and meanwhile, due to assembly stress or colloid accumulation, protruding structures with different degrees are formed in local areas, close to the edges, of the surface of the product, and the protruding defects become important factors affecting the appearance consistency and the service performance of the product. Aiming at the appearance defects, the prior art mostly adopts a machine vision detection mode, and the abnormality is judged by collecting the surface image of the product and analyzing the whole appearance or the edge profile. However, the raised defects caused by edge glue injection or fixing pieces have the characteristics of small size, concentrated distribution and irregular shape, the defect positions are strongly related to the product structure, and the conventional method for uniformly analyzing the whole image or the whole edge profile is extremely easy to be interfered by the texture change, uneven illumination or natural fluctuation of the edge of the product, so that the detection stability and accuracy are difficult to ensure. In addition, the existing detection schemes only take 'whether defects exist' as a judgment basis, and the defect types with different degrees of influence on the functions or the appearance of products cannot be distinguished due to the lack of quantitative evaluation means for the degree of protrusion. The single qualitative judgment mode is difficult to meet the requirements of quality grading control and process parameter optimization in actual production, and the problem that qualified products or potential defective products are excessively removed and flow into downstream links is easily caused. Thus, there remains room for significant improvement in the art in terms of accurate detection and hierarchical assessment of localized raised defects caused by edge bead molding and fasteners. Disclosure of Invention Aiming at the problems of insufficient sensitivity, poor environmental adaptability, dependence on artificial experience of a judging standard, difficulty in realizing fine grading and the like of the existing surface anomaly detection method, the invention aims to provide a visual detection and grading evaluation method for product bulge defects caused by edge glue injection and fixing parts, which improves the identification capability of tiny bulge anomalies and the environmental adaptability to illumination changes and material differences by constructing a gray level statistical distribution model and a self-adaptive threshold generation mechanism, realizes quantitative expression and grading judgment of bulge defect degrees by fusing multidimensional parameters such as area, gray level, morphological characteristics and the like, improves the consistency and repeatability of detection results, has clear calculation structure, is easy for system integration and can meet the requirements on detection stability and instantaneity in an automatic production environment. The technical core is that the stable detection of bright and dark areas is realized by introducing a self-adaptive segmentation algorithm of gray median and Median Absolute Deviation (MAD), and the quantitative grading evaluation of the raised defects is realized by combining a comprehensive grading model of the gray characteristics of the defects and the shape weights of the areas. The invention provides a visual detection and grading evaluation method of product bulge defects, which comprises the following steps of a) adopting a multi-view angle area array camera to drive an adjustable bracket in combination with a motor, adjusting the angle and the position of the camera according to product structural characteristics, automatically positioning and locally shooting areas with bulge defects on the edges and the surfaces of the product to obtain product image data, b) carrying out self-adaptive preprocessing on the images obtained in the step a), firstly determining