A projection-based electronic component edge defect detection method
By performing binarization processing on electronic components and using the minimum bounding rectangle algorithm, combined with affine transformation and projection analysis, the problem of edge defect detection under the influence of shadows was solved, achieving high-precision edge detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING ZHONGKE SAILBOAT INFORMATION TECH CO LTD
- Filing Date
- 2023-01-05
- Publication Date
- 2026-05-29
AI Technical Summary
In traditional algorithms for detecting edge defects in electronic components, the lighting effect makes it difficult to distinguish between shadows and component edges, resulting in inaccurate template matching and thus affecting the accuracy of the detection results.
By acquiring images of electronic components and performing binarization, finding the maximum connected component, using the minimum bounding rectangle algorithm to remove shadow effects, and then performing affine transformation and projection analysis to eliminate the influence of shadows on edge detection.
It enables precise detection of the edges of electronic components, improves detection accuracy, eliminates the influence of shadows on edge detection, and enhances the accuracy of detection results.
Smart Images

Figure CN116245900B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of product testing technology, and in particular to a projection-based method for detecting edge defects in electronic components. Background Technology
[0002] In the task of detecting edge defects in electronic components using machine vision, traditional algorithms use template matching to find the target in the image to be matched, perform certain image processing, then compare pixel values one by one, and finally draw a conclusion on whether it is abnormal based on the difference in comparison and a threshold.
[0003] However, in the above defect detection process, due to the influence of lighting, a shadow often appears around the component. Since electronic components are mostly dark, from a visual point of view, the shadow and the edge of the component cannot be distinguished, resulting in inaccurate template matching and inaccurate edge defect detection results for electronic components. Summary of the Invention
[0004] Therefore, it is necessary to provide a projection-based method for detecting edge defects in electronic components to address the aforementioned technical problems.
[0005] A projection-based method for detecting edge defects in electronic components includes the following steps: acquiring an image of the electronic component to be processed, and binarizing the image to obtain a binarized image; obtaining the maximum connected component in the binarized image by searching for connected components, wherein the maximum connected component contains the shadow of the electronic component; using a minimum bounding rectangle algorithm to find the minimum bounding rectangle of the maximum connected component, and obtaining the long and short sides of the minimum bounding rectangle; obtaining the vertex coordinates of the minimum bounding rectangle, and performing an affine transformation on the vertex coordinates to obtain transformed coordinates, and obtaining an affine transformation matrix based on the transformed coordinates; performing an affine transformation on all points of the maximum connected component based on the affine transformation matrix to obtain an affine transformation result; projecting the affine transformation result along the X-axis to obtain a projection result, and determining whether the edge of the electronic component is normal based on the projection result.
[0006] In one embodiment, acquiring the image of the electronic component to be processed and performing binarization processing on the image to be processed to obtain a binarized image includes: acquiring the image of the electronic component to be processed and obtaining the grayscale values of all points in the image to be processed; calculating the mean of the grayscale values based on the grayscale values of all points in the image to be processed; using the mean of the grayscale values as a threshold for binarization processing and performing binarization processing on the image to be processed to obtain a binarized image.
[0007] In one embodiment, obtaining the maximum connected component in the binarized image by finding connected components, wherein the maximum connected component includes the shadow of electronic components, includes: setting the binarized image as I... B And there are n connected components, each of the connected components CD i The area of (i = 1, 2, ..., n) is represented by the number of pixel values belonging to the connected component. Then the area S of the i-th connected component is... i Represented as:
[0008] S i =|{f(x,y)|(x,y)∈CD i}|(i=1,2,...,n)
[0009] In the formula, f(x, y) represents the value at coordinates (x, y) on the binarized image, || represents the number of elements in the set, and the maximum connected component S max Represented as:
[0010] S max =argmax i S i (i = 1, 2, ..., n)
[0011] In the formula, S max This represents the largest connected component, and the largest connected component includes the shadows of electronic components.
[0012] In one embodiment, obtaining the vertex coordinates of the minimum bounding rectangle, performing an affine transformation on the vertex coordinates to obtain transformed coordinates, and obtaining the affine transformation matrix based on the transformed coordinates includes: setting the minimum bounding rectangle Rect... max The longer side is represented as Rect long_side The shorter side is represented as Rect short_side The coordinates of the three vertices of the smallest bounding rectangle are p1, p2, and p3, where p1 and p2 represent the coordinates of the longer side Rect. long_side For the two corresponding vertices, p3 represents the connection between p and a short edge. s1 The third vertex is connected; let the transformed coordinates corresponding to the coordinates of the three vertices be p1′(0, 0), p2′(Rect) and p2′(Rect) respectively. long_side p3′(0, 0) and p3′(0,Rect) short_side If the affine transformation matrix is M, then we have:
[0013] (p′ i ,1) T =M·(p i ,1) T (i = 1, 2, 3)
[0014]
[0015] In the formula, (p i ,1) indicates that for vector p i By augmenting the equations and solving the above equations simultaneously, we can obtain the parameters of the affine transformation matrix M and thus acquire the affine transformation matrix.
[0016] In one embodiment, the step of projecting the affine transformation result through the X-axis to obtain a projection result, and determining whether the edge of the electronic component is normal based on the projection result, includes: obtaining the coordinates of a point in the affine transformation result, and projecting the point in the affine transformation result through the X-axis to obtain a projection result; when the projection result contains a line parallel to the X-axis, the edge of the electronic component is considered normal; when the projection result contains a wavy line, the edge of the electronic component is considered abnormal.
[0017] In one embodiment, after determining that the edge of the electronic component is abnormal, the method further includes: obtaining the coordinates of the corresponding projection point according to the projection result, performing a line fitting on the projection point using the least squares method to obtain line parameters, and calculating the average deviation according to the line parameters; obtaining a preset threshold, comparing the relationship between the average deviation and the preset threshold to obtain a comparison result, and determining whether the edge of the electronic component is normal according to the comparison result.
[0018] In one embodiment, the step of obtaining the coordinates of the corresponding projection points based on the projection results, performing line fitting on the projection points using the least squares method to obtain line parameters, and calculating the average deviation based on the line parameters includes: assuming that N points are projected through the X-axis, and the coordinates of the N points are (x1, y1), (x2, y2), (x3, y3)...(x... N y N Using the least squares method, a straight line is fitted based on the coordinates of the N points to obtain the straight line parameters k and b; the average deviation is calculated based on the coordinates of the N points and the straight line parameters, using the following formula:
[0019]
[0020] In one embodiment, obtaining a preset threshold, comparing the relationship between the average deviation and the preset threshold, obtaining a comparison result, and determining whether the edge of the electronic component is normal based on the comparison result includes: when the average deviation is less than the preset threshold, determining that the edge of the electronic component has defects; when the average deviation is greater than or equal to the preset threshold, determining that the edge of the electronic component is normal.
[0021] Compared with existing technologies, the advantages and beneficial effects of this invention are as follows: By acquiring an image of an electronic component to be processed and binarizing it, a binarized image is obtained. The largest connected component in the binarized image is obtained by searching for connected components. This largest connected component contains the shadow of the electronic component. A minimum bounding rectangle algorithm is used to find the minimum bounding rectangle of the largest connected component, obtaining its long and short sides. The shadow is removed using the minimum bounding rectangle, thus eliminating the influence of shadow on edge detection. The vertex coordinates of the minimum bounding rectangle are obtained, and an affine transformation is performed on these coordinates to obtain transformed coordinates. An affine transformation matrix is calculated based on the transformed coordinates and used to perform an affine transformation on all points of the largest connected component, yielding the affine transformation result. The points in the affine transformation are projected onto the X-axis to obtain the projection result. The projection result is used to determine whether the edges of the electronic component are normal, thereby eliminating the influence of shadow on edge detection, achieving accurate edge detection of electronic components, and improving edge detection accuracy. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating a projection-based method for detecting edge defects in electronic components in one embodiment.
[0023] Figure 2 This is an image of an electronic component to be processed in one embodiment;
[0024] Figure 3 for Figure 2 Binarized image;
[0025] Figure 4 for Figure 3 The largest connected component in;
[0026] Figure 5 for Figure 4 The minimum bounding rectangle of the largest connected component in the equation;
[0027] Figure 6 for Figure 5 A schematic diagram of the result after affine transformation;
[0028] Figure 7 for Figure 6 A schematic diagram of the projection results. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0030] In one embodiment, such as Figures 1 to 7As shown, a projection-based method for detecting edge defects in electronic components is provided, including the following steps:
[0031] Step S101: Obtain the image of the electronic component to be processed, and perform binarization processing on the image to be processed to obtain a binarized image.
[0032] Specifically, photographs are taken of electronic components that require edge defect detection to obtain images of the corresponding electronic components to be processed, such as... Figure 2 As shown, the image to be processed is binarized to obtain a binarized image, as shown below. Figure 3 As shown.
[0033] Step S101 includes: acquiring an image of the electronic component to be processed, and obtaining the grayscale values of all points in the image to be processed; calculating the mean of the grayscale values based on the grayscale values of all points in the image to be processed; using the mean of the grayscale values as the threshold for binarization processing, and performing binarization processing on the image to be processed to obtain a binarized image.
[0034] Specifically, when performing binarization on the image to be processed, the grayscale values of all pixels in the image to be processed are obtained, and the average grayscale value is calculated based on the grayscale values of all pixels. This average grayscale value is then used as the threshold for binarization to obtain the corresponding binarized image, thereby reducing the influence of noise in the image to be processed and improving the detection accuracy.
[0035] Step S102: Obtain the maximum connected component in the binarized image by searching for connected components. The maximum connected component includes the shadows of electronic components.
[0036] Specifically, in a binarized image, noise or shadow occlusion can cause multiple connected components to appear, and these connected components may appear around the electronic component. Therefore, a method of finding connected components can be used to obtain the connected component corresponding to the electronic component, i.e., the maximum connected component, such as... Figure 4 As shown, the maximum connected component contains the shadows of electronic components, thus enabling precise location of the components of electronic components.
[0037] Specifically, step S102 includes: setting the binarized image as I. B And there are n connected components, each connected component CD i The area of (i = 1, 2, ..., n) is represented by the number of pixel values belonging to the connected components. Then the area S of the i-th connected component is... i Represented as:
[0038] S i =|{f(x,y)|(x,y)∈CDi}|(i=1,2,...,n)
[0039] In the formula, f(x, y) represents the value at coordinates (x, y) on the binarized image, || represents the number of elements in the set, and the maximum connected component S is obtained. max Represented as:
[0040] S max =argmax i S i (i = 1, 2, ..., n)
[0041] In the formula, S max This represents the largest connected component, and the largest connected component contains the shadows of electronic components.
[0042] Specifically, the connected components of electronic components in the image to be processed are located using the above method to obtain the maximum connected component, and the maximum connected component contains the shadow of the electronic components.
[0043] Step S103: Use the minimum bounding rectangle algorithm to find the minimum bounding rectangle of the maximum connected component and obtain the long side and short side of the minimum bounding rectangle.
[0044] Specifically, since normal electronic components are regular convex polygons with clearly defined long and short sides, even if there is shading interference in the maximum connected component, the lengths of its long and short sides remain unchanged regardless of the shading. Therefore, the smallest minimum bounding rectangle (SMBR) algorithm is used to find the smallest bounding rectangle of the target feature region (i.e., the electronic component), such as... Figure 5 As shown, the gray rectangle is the smallest rectangle of the largest connected component in the figure. At the same time, the long and short sides of the smallest bounding rectangle are obtained, and the position and orientation of the electronic components are located based on the position and orientation of the rectangle, thereby eliminating the influence of shadows on the detection of defects in electronic components.
[0045] In one embodiment, the minimum bounding rectangle algorithm can employ an equally spaced rotation search method, rotating the largest connected component in the image at equal intervals within a 90° range, recording the bounding rectangle parameters of its outline in the coordinate system direction each time, and obtaining the minimum bounding rectangle by calculating the area of the bounding rectangle.
[0046] Step S104: Obtain the vertex coordinates of the smallest bounding rectangle, perform an affine transformation on the vertex coordinates to obtain the transformed coordinates, and obtain the affine transformation matrix based on the transformed coordinates.
[0047] Specifically, after obtaining the small bounding rectangle, the vertex coordinates of the smallest bounding rectangle are obtained, and an affine transformation is performed on the vertex coordinates to obtain the transformed coordinates. The corresponding affine transformation matrix is then calculated based on the transformed coordinates, which facilitates subsequent projection.
[0048] Step S104 includes: setting the minimum bounding rectangle Rect max The longer side is represented as Rect long_side The shorter side is represented as Rect short_side The coordinates of the three vertices of the smallest bounding rectangle are p1, p2, and p3, where p1 and p2 represent the coordinates of the longer side Rect. long_side For the two corresponding vertices, p3 represents the connection between p and a short edge. s1 Connect the third vertex; let the transformed coordinates corresponding to the coordinates of the three vertices be p1(0, 0), p2′(Rect) and p2′(Rect) respectively. long_side p3′(0, 0) and p3′(0,Rect) short_side If the affine transformation matrix is M, then we have:
[0049] (p′ i ,1) T =M·(p i ,1) T (i = 1, 2, 3)
[0050]
[0051] In the formula, (p i ,1) indicates that for vector p i By augmenting the equations and solving the above equations simultaneously, we can obtain the parameters of the affine transformation matrix M and thus acquire the affine transformation matrix.
[0052] Specifically, by obtaining the coordinates of the two endpoints of the longest side of the smallest bounding rectangle and the coordinates of the other vertex, and performing an affine transformation on the coordinates of the above three points, the transformed coordinates of the three points are obtained. Based on the obtained transformed coordinates, the affine transformation matrix is solved to obtain the corresponding affine transformation matrix, so that the affine transformation can be performed on all points of the largest connected component according to the solved affine transformation matrix.
[0053] Step S105: Perform an affine transformation on all points of the largest connected component according to the affine transformation matrix to obtain the affine transformation result.
[0054] Specifically, after obtaining the affine transformation matrix, an affine transformation is performed on all points in the maximally connected component based on this matrix to obtain the affine transformation result, such as... Figure 6 As shown.
[0055] Step S106: Project the affine transformation result through the X-axis to obtain the projection result, and determine whether the edges of the electronic components are normal based on the projection result.
[0056] Specifically, after the affine transformation, all points in the affine transformation are projected along the X-axis to obtain the corresponding projection results. Based on whether there are fluctuations in the projection results, a preliminary judgment can be made on whether there are defects on the edges of electronic components.
[0057] In addition, several points located on the same side of the minimum bounding rectangle can be selected from the affine transformation result, and these points can be projected through the coordinate axes. For example, when selecting points on the long side, the projection is carried out through the X-axis; when selecting points on the short side, the projection is carried out through the Y-axis to obtain the projection result, thereby enabling accurate determination of the defects on each side of the electronic component.
[0058] Step S106 includes: obtaining the coordinates of the points in the affine transformation result, and projecting the points in the affine transformation result through the X-axis to obtain the projection result; when there are lines parallel to the X-axis in the projection result, the edge of the electronic component is considered normal; when the projection result is a wavy line, the edge of the electronic component is considered abnormal.
[0059] Specifically, the coordinates of all points in the affine transformation result are obtained, and all points are projected through the X-axis to obtain the corresponding projection results. This allows for the judgment of defects on the corresponding edges. When lines parallel to the X-axis exist in the projection results, the edges of the electronic components are considered normal; when the projection results show undulating lines with large vertical fluctuations, the edges of the electronic components are considered abnormal. Figure 7 As shown, the projected lines are undulating, which can be preliminarily identified as an edge anomaly of the electronic component, requiring further precise determination.
[0060] In one embodiment, when the edge of an electronic component is abnormal, the further determination step is as follows: obtain the coordinates of the corresponding projection point according to the projection result, perform line fitting using the least squares method to obtain the line parameters, and calculate the average deviation based on the line parameters; obtain a preset threshold, compare the relationship between the average deviation and the preset threshold, obtain the comparison result, and determine whether the edge of the electronic component is normal based on the comparison result.
[0061] Specifically, since the projected lines themselves may have slight up-and-down fluctuations, rather than fluctuations caused by defects, in order to further accurately determine the edge detection results of electronic components through the projection results and obtain the coordinates of the corresponding projection points, the least squares method is used to fit a straight line based on the coordinates of the projection points to obtain the corresponding straight line parameters. The average deviation of the straight line is then calculated based on the straight line parameters. Based on the relationship between the preset threshold and the average deviation, it is determined whether the edge of the electronic component is normal, thereby improving the accuracy of the judgment results.
[0062] The calculation steps for the average deviation are as follows: Let N points be projected through the X-axis, and the coordinates of the N points be (x1, y1), (x2, y2), (x3, y3)...(x...). N y N Using the least squares method, a straight line is fitted based on the coordinates of N points to obtain the straight line parameters k and b; the average deviation is calculated based on the coordinates of N points and the straight line parameters, using the following formula:
[0063]
[0064] Specifically, by obtaining the coordinates of the projection points, the least squares method is used to fit a straight line to the projection points to obtain the fitted straight line. The straight line parameters are calculated based on the fitted straight line. Based on the straight line parameters and the coordinates of the projection points, the average deviation is calculated so as to determine whether the edges of electronic components are normal.
[0065] The specific steps for determining whether the edges of electronic components are normal based on the comparison results are as follows: when the average deviation is less than a preset threshold, the edges of the electronic components are considered to have defects; when the average deviation is greater than or equal to the preset threshold, the edges of the electronic components are considered to be normal.
[0066] Specifically, when the calculated average deviation is less than a preset threshold, the fluctuation of the projection result is considered abnormal, that is, the fluctuation is caused by edge defects, and there are defects on the edge of the electronic component; when the average deviation is greater than or equal to the preset threshold, the fluctuation of the projection result is considered normal, that is, the edge of the electronic component is normal, thereby achieving accurate detection of edge defects of electronic components, avoiding adverse effects caused by projection or other errors, and improving the accuracy of edge defect detection.
[0067] In this embodiment, an image of the electronic component to be processed is acquired and binarized to obtain a binarized image. The largest connected component in the binarized image is obtained by searching for connected components. This largest connected component contains the shadow of the electronic component. A minimum bounding rectangle algorithm is used to find the minimum bounding rectangle of the largest connected component, and the long and short sides of the minimum bounding rectangle are obtained. The shadow is removed using the minimum bounding rectangle, thus eliminating the shadow's influence on edge detection. The vertex coordinates of the minimum bounding rectangle are obtained, and an affine transformation is performed on these coordinates to obtain transformed coordinates. An affine transformation matrix is calculated based on the transformed coordinates and used to perform an affine transformation on all points of the largest connected component, yielding the affine transformation result. The points in the affine transformation are projected onto the X-axis to obtain the projection result. The projection result is used to determine whether the edges of the electronic component are normal, thereby eliminating the shadow's influence on edge detection, achieving accurate edge detection of the electronic component, and improving edge detection accuracy.
[0068] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0069] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a computer storage medium (ROM / RAM, magnetic disk, optical disk) for execution by the computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Therefore, the present invention is not limited to any particular hardware and software combination.
[0070] The above description, in conjunction with specific embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such deductions or substitutions should be considered within the scope of protection of the present invention.
Claims
1. A projection-based method for detecting edge defects in electronic components, characterized in that, include: Obtain an image of an electronic component to be processed, and perform binarization processing on the image to be processed to obtain a binarized image; The maximum connected component in the binarized image is obtained by finding the connected components, and the maximum connected component includes the shadow of the electronic components. The minimum bounding rectangle algorithm is used to find the minimum bounding rectangle of the maximum connected component, and the long side and short side of the minimum bounding rectangle are obtained. Obtain the vertex coordinates of the minimum bounding rectangle, perform an affine transformation on the vertex coordinates to obtain the transformed coordinates, and obtain the affine transformation matrix based on the transformed coordinates; Perform an affine transformation on all points of the maximum connected component according to the affine transformation matrix to obtain the affine transformation result; The affine transformation result is projected through the X-axis to obtain the projection result. Based on the projection result, it is determined whether the edge of the electronic component is normal. This includes: obtaining the coordinates of the points in the affine transformation result and projecting the points in the affine transformation result through the X-axis to obtain the projection result. When the projection result contains lines parallel to the X-axis, the edge of the electronic component is considered normal; when the projection result contains wavy lines, the edge of the electronic component is considered abnormal.
2. The projection-based method for detecting edge defects in electronic components according to claim 1, characterized in that, The process of acquiring an image of an electronic component to be processed and binarizing the image to obtain a binarized image includes: Obtain the image of the electronic component to be processed, and obtain the grayscale values of all points in the image to be processed; Calculate the mean value of the grayscale values based on the grayscale values of all points in the image to be processed; The mean grayscale value is used as the threshold for binarization to perform binarization on the image to be processed, resulting in a binarized image.
3. The projection-based method for detecting edge defects in electronic components according to claim 1, characterized in that, The method of finding the maximum connected component in the binarized image, whereby the maximum connected component includes the shadows of electronic components, includes: Let the binarized image be And there are n connected components, each of the connected components The area is represented by the number of pixel values belonging to the connected component, then the area of the i-th connected component is... Represented as: In the formula, Represents the coordinates on the binarized image The value of the position, The expression for the number of elements in a set is: [expression here, e.g., the maximum connected component]. Represented as: In the formula, This represents the largest connected component, and the largest connected component includes the shadow of the electronic component.
4. The projection-based method for detecting edge defects in electronic components according to claim 1, characterized in that, The process of obtaining the vertex coordinates of the minimum bounding rectangle, performing an affine transformation on the vertex coordinates to obtain transformed coordinates, and obtaining the affine transformation matrix based on the transformed coordinates includes: Let the minimum bounding rectangle The longer side is represented as The shorter side is represented as The coordinates of the three vertices of the minimum bounding rectangle are respectively , and ,in, and Representing the longer side The two corresponding vertices, It means through a short side and The third vertex connected; Let the transformed coordinates corresponding to the three vertex coordinates be respectively , and The affine transformation matrix is Then we have: In the formula, Represents a vector By augmenting the equations and solving the above equations simultaneously, we can obtain the parameters of the affine transformation matrix M and thus acquire the affine transformation matrix.
5. The projection-based method for detecting edge defects in electronic components according to claim 1, characterized in that, After identifying the edge abnormality of the electronic component, the process also includes: The coordinates of the corresponding projection points are obtained based on the projection results. The projection points are then fitted with a straight line using the least squares method to obtain the straight line parameters. The average deviation is then calculated based on the straight line parameters. A preset threshold is obtained, the relationship between the average deviation and the preset threshold is compared, the comparison result is obtained, and the edge of the electronic component is judged to be normal based on the comparison result.
6. The projection-based method for detecting edge defects in electronic components according to claim 5, characterized in that, The process of obtaining the coordinates of the corresponding projection point based on the projection result, performing a line fitting on the projection point using the less-squares method to obtain line parameters, and calculating the average deviation based on the line parameters includes: Let N points be projected onto the X-axis, and the coordinates of the N points be as follows: , 、 ... ; Using the least squares method, a straight line is fitted based on the coordinates of the N points to obtain the straight line parameters k and b. The average deviation is calculated based on the coordinates of the N points and the straight line parameters, using the following formula:
7. The projection-based method for detecting edge defects in electronic components according to claim 5, characterized in that, The step of obtaining a preset threshold, comparing the relationship between the average deviation and the preset threshold, obtaining a comparison result, and determining whether the edge of the electronic component is normal based on the comparison result includes: When the average deviation is less than the preset threshold, it is determined that there is a defect on the edge of the electronic component; When the average deviation is greater than or equal to the preset threshold, the edge of the electronic component is considered to be normal.