A vision-based inductor defect detection method and system

By performing edge extraction and feature analysis on the inductive grayscale image, combining local grayscale features and color mottledness, the missing angle discrimination value is calculated, which solves the problems of contact damage and low detection efficiency of inductive surface defect detection, and improves the accuracy of missing angle detection.

CN119295424BActive Publication Date: 2025-04-11GUANGZHOU LONGHUI ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411512985.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-04-11
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

The existing inductive surface defect detection methods have problems of contact damage and low detection efficiency, and the existing machine vision methods have low accuracy in defect detection.

Method used

By obtaining the inductance grayscale image, extracting the edge profile, calculating the distance between the edge pixel points and the boundary, analyzing the edge characteristics, determining the inductance edge characterization value, obtaining the inductance edge profile, and combining the local grayscale features and color mottledness, calculating the missing angle discrimination value and performing defect detection.

Benefits of technology

It improves the ability to distinguish between the inductor edge contour and the font edge contour on the surface image, narrows the range of missing angle detection, and improves the accuracy of missing angle detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295424B_ABST
    Figure CN119295424B_ABST
Patent Text Reader

Abstract

The present application relates to the field of visual inspection technology, and specifically to a method and system for inductor defect detection based on vision, the method comprising: obtaining an inductor grayscale image, extracting all edge contours in the inductor grayscale image; determining the nearest boundary distance of each edge contour in the inductor grayscale image; determining the inductor edge characterization value of each edge contour in the inductor grayscale image; obtaining the inductor edge contour; determining the local grayscale feature value of each pixel in the inductor grayscale image; determining the color mottled degree of each pixel in the inductor grayscale image; obtaining the neighborhood area of ​​each inductor edge contour in the inductor grayscale image; determining the missing corner discrimination value of each inductor edge contour in the inductor grayscale image, and performing defect detection on the inductor surface. The present application improves the accuracy of detecting inductor defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of visual inspection technology, and specifically to a vision-based inductor defect detection method and system. Background Art

[0002] Due to the processing technology and mechanical stress, there are often some defects on the surface of the inductor. As an important part of electronic components, the surface defect detection of the inductor is very important to ensure product quality.

[0003] Traditional methods for detecting inductor surface defects include mechanical contact detection. Although this method can meet production needs in terms of quality, it usually requires direct contact with the inductor surface, which may cause secondary damage to the inductor. Secondly, the efficiency of inductor surface defect detection is low and cannot meet the needs of large-scale production. With the development of machine vision technology, the use of machine vision detection methods to analyze and process inductor surface images can achieve non-contact defect detection of products. However, due to the complex and diverse morphology of inductor surface defects, the accuracy of existing machine vision methods for inductor surface defect detection is not high. Summary of the invention

[0004] In order to solve the above technical problems, a vision-based inductor defect detection method and system are provided to solve the existing problems.

[0005] The solution to the technical problem of the present application is to provide a vision-based inductor defect detection method and system, comprising the following steps:

[0006] In a first aspect, an embodiment of the present application provides a vision-based inductor defect detection method, the method comprising the following steps:

[0007] Obtain an inductance grayscale image, and extract all edge contours in the inductance grayscale image;

[0008] Determine the nearest boundary distance of each edge contour in the inductance grayscale image according to the distance relationship between the edge pixel point of each edge contour in the inductance grayscale image and the boundary; Analyze the number of edge pixel points of each edge contour and the area size of its minimum circumscribed rectangle, and determine the inductance edge characterization value of each edge contour in the inductance grayscale image in combination with the nearest boundary distance;

[0009] Based on the inductor edge characterization value, obtaining an inductor edge contour;

[0010] Determine the local grayscale eigenvalue of each pixel in the inductance grayscale image based on the offset of the grayscale value of the pixel in the local area of ​​each pixel in the inductance grayscale image and the discreteness of the distance between different pixels in the local area; determine the color mottle degree of each pixel in the inductance grayscale image based on the local grayscale eigenvalue of the pixel in the neighborhood of each pixel in the inductance grayscale image;

[0011] According to the local area of ​​each edge pixel point of each inductor edge contour, the neighborhood area of ​​each inductor edge contour in the inductor grayscale image is obtained; according to the curvature characteristics of each edge pixel point of each inductor edge contour and the color mottled degree of the pixel points in the neighborhood area, the missing corner discrimination value of each inductor edge contour in the inductor grayscale image is determined, and defects are detected on the inductor surface.

[0012] Preferably, the determining the nearest boundary distance of each edge contour in the inductance grayscale image includes:

[0013] The outermost pixel in the inductance grayscale image is recorded as the boundary pixel;

[0014] Calculate the distance between each edge pixel point and all boundary pixel points on each edge contour in the inductance grayscale image; record the minimum value of the distance between each edge pixel point on each edge contour as the minimum distance;

[0015] The average value of the minimum distances of all edge pixels on each edge contour is used as the nearest boundary distance of each edge contour in the inductive grayscale image.

[0016] Preferably, the step of determining the inductance edge representation value of each edge contour in the inductance grayscale image includes:

[0017] Calculate the area of ​​the minimum circumscribed rectangle of each edge contour in the inductance grayscale image; count the number of all edge pixels on each edge contour in the inductance grayscale image;

[0018] The sum of the number and the area is calculated, and the ratio of the sum to the nearest boundary distance is used as the inductance edge representation value of each edge contour in the inductance grayscale image.

[0019] Preferably, the method for obtaining the inductor edge profile is:

[0020] Performing threshold segmentation on the inductance edge representation values ​​of all edge contours in the inductance grayscale image to obtain a segmentation threshold;

[0021] The edge contour whose inductance edge characterization value is greater than the segmentation threshold is recorded as the inductance edge contour.

[0022] Preferably, the determining of the local grayscale characteristic value of each pixel in the inductance grayscale image includes:

[0023] A local window of a preset size is set with each pixel in the inductance grayscale image as the center;

[0024] Calculate the mean of the grayscale values ​​of all pixels in the local window, and record it as the local mean; record the pixels in the local window whose grayscale values ​​are greater than the local mean as first-class pixels, and vice versa, record them as second-class pixels;

[0025] The discrete degree of the distance between all pixels of any type in the local window is recorded as the first discrete degree;

[0026] The discrete degree of the distance between all arbitrary two types of pixel points in the local window is recorded as the second discrete degree;

[0027] Taking the sum of the first discreteness and the second discreteness as the local discreteness of each pixel in the inductance grayscale image;

[0028] The ratio between the number of all second-category pixels and the number of all first-category pixels in the local window is calculated, and the product of the ratio and the local discreteness is used as the local grayscale feature value of each pixel in the inductance grayscale image.

[0029] Preferably, determining the color mottle degree of each pixel in the inductance grayscale image includes:

[0030] Calculate the mean of the local grayscale characteristic values ​​of all pixels in the inductance grayscale image, and record it as a first mean;

[0031] Counting the number of pixel points whose local grayscale characteristic value is greater than the first mean value in the neighborhood of each pixel point in the inductance grayscale image, and recording it as the neighborhood number;

[0032] The product of the number of neighborhoods and the local grayscale eigenvalue is used as the color mottledness of each pixel in the inductance grayscale image.

[0033] Preferably, the method for acquiring the neighborhood area of ​​each inductor edge contour in the inductor grayscale image is:

[0034] Taking each edge pixel point on each inductor edge contour as the center, set a regional window of a preset size;

[0035] The area formed by the regional window of all edge pixels on each inductor edge contour is used as the neighborhood area of ​​each inductor edge contour in the inductor grayscale image.

[0036] Preferably, the step of determining the missing corner discrimination value of each inductor edge contour in the inductor grayscale image includes:

[0037] Calculate the average value of the color mottledness of all pixels in the neighborhood area of ​​each inductor edge contour, and record it as the second average value;

[0038] The cumulative sum of the curvatures of all edge pixels on each inductor edge contour is calculated; and a normalized result of the product of the cumulative sum and the second mean value is used as a missing corner discrimination value of each inductor edge contour in the inductor grayscale image.

[0039] Preferably, the defect detection on the inductor surface includes: if there is an inductor edge contour whose missing corner discrimination value is greater than a preset threshold, there is a defect on the inductor surface; otherwise, there is no defect on the inductor surface.

[0040] In the second aspect, an embodiment of the present application also provides a vision-based inductor defect detection system, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, it implements the steps of any one of the above-mentioned vision-based inductor defect detection methods.

[0041] This application has at least the following beneficial effects:

[0042] The present application determines the nearest boundary distance of each edge contour in the inductance grayscale image according to the distance relationship between the edge pixel point of each edge contour in the inductance grayscale image and the boundary, analyzes the number of edge pixel points of each edge contour and the area size of the minimum circumscribed rectangle, determines the inductance edge characterization value of each edge contour in the inductance grayscale image in combination with the nearest boundary distance, and obtains the inductance edge contour based on the inductance edge characterization value. The beneficial effect is that the inductance edge contour is distinguished from the font edge contour on the surface image, and the detection range of the missing corner is narrowed from all edge contours to the inductance edge contour, which is conducive to the subsequent analysis of the missing corner detection of the inductance edge contour and improves the accuracy of the missing corner detection; the local grayscale feature value of each pixel in the inductance grayscale image is determined according to the offset of the grayscale value of the pixel point in the local area of ​​each pixel point in the inductance grayscale image and the discreteness of the distance between different pixel points in the local area. The beneficial effect is that the pixel points in the local window are segmented, and the distribution of each pixel point in the local window is considered to reflect the pixel point located in the missing corner. The possibility of being in the bare leakage area formed; based on the local grayscale feature value of the pixel points in the neighborhood of each pixel point in the inductor grayscale image, the color mottled degree of each pixel point in the inductor grayscale image is determined, and its beneficial effect is that the local grayscale feature value of the remaining pixel points in the neighborhood of each pixel point is considered to reflect the degree to which the remaining pixel points in the neighborhood are pixel points in the missing corner area, and further reflects the degree to which the corresponding pixel point is located in the missing corner area; according to the local area of ​​each edge pixel point of each inductor edge contour, the neighborhood area of ​​each inductor edge contour in the inductor grayscale image is obtained; according to the curvature characteristics of each edge pixel point of each inductor edge contour and the color mottled degree of the pixel points in the neighborhood area, the missing corner discrimination value of each inductor edge contour in the inductor grayscale image is determined, and the defect detection of the inductor surface is performed, and its beneficial effect is that the curvature change of the edge pixel point on the inductor edge contour and the existence of the pixel point located in the missing corner area in the local area of ​​each edge pixel point are considered, reflecting the possibility that the edge pixel point in the inductor edge contour is located in the missing corner area, thereby improving the accuracy of detecting inductor defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] A vision-based inductor defect detection method of the present application is further described in detail below in conjunction with the accompanying drawings.

[0044] Figure 1 A flowchart of a method for detecting inductor defects based on vision provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of image acquisition of inductive printing surface provided in an embodiment of the present application;

[0046] Figure 3A flowchart of the steps of a method for obtaining an inductance edge representation value of each edge contour in an inductance grayscale image provided by an embodiment of the present application;

[0047] Figure 4 A flowchart of the steps of a method for obtaining the color mottle degree of each pixel in an inductive grayscale image provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clear, the following is a further detailed description of a vision-based inductor defect detection method and system proposed in the present application in combination with the accompanying drawings and implementation examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0049] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0050] See also Figure 1 , which shows a flowchart of a method for detecting inductor defects based on vision provided by an embodiment of the present application, the method comprising the following steps:

[0051] Step 1: Obtain an inductor grayscale image and extract all edge contours in the inductor grayscale image.

[0052] The printed surface of the inductor workpiece is placed upward, and an industrial camera is placed directly above the inductor workpiece to collect an image of the printed surface of the inductor, and the collected image of the printed surface of the inductor is gray-scaled and filtered to obtain an inductor grayscale image.

[0053] Preferably, in this embodiment, a median filtering algorithm is used for filtering and noise reduction, wherein the median filtering algorithm is a well-known technology and will not be described in detail here. As other implementation methods, the implementer may adopt other methods of the prior art, such as mean filtering, etc. This embodiment does not impose any special restrictions on this.

[0054] Furthermore, the schematic diagram of inductive printing surface image acquisition provided in this embodiment is as follows: Figure 2 As shown, in order to ensure that the light source is evenly irradiated to the surface of the workpiece, 1 is an industrial camera, 2 is a light source, 3 is an inductive workpiece, and the industrial camera, light source, and inductive workpiece are on the same vertical line. Secondly, the distance range between the camera and the inductive workpiece is 100±10mm, and the distance range between the light source and the upper surface of the workpiece is 40±10mm.

[0055] The defect type of the surface image on the side of the inductor with printing is mainly missing corners. Therefore, when detecting the missing corners of the inductor grayscale image, it is necessary to obtain the edge contour of the image, specifically:

[0056] Using edge detection algorithm, edge detection is performed on the inductor grayscale image to obtain the inductor edge image;

[0057] Perform contour extraction on the inductor edge image to obtain each edge contour in the inductor edge image;

[0058] Based on the edge pixel points on each edge contour in the inductance edge image, the pixel points at the corresponding positions in the inductance grayscale image are recorded as the edge pixel points of each edge contour in the inductance grayscale image;

[0059] Preferably, in this embodiment, the Canny edge detection algorithm is used for edge detection, wherein the Canny edge detection algorithm and contour extraction are well-known technologies and are not described in detail here. As other implementation methods, the implementer can adopt other methods of the prior art, such as the Sobel operator, etc. This embodiment does not impose any special restrictions on this.

[0060] At this point, all edge contours in the inductance grayscale image are obtained.

[0061] Step 2: determine the nearest boundary distance of each edge contour in the inductance grayscale image according to the distance relationship between the edge pixel points of each edge contour in the inductance grayscale image and the boundary; analyze the number of edge pixel points of each edge contour and the area size of its minimum circumscribed rectangle, and determine the inductance edge characterization value of each edge contour in the inductance grayscale image in combination with the nearest boundary distance; and obtain the inductance edge contour based on the inductance edge characterization value.

[0062] Based on the above analysis, all edge contours in the inductor grayscale image include both inductor edge contours and font contours. When there is a missing corner on the inductor surface, the missing corner area is generally located in the edge area of ​​the inductor, and the inductor edge contour will also be deformed. Therefore, in order to detect whether the printed surface of the inductor contains a missing corner, it is necessary to first screen out the inductor edge contour from all edge contours, and then analyze the missing corner characteristics of the inductor surface.

[0063] Furthermore, the inductor edge contour is located in the edge area of ​​the inductor grayscale image, and the font contour is located in the central area of ​​the inductor grayscale image. The closer the distance between the edge pixel point on the edge contour and the outermost pixel point in the inductor grayscale image, the more likely the edge contour belongs to the inductor edge contour. Secondly, the larger the area of ​​the minimum circumscribed rectangle of the edge contour, the more likely the edge contour belongs to the inductor edge contour. When the number of edge pixel points on the edge contour is large, the contour is more likely to be the inductor edge contour. Based on the above analysis, by analyzing the distance between the edge pixel point on the edge contour and the outermost pixel point in the image, as well as the number of edge pixel points of each edge contour and the area of ​​its minimum circumscribed rectangle, the inductor edge characterization value is determined to reflect the possibility that the edge contour belongs to the inductor edge contour, specifically:

[0064] The outermost pixel in the inductance grayscale image is recorded as the boundary pixel;

[0065] Calculate the distance between each edge pixel point and all boundary pixel points on each edge contour in the inductance grayscale image; record the minimum value of the distance between each edge pixel point on each edge contour in the inductance grayscale image as the minimum distance;

[0066] Preferably, in this embodiment, the Euclidean distance between each edge pixel point and all boundary pixel points on each edge contour in the inductance grayscale image is calculated. As other implementation methods, the implementer may adopt other methods of the prior art, such as Manhattan distance, etc., and this embodiment does not impose any special restrictions on this.

[0067] Taking the average of the minimum distances of all edge pixels on each edge contour in the inductance grayscale image as the nearest boundary distance of each edge contour in the inductance grayscale image;

[0068] Calculate the area of ​​the minimum circumscribed rectangle of each edge contour in the inductor grayscale image;

[0069] Counting the number of all edge pixel points on each edge contour in the inductance grayscale image, calculating the sum of the number and the area, and taking the ratio of the sum to the nearest boundary distance as the inductance edge representation value of each edge contour in the inductance grayscale image;

[0070] Preferably, in this embodiment, the calculation method of the inductance edge representation value of each edge contour in the inductance grayscale image is: Among them, A m is the inductance edge representation value of the mth edge contour in the inductance grayscale image, S m is the area of ​​the minimum circumscribed rectangle of the mth edge contour in the inductor grayscale image, N m is the number of all edge pixels on the mth edge contour in the inductor grayscale image, d_min m is the nearest boundary distance of the mth edge contour in the inductance grayscale image, ε is a preset value greater than 0 to avoid the denominator being 0. In this embodiment, ε is taken as 0.01. As for other implementation methods, the implementer can set it according to the actual situation.

[0071] Furthermore, the flowchart of the steps of the method for obtaining the inductance edge representation value of each edge contour in the inductance grayscale image provided by the embodiment of the present application is as follows: Figure 3 shown.

[0072] It should be noted that the area S m and the number N mThe larger the value, the greater the possibility that the corresponding contour edge is the inductor edge contour. m The smaller it is, the closer the corresponding contour edge is to the boundary of the inductor grayscale image. The larger the obtained inductor edge representation value is, the more likely the corresponding contour edge is to be the inductor edge contour located in the inner edge area of ​​the image.

[0073] Further, based on the inductor edge characterization value, the inductor edge profile is determined, specifically:

[0074] Using a threshold segmentation algorithm, threshold segmentation is performed on the inductor edge representation values ​​of all edge contours in the inductor grayscale image to obtain a segmentation threshold;

[0075] Recording the edge contour whose inductance edge characterization value is greater than the segmentation threshold as an inductance edge contour;

[0076] Preferably, in this embodiment, the Otsu threshold segmentation algorithm is used for threshold segmentation, wherein the Otsu threshold segmentation algorithm is a well-known technology and will not be described in detail here.

[0077] At this point, all inductor edge contours are obtained.

[0078] Step 3: Determine the local grayscale eigenvalue of each pixel in the inductance grayscale image based on the offset of the grayscale value of the pixel in the local area of ​​each pixel in the inductance grayscale image and the discreteness of the distance between different pixels in the local area; determine the color mottledness of each pixel in the inductance grayscale image based on the local grayscale eigenvalue of the pixel in the neighborhood of each pixel in the inductance grayscale image.

[0079] Furthermore, based on the change of the gray value of each pixel in the inductance gray image, the local gray feature value is determined to reflect the possibility that the corresponding pixel is located in the exposed area caused by the missing corner, specifically:

[0080] A local window of a preset size is set with each pixel in the inductance grayscale image as the center;

[0081] Preferably, in this embodiment, a local window with a size of 9×9 is set. As other implementation modes, the implementer can set it according to the actual situation.

[0082] Calculate the mean of the grayscale values ​​of all pixels in the local window, recorded as the local mean;

[0083] The pixel points whose grayscale values ​​in the local window are greater than the local mean are recorded as type I pixel points, and the pixel points whose grayscale values ​​in the local window are less than or equal to the local mean are recorded as type II pixel points;

[0084] The discrete degree of the distance between all pixels of any type in the local window is recorded as the first discrete degree;

[0085] The discrete degree of the distance between all arbitrary two types of pixel points in the local window is recorded as the second discrete degree;

[0086] Taking the sum of the first discreteness and the second discreteness as the local discreteness of each pixel in the inductance grayscale image;

[0087] Preferably, in this embodiment, the variance of the Euclidean distance between all pixels of any one category in the local window is calculated, which is recorded as the first discreteness; the variance of the Euclidean distance between all pixels of any two categories in the local window is calculated, which is recorded as the second discreteness; as other implementation methods, the implementer may adopt other methods of the prior art, such as Manhattan distance, etc., and this embodiment does not impose any special restrictions on this; secondly, in this embodiment, the degree of discreteness is measured by variance, and as other implementation methods, the implementer may adopt other methods of the prior art to measure the degree of discreteness, such as standard deviation, coefficient of variation, etc., and this embodiment does not impose any special restrictions on this.

[0088] Calculating the ratio between the number of all second-category pixels and the number of all first-category pixels in the local window, and taking the product of the ratio and the local discreteness as the local grayscale feature value of each pixel in the inductance grayscale image;

[0089] Preferably, in this embodiment, the calculation formula of the local grayscale eigenvalue of each pixel in the inductance grayscale image is: Among them, U i is the local grayscale eigenvalue of the i-th pixel in the inductance grayscale image, is the number of all second-class pixels in the local window of the i-th pixel in the inductance grayscale image, is the number of all pixels of one type in the local window of the i-th pixel in the inductance grayscale image, is the discrete degree of the distance between all pixels of any type in the local window of the i-th pixel in the inductance grayscale image, that is, the first discrete degree, is the discrete degree of the distance between all arbitrary two-type pixel points in the local window of the i-th pixel point in the inductance grayscale image, that is, the second discrete degree, τ is a preset value greater than 0 to avoid the denominator being 0. In this embodiment, τ is 0.01. As other implementation methods, the implementer can set it according to the actual situation. Secondly, is the local dispersion.

[0090] It should be noted that The smaller the When is larger, it means that the number of pixels with larger grayscale values ​​in the local window of the ith pixel is smaller than the number of pixels with smaller grayscale values, which further indicates that the possibility that the ith pixel is located in the missing corner area is greater. and When it is larger, it means that the distribution of the first type of pixels and the second type of pixels in the local window of the i-th pixel is relatively dispersed, which means that the i-th pixel is more likely to be located in the missing corner area; the local grayscale eigenvalue U i The larger it is, the more likely it is that the i-th pixel is located in the missing corner area.

[0091] Further, based on the local grayscale feature value, the color mottle degree is determined, specifically:

[0092] Calculate the mean of the local grayscale characteristic values ​​of all pixels in the inductance grayscale image, and record it as a first mean;

[0093] Counting the number of pixel points whose local grayscale characteristic value is greater than the first mean value in the neighborhood of each pixel point in the inductance grayscale image, and recording it as the neighborhood number;

[0094] Preferably, in this embodiment, the number of pixels whose local grayscale eigenvalues ​​are greater than the first mean value in the neighborhood of each pixel point 8 in the inductance grayscale image is selected and recorded as the neighborhood number. As other implementation methods, the implementer can set it according to actual conditions.

[0095] The product of the number of neighborhoods and the local grayscale eigenvalue is used as the color mottledness of each pixel in the inductance grayscale image;

[0096] It should be noted that the larger the local grayscale eigenvalue and the larger the number of neighborhoods, the greater the possibility that the corresponding pixel is located in the missing corner area, and the greater the resulting color mottledness, the greater the possibility that the corresponding pixel is located in the missing corner area.

[0097] Furthermore, the flowchart of the method for obtaining the color mottle degree of each pixel in the inductive grayscale image provided in the embodiment of the present application is as follows: Figure 4 shown.

[0098] At this point, the color mottledness of each pixel in the inductance grayscale image is obtained.

[0099] Step 4: Obtain a neighborhood area of ​​each inductor edge contour in the inductor grayscale image based on the local area of ​​each edge pixel point of each inductor edge contour; determine the missing corner discrimination value of each inductor edge contour in the inductor grayscale image based on the curvature characteristics of each edge pixel point of each inductor edge contour and the color mottled degree of the pixel points in the neighborhood area, and perform defect detection on the inductor surface.

[0100] Furthermore, if there are edge pixels located in the missing corner area in the inductor grayscale image, the curvature at the pixel points in the missing corner area will be larger. Therefore, the average curvature of all edge pixels on the inductor edge contour in the inductor grayscale image will also be larger. Based on the above analysis, by analyzing the curvature and the color mottledness, the missing corner discrimination value is determined to reflect the possibility that the edge pixel points in the inductor edge contour are located in the missing corner area, which is specifically:

[0101] The pixel points at the corresponding positions of the edge pixel points on each inductor edge contour in the inductor grayscale image are recorded as the edge pixel points on each inductor edge contour in the inductor grayscale image;

[0102] Taking each edge pixel point on each inductor edge contour as the center, set a regional window of a preset size;

[0103] Preferably, in this embodiment, a regional window with a size of 15×15 is set. As other implementation methods, the implementer can set it according to actual conditions.

[0104] Record the area formed by the area window of all edge pixels on each inductor edge contour as the neighborhood area of ​​each inductor edge contour;

[0105] Calculate the average value of the color mottledness of all pixels in the neighborhood area of ​​each inductor edge contour, and record it as the second average value;

[0106] Calculating the curvature of each edge pixel point on each inductor edge contour, and calculating the cumulative sum of the curvatures of all edge pixel points on each inductor edge contour;

[0107] The normalized result of the product of the accumulated sum and the second mean value is used as a missing corner discrimination value of each inductor edge contour in the inductor grayscale image;

[0108] Preferably, in this embodiment, the missing corner discrimination value of each inductor edge contour in the inductor grayscale image is calculated as follows: Among them, H m is the missing corner discrimination value of the mth inductor edge contour in the inductor grayscale image, μ m is the mean value of the color mottledness of all pixels in the neighborhood area of ​​the mth inductor edge contour in the inductor grayscale image, that is, the second mean value, K m is the cumulative sum of the curvatures of all edge pixels on the mth inductor edge contour in the inductor grayscale image, and arctan() is the inverse tangent function.

[0109] It can be understood that the inverse tangent function is used for normalization in this embodiment. As other implementation methods, the implementer may adopt other methods of the prior art, such as the sigmoid function, etc. This embodiment does not impose any special restrictions on this.

[0110] It should be noted that if the second mean μ m The larger the K is, the greater the color mottledness of the pixels in the neighborhood area corresponding to the edge contour of the inductor is, which further reflects that there is a high probability that there are pixels in the missing corner area in the neighborhood area corresponding to the edge contour of the inductor. m The larger it is, the more likely it is that an edge pixel with a large curvature appears in the corresponding inductor edge contour, and the greater the possibility that the edge pixel is located in the missing corner area. The larger the obtained missing corner judgment value is, the more likely it is that the edge pixel on the corresponding inductor edge contour is a pixel in the missing corner area.

[0111] Further, based on the missing corner discrimination value, it is judged whether the edge contour of the inductor contains a missing corner, specifically:

[0112] If there is an inductor edge contour whose missing corner judgment value is greater than a preset threshold, there is a defect on the inductor surface; if the missing corner judgment values ​​of all inductor edge contours are less than or equal to the preset threshold, there is no defect on the inductor surface.

[0113] Preferably, in this embodiment, the preset threshold value is 0.9. As other implementation modes, the implementer can set it according to the actual situation.

[0114] Based on the same inventive concept as the above method, an embodiment of the present application also provides a vision-based inductor defect detection system, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the steps of any one of the above-mentioned vision-based inductor defect detection methods are implemented.

[0115] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0116] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0117] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the present application. It should be pointed out that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present application without departing from the content of the technical solution of the present application, shall fall within the protection scope of the technical solution of the present application.

Claims

1. A vision-based inductor defect detection method, characterized in that: The method comprises the following steps: Obtain an inductance grayscale image, and extract all edge contours in the inductance grayscale image; Determine the nearest boundary distance of each edge contour in the inductance grayscale image according to the distance relationship between the edge pixel point of each edge contour in the inductance grayscale image and the boundary; Analyze the number of edge pixel points of each edge contour and the area size of its minimum circumscribed rectangle, and determine the inductance edge characterization value of each edge contour in the inductance grayscale image in combination with the nearest boundary distance; Based on the inductor edge characterization value, obtaining an inductor edge contour; Determine the local grayscale eigenvalue of each pixel in the inductance grayscale image based on the offset of the grayscale value of the pixel in the local area of ​​each pixel in the inductance grayscale image and the discreteness of the distance between different pixels in the local area; determine the color mottle degree of each pixel in the inductance grayscale image based on the local grayscale eigenvalue of the pixel in the neighborhood of each pixel in the inductance grayscale image; According to the local area of ​​each edge pixel point of each inductor edge contour, the neighborhood area of ​​each inductor edge contour in the inductor grayscale image is obtained; according to the curvature characteristics of each edge pixel point of each inductor edge contour and the color mottled degree of the pixel points in the neighborhood area, the missing corner discrimination value of each inductor edge contour in the inductor grayscale image is determined, and the defect detection of the inductor surface is performed; The step of determining the local grayscale feature value of each pixel in the inductance grayscale image includes: A local window of a preset size is set with each pixel in the inductance grayscale image as the center; Calculate the mean of the grayscale values ​​of all pixels in the local window, and record it as the local mean; record the pixels in the local window whose grayscale values ​​are greater than the local mean as first-class pixels, and vice versa, record them as second-class pixels; The discrete degree of the distance between all pixels of any type in the local window is recorded as the first discrete degree; The discrete degree of the distance between all arbitrary two types of pixel points in the local window is recorded as the second discrete degree; Taking the sum of the first discreteness and the second discreteness as the local discreteness of each pixel in the inductance grayscale image; The ratio between the number of all second-category pixels and the number of all first-category pixels in the local window is calculated, and the product of the ratio and the local discreteness is used as the local grayscale feature value of each pixel in the inductance grayscale image.

2. The method for detecting inductor defects based on vision according to claim 1, characterized in that: The step of determining the nearest boundary distance of each edge contour in the inductance grayscale image comprises: The outermost pixel in the inductance grayscale image is recorded as the boundary pixel; Calculate the distance between each edge pixel point and all boundary pixel points on each edge contour in the inductance grayscale image; record the minimum value of the distance between each edge pixel point on each edge contour as the minimum distance; The average value of the minimum distances of all edge pixels on each edge contour is used as the nearest boundary distance of each edge contour in the inductive grayscale image.

3. The visual-based inductor defect detection method according to claim 1, characterized in that: The step of determining the inductance edge characterization value of each edge contour in the inductance grayscale image includes: Calculate the area of ​​the minimum circumscribed rectangle of each edge contour in the inductance grayscale image; count the number of all edge pixels on each edge contour in the inductance grayscale image; The sum of the number and the area is calculated, and the ratio of the sum to the nearest boundary distance is used as the inductance edge representation value of each edge contour in the inductance grayscale image.

4. The method for detecting inductor defects based on vision according to claim 1, characterized in that: The method for obtaining the inductor edge profile is: Performing threshold segmentation on the inductance edge representation values ​​of all edge contours in the inductance grayscale image to obtain a segmentation threshold; The edge contour whose inductance edge characterization value is greater than the segmentation threshold is recorded as the inductance edge contour.

5. The method for detecting inductor defects based on vision according to claim 1, characterized in that: Determining the color mottle degree of each pixel in the inductance grayscale image includes: Calculate the mean of the local grayscale characteristic values ​​of all pixels in the inductance grayscale image, and record it as a first mean; Counting the number of pixel points whose local grayscale characteristic value is greater than the first mean value in the neighborhood of each pixel point in the inductance grayscale image, and recording it as the neighborhood number; The product of the number of neighborhoods and the local grayscale eigenvalue is used as the color mottledness of each pixel in the inductance grayscale image.

6. The method for detecting inductor defects based on vision according to claim 1, characterized in that: The method for obtaining the neighborhood area of ​​each inductor edge contour in the inductor grayscale image is: Taking each edge pixel point on each inductor edge contour as the center, set a regional window of a preset size; The area formed by the regional window of all edge pixels on each inductor edge contour is used as the neighborhood area of ​​each inductor edge contour in the inductor grayscale image.

7. The method for detecting inductor defects based on vision according to claim 1, characterized in that: The step of determining the missing corner discrimination value of each inductor edge contour in the inductor grayscale image comprises: Calculate the average value of the color mottledness of all pixels in the neighborhood area of ​​each inductor edge contour, and record it as the second average value; The cumulative sum of the curvatures of all edge pixels on each inductor edge contour is calculated; and a normalized result of the product of the cumulative sum and the second mean value is used as a missing corner discrimination value of each inductor edge contour in the inductor grayscale image.

8. The visual-based inductor defect detection method according to claim 1, characterized in that: The defect detection on the inductor surface includes: if there is an inductor edge contour whose missing corner discrimination value is greater than a preset threshold, there is a defect on the inductor surface; otherwise, there is no defect on the inductor surface.

9. A vision-based inductor defect detection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the vision-based inductor defect detection method as described in any one of claims 1-8 are implemented.

Citation Information

Patent Citations

  • Inductor defect detection method and system based on vision

    CN115511888A

  • Magnetic glue inductor irregular appearance defect detection method based on computer vision

    CN117437219A