An edge defect detection method, device, equipment and storage medium

By smoothing the actual edge contour of the target object and generating a standard contour, the problem of high shape restriction and lighting requirements in the edge defect detection of existing technologies is solved, and fast and accurate detection of edges of arbitrary shapes is achieved.

CN116385415BActive Publication Date: 2025-12-30ZHONGKE HUIYUAN VISUAL TECHNOLOGY (LUOYANG) CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310379506.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-10
Publication Date
2025-12-30
Estimated Expiration
2043-04-10

AI Technical Summary

Technical Problem

In existing technologies, edge defect detection can only be used for straight or arc shapes, with low detection accuracy and poor stability. For edge detection of other shapes, the requirements are high and the lighting conditions are harsh.

Method used

By acquiring the actual edge contour of the target object, smoothing it, determining the candidate defect point set, generating a standard contour, and finally determining the edge defect detection result based on the target defect area, the system can achieve fast and accurate detection of edges of arbitrary shapes.

Benefits of technology

It improves the accuracy and stability of edge defect detection, reduces the requirements for image edge sharpness, and enables high-precision detection under conditions where high illumination is not required.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116385415B_ABST
    Figure CN116385415B_ABST
Patent Text Reader

Abstract

The present disclosure provides an edge defect detection method, device, equipment and storage medium, and relates to the technical field of image processing. The method mainly comprises the following steps: obtaining an actual edge contour of a target object in a to-be-detected region; performing smoothing processing on the actual edge contour to obtain a smoothed edge contour; determining a candidate defect point set on the actual edge contour according to the smoothed edge contour; generating a standard contour of the candidate defect point set according to a neighborhood point set of the candidate defect point set; determining a target defect region corresponding to the actual edge contour according to the standard contour and the candidate defect point set; and determining an edge defect detection result of the target object according to the target defect region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and in particular to a method, apparatus, device and storage medium for edge defect detection. Background Technology

[0002] Edge defect detection refers to the detection of anomalies at the edges of target objects in an image. It typically includes edge contour detection and edge grayscale detection. Edge contour detection mainly detects whether there is a difference between the edge contour and the standard contour. Edge grayscale detection mainly detects whether the grayscale of the image in the edge neighborhood is consistent with the grayscale of the standard image when the edge contour is consistent with the standard contour.

[0003] In existing technologies, edge defect detection methods mainly include straight line edge defect detection and circular arc edge defect detection. However, these methods can only be used to detect edge defects on straight lines or circular arcs, and their application scenarios are relatively fixed. For edges of other shapes, they suffer from low detection accuracy and poor stability. Moreover, these methods require high lighting conditions when acquiring images. Summary of the Invention

[0004] This disclosure provides a method, apparatus, device, and storage medium for edge defect detection, to at least solve the above-mentioned technical problems existing in the prior art.

[0005] According to a first aspect of this disclosure, an edge defect detection method is provided, the method comprising: acquiring the actual edge contour of a target object in a region to be detected; smoothing the actual edge contour to obtain a smoothed edge contour; determining a set of candidate defect points on the actual edge contour based on the smoothed edge contour; generating a standard contour of the candidate defect point set based on a set of neighboring points of the candidate defect point set; determining a target defect region corresponding to the actual edge contour based on the standard contour and the candidate defect point set; and determining an edge defect detection result of the target object based on the target defect region.

[0006] According to a second aspect of this disclosure, an edge defect detection device is provided, the device comprising: an acquisition module for acquiring the actual edge contour of a target object in a region to be detected; a smoothing module for smoothing the actual edge contour to obtain a smoothed edge contour; a first determination module for determining a set of candidate defect points on the actual edge contour based on the smoothed edge contour; a generation module for generating a standard contour of the candidate defect point set based on a set of neighboring points of the candidate defect point set; a second determination module for determining a target defect region corresponding to the actual edge contour based on the standard contour and the candidate defect point set; and a third determination module for determining the edge defect detection result of the target object based on the target defect region.

[0007] According to a third aspect of this disclosure, an electronic device is provided, comprising:

[0008] At least one processor; and

[0009] A memory communicatively connected to the at least one processor; wherein,

[0010] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the methods described in this disclosure.

[0011] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the methods described in this disclosure.

[0012] This disclosure discloses an edge defect detection method, apparatus, device, and storage medium. First, the actual edge contour of the target object is smoothed to obtain a smooth edge contour. Based on the smooth edge contour, a set of candidate defect points on the actual edge contour is determined. Then, based on the neighborhood point set of the candidate defect point set, a standard contour of the candidate defect point set is generated. Based on the standard contour and the candidate defect point set, the target defect region corresponding to the actual edge contour is determined. Finally, based on the target defect region, the edge defect detection result of the target object is determined. This enables rapid defect detection of edges of arbitrary shapes, as well as the detection of minute defects, improving the accuracy and stability of edge defect detection results. Furthermore, high-precision defect detection can be performed even when image edges are unclear, thus eliminating the need for high-level lighting conditions during image acquisition.

[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0014] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which:

[0015] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

[0016] Figure 1 A flowchart illustrating an edge defect detection method according to a first embodiment of this disclosure is shown;

[0017] Figure 2A schematic diagram of a scenario for an edge defect detection method according to a second embodiment of this disclosure is shown;

[0018] Figure 3 A schematic diagram of a scenario for an edge defect detection method according to the fourth embodiment of this disclosure is shown;

[0019] Figure 4 A flowchart illustrating an edge defect detection method according to a fifth embodiment of this disclosure is shown;

[0020] Figure 5 A schematic diagram of a first scenario of an edge defect detection method according to the sixth embodiment of this disclosure is shown;

[0021] Figure 6 A second scenario schematic diagram of an edge defect detection method according to the sixth embodiment of this disclosure is shown;

[0022] Figure 7 A schematic diagram of a first scenario of an edge defect detection method according to the seventh embodiment of this disclosure is shown;

[0023] Figure 8 A second scenario schematic diagram of an edge defect detection method according to the seventh embodiment of this disclosure is shown;

[0024] Figure 9 A schematic diagram of a first scenario of an edge defect detection method according to the eighth embodiment of this disclosure is shown;

[0025] Figure 10 A second scenario schematic diagram of an edge defect detection method according to the eighth embodiment of this disclosure is shown;

[0026] Figure 11 A schematic diagram of a scenario for an edge defect detection method according to the ninth embodiment of this disclosure is shown;

[0027] Figure 12 A schematic diagram of a scenario for an edge defect detection method according to the tenth embodiment of this disclosure is shown;

[0028] Figure 13 A schematic diagram of the structure of an edge defect detection device according to the eleventh embodiment of this disclosure is shown;

[0029] Figure 14 A schematic diagram of the composition structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0030] To make the objectives, features, and advantages of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.

[0031] Figure 1 A flowchart illustrating an edge defect detection method according to a first embodiment of this disclosure is shown, as follows: Figure 1 As shown, the method mainly includes:

[0032] Step S101: Obtain the actual edge contour of the target object in the region to be detected.

[0033] In this embodiment, the actual edge contour of the target object in the detection area is first obtained. Specifically, the detection area can be scanned, and the Sobel operator is used to select the pixels in the detection area whose gray-level gradient satisfies the first value as edge points. The actual edge contour of the target object is generated using the edge points. The first value can be set according to the actual situation.

[0034] Step S102: Smooth the actual edge contour to obtain a smooth edge contour.

[0035] In this embodiment, the actual edge contour of the target object is smoothed to obtain a smooth edge contour. This smoothing process eliminates jagged edges and sharp peaks on the actual edge contour, thus making the smooth edge contour closer to the standard contour of the target object. Specifically, interpolation methods and smoothing functions can be used to smooth the actual edge contour.

[0036] Step S103: Determine the set of candidate defect points on the actual edge contour based on the smooth edge contour.

[0037] In this embodiment, a set of candidate defect points on the actual edge contour can be determined based on the smooth edge contour. Specifically, the smooth edge contour is obtained by processing the actual edge contour. Therefore, the pixel points on the smooth edge contour correspond one-to-one with the pixel points on the actual edge contour. The distance between the pixel point on the actual edge contour and the pixel point on the smooth edge contour corresponding to its position can be calculated. If the distance is greater than a second value, the pixel point on the actual edge contour is determined as a defect point, and a set of candidate defect points is generated from the defect points. The second value can be set according to the actual situation.

[0038] Step S104: Generate the standard profile of the candidate defect point set based on the neighborhood point set of the candidate defect point set.

[0039] In this embodiment, a standard contour corresponding to the candidate defect point set is generated based on the neighborhood point set of the candidate defect point set on the actual edge contour. Specifically, the neighborhood point set is the set of points adjacent to both ends of the candidate defect point set on the actual edge contour. The standard contour of the candidate defect point set can be obtained by directly performing linear fitting based on the pixels in the two neighborhood point sets. The number of pixels in the neighborhood point set can be set according to the actual situation.

[0040] Step S105: Determine the target defect region corresponding to the actual edge contour based on the standard contour and the candidate defect point set.

[0041] In this embodiment, it is also necessary to determine the target defect region corresponding to the actual edge contour based on the standard contour and the candidate defect point set. Specifically, the pixel points on the standard contour correspond one-to-one with the pixel points in the candidate defect point set. The distance between the pixel points in the candidate defect point set and the pixel points on the standard contour corresponding to their positions can be calculated. If the distance is greater than a third value, the pixel points in the candidate defect point set are determined as target defect points. A target defect point set is generated from the target defect points, and the target defect region is formed by the target defect point set and the pixel points on the standard contour corresponding to their positions.

[0042] Step S106: Determine the edge defect detection result of the target object based on the target defect area.

[0043] In this embodiment, the edge defect detection result of the target object is finally determined based on the target defect area. Specifically, if the target defect area exists, the edge defect detection result can be determined to be that the target object has an edge defect, and the coordinates of the target defect area can be output; if the target defect area does not exist, the edge defect detection result can be determined to be that the target object does not have an edge defect.

[0044] In the first embodiment of this disclosure, a candidate defect point set is first determined based on the smooth edge contour and the actual edge contour of the target object. Then, based on the standard contour corresponding to the candidate defect point set and the candidate defect point set, the target defect region corresponding to the actual edge contour is determined. Finally, based on the target defect region, the edge defect detection result of the target object is determined. This enables rapid defect detection of edges of arbitrary shapes, as well as the detection of minute defects, improving the accuracy and stability of edge defect detection results. Furthermore, high-precision defect detection can be performed even when image edges are unclear, thus eliminating the need for high-level lighting conditions when acquiring the image.

[0045] In the second embodiment of this disclosure, the region to be detected can be obtained in the following manner:

[0046] Thresholding is performed on the region of interest in the image to be detected to obtain the segmented region of interest; the connected component area is filtered on the segmented region of interest to obtain the filtered region of interest; holes are filled in the filtered region of interest to obtain the region to be detected.

[0047] In this embodiment, the region of interest (ROI) in the image to be detected is first segmented using a threshold, resulting in a segmented ROI. The image to be detected contains the target object. The ROI can be divided into a positive ROI and a negative ROI. The positive ROI contains the approximate area requiring edge defect detection, while the negative ROI contains the area that does not require edge defect detection and is used to eliminate areas that do not require edge defect detection. Specifically, the threshold segmentation can be either fixed threshold segmentation or dynamic threshold segmentation, which can make the edges of the target object clearer.

[0048] In this embodiment, the connected component area is used to filter the segmented region of interest to obtain the filtered region of interest. Specifically, the area of ​​each connected component of the segmented region of interest can be calculated, i.e., the first area, and connected components whose first area does not meet the first preset threshold are removed to obtain the filtered region of interest. This can remove interference areas that are not target objects. The first preset threshold can be set according to the actual situation.

[0049] In this embodiment, the filtered region of interest also needs to be filled with holes to obtain the region to be detected. Specifically, a flood fill algorithm can be used for hole filling. This prevents the formation of holes due to pixel fluctuations in the region to be detected caused by instability of the image to be detected.

[0050] In one possible implementation, before performing thresholding segmentation on the region of interest in the image to be detected, a reference coordinate system can be constructed based on the image to be detected. The reference coordinate system can consist of a point and an angled straight line. Figure 2 A schematic diagram of a scenario for an edge defect detection method according to a second embodiment of this disclosure is shown, such as... Figure 2As shown, if the target object is a mobile phone cover (first cover), then straight lines are fitted using the upper and left boundaries of the cover. Specifically, the Sobel operator can be used to obtain the first edge point on the upper boundary and the second edge point on the left boundary. Linear fitting is then performed using the first edge point to obtain the upper boundary line a, and linear fitting is performed using the second edge point to obtain the left boundary line b. The intersection point A of the upper boundary line a and the left boundary line b can be determined as the origin of the reference coordinate system. A reference coordinate system is constructed using the intersection point A, the upper boundary line a, or the left boundary line b. In practical applications, if the reference coordinate system consists of the intersection point A and the upper boundary line a, then when performing edge defect detection on the next mobile phone cover of the same model (second cover), its intersection point A1 and the upper boundary line a1 are obtained in the same way. By comparing the intersection point A1 and the upper boundary line a1 with the reference coordinate system, the offset and rotation angle between the two mobile phone covers can be calculated. Based on the offset and rotation angle, the region of interest of the first cover can be moved accordingly to obtain the region of interest of the second cover. It should be emphasized that the method of constructing the reference coordinate system may vary depending on the image to be detected and the target object, and this disclosure does not limit it.

[0051] In the third embodiment of this disclosure, step S101 mainly includes:

[0052] Contour transformation is performed on the region to be detected to obtain the initial edge contour of the target object; if the number of pixels in the initial edge contour is greater than the second preset threshold, the initial edge contour is determined as the actual edge contour.

[0053] In this embodiment, the contour transformation function in the visual library can be used to convert the region to be detected into the initial edge contour of the target object, realizing the conversion from region to contour. If the number of pixels in the initial edge contour is greater than a second preset threshold, the initial edge contour is determined as the actual edge contour. Specifically, in addition to the target object, other regions may also generate contours in the region to be detected. The contours of other regions are interference contours. Interference contours are relatively small and have fewer pixels. Therefore, if the number of pixels in the initial edge contour is not greater than the second preset threshold, they are discarded, thereby indirectly improving the efficiency and accuracy of edge defect detection. The second preset threshold can be set according to the actual situation.

[0054] In the fourth embodiment of this disclosure, step S102 mainly includes:

[0055] Based on the number of smoothed samples, the neighborhood of the actual pixel on the actual edge contour is sampled to obtain a set of sampled points; the set of sampled points is fitted using the least squares method to obtain a fitting result; based on the fitting result, the actual edge contour is smoothed to obtain a smoothed edge contour.

[0056] In this embodiment, smoothing is achieved by projecting the actual pixels on the actual edge contour onto a local regression line, where the local regression line is fitted based on the pixels on both sides of the actual pixel. Specifically, the neighborhood of the actual pixel on the actual edge contour is sampled according to the number of smoothing samples to obtain a sample point set. The sample point set is then fitted using the least squares method to obtain a fitting result. The actual pixel is then projected onto its corresponding fitting result to obtain smoothed pixels. A smooth edge contour is generated based on the smoothed pixels. The number of smoothing samples can be set according to the actual situation.

[0057] Figure 3 A schematic diagram of a scenario for an edge defect detection method according to the fourth embodiment of this disclosure is shown, as follows: Figure 3 As shown, curve c is a segment of the actual edge contour. For the actual pixel B on curve c, sampling is performed on the neighborhoods on both sides of the actual pixel B along the actual edge contour according to the number of smoothing samples, resulting in a sampling point set (C, C1). That is, all pixels between points C and C1 on the actual edge contour belong to the sampling point set, and the number of pixels in the sampling point set is the number of smoothing samples. Then, least squares fitting is performed on the pixels in the sampling point set (C, C1) to obtain the fitting result line d corresponding to the actual pixel B. The actual pixel B is then projected onto line d to obtain the smoothed pixel B1 corresponding to the actual pixel B. The same method is used to obtain the smoothed pixels corresponding to all actual pixels on curve c. All the smoothed pixels can then generate the smoothed edge contour e. Specifically, the number of smoothing samples can affect the smoothing effect. For example, if the number of smoothing samples is smaller, the distance between the smoothed pixel B1 and the actual pixel B is smaller; if the number of smoothing samples is larger, the distance between the smoothed pixel B1 and the actual pixel B is larger.

[0058] In the fourth embodiment of this disclosure, smoothing is achieved by projecting the actual pixels on the actual edge contour onto the local regression line, which can better eliminate jagged edges and peaks on the actual edge contour, making the smoothed edge contour closer to the standard contour of the target object.

[0059] Figure 4 A flowchart illustrating an edge defect detection method according to a fifth embodiment of this disclosure is shown, as follows: Figure 4 As shown, step S103 mainly includes:

[0060] Step S201: Obtain the first overall coordinate value of the actual pixel point on the actual edge contour and the second overall coordinate value of the smooth pixel point on the smooth edge contour.

[0061] In this embodiment, the actual pixels on the actual edge contour can be numbered sequentially along a preset direction, and the coordinate values ​​of the actual pixels can be obtained sequentially according to the number to obtain the first overall coordinate value of the actual pixels on the actual edge contour. Then, the coordinate values ​​of the smooth pixels corresponding to the actual pixels can be obtained sequentially according to the number to obtain the second overall coordinate value of the smooth pixels on the smooth edge contour.

[0062] In one possible implementation, the first global coordinate value can be expressed as:

[0063]

[0064] Wherein, `boudnaryCRows` represents the first global row coordinates of the actual pixels on the actual edge contour, and `boudnaryCColumns` represents the first global column coordinates of the actual pixels on the actual edge contour. (bR1, bC1) is the coordinate value of the actual pixel numbered 1, (bR2, bC2) is the coordinate value of the actual pixel numbered 2, and so on. For a closed actual edge contour, the point numbered 1 (i.e., the starting point) and its ending point are the same point, that is, (bR1, bC1) and (bRn, bCn) should be the same.

[0065] The second global coordinate value can be expressed as:

[0066]

[0067] Where smoothCRows represents the second global row coordinates of the smooth pixels on the smooth edge contour, and smoothCColumns represents the second global column coordinates of the smooth pixels on the smooth edge contour. (sR1, sC1) is the smooth pixel corresponding to the actual pixel numbered 1, (sR2, sC2) is the smooth pixel corresponding to the actual pixel numbered 2, and so on. For a closed actual edge contour, the smooth pixel corresponding to the point numbered 1 (i.e., the starting point) and the smooth pixel corresponding to the ending point are the same point, that is, (sR1, sC1) and (sRn, sCn) should be the same.

[0068] Step S202: Calculate the first distance between the actual pixel and the smooth pixel corresponding to its position based on the first overall coordinate value and the second overall coordinate value.

[0069] Step S203: Determine the set of candidate defect points on the actual edge contour based on the first distance.

[0070] In this embodiment, based on the first overall coordinate value and the second overall coordinate value, the first distance between the actual pixel and the smooth pixel corresponding to its position is calculated, that is, the distance between (bR1, bC1) and (sR1, sC1), the distance between (bR2, bC2) and (sR2, sC2) in Formula 1 and Formula 2 are calculated, and so on. Based on the first distance, the set of candidate defect points on the actual edge contour is determined.

[0071] In the sixth embodiment of this disclosure, step S201 mainly includes:

[0072] A first starting point is obtained on the actual edge contour, and based on the first starting point, the coordinate values ​​of all actual pixels on the actual edge contour are obtained sequentially along a first preset direction to obtain a first overall coordinate value; a second starting point is obtained on the smooth edge contour, and based on the second starting point, the coordinate values ​​of all smooth pixels on the smooth edge contour are obtained sequentially along a first preset direction to obtain a second overall coordinate value; wherein, the first starting point is the actual pixel with the largest column coordinate among all actual pixels corresponding to the smallest row coordinate, and the second starting point is the smooth pixel corresponding to the position of the first starting point.

[0073] In this embodiment, the actual pixel with the largest column coordinate among all actual pixels corresponding to the smallest row coordinate in the actual edge contour is taken as the first starting point. The first starting point can be numbered 1, and the next actual pixel along the first preset direction can be numbered 2, and so on. Starting from the first starting point, the coordinates of all actual pixels on the actual edge contour are obtained sequentially along the first preset direction to obtain the first overall coordinate value. The smooth pixel corresponding to the position of the first starting point is determined as the second starting point on the smooth edge contour. Starting from the second starting point, the coordinates of all smooth pixels on the smooth edge contour are obtained sequentially along the first preset direction to obtain the first overall coordinate value. The first preset direction can be set according to the actual situation, and it can be a clockwise direction or a counterclockwise direction, etc.

[0074] Figure 5 This diagram illustrates a first scenario of an edge defect detection method according to the sixth embodiment of this disclosure. Figure 6 A second scenario schematic diagram of an edge defect detection method according to the sixth embodiment of this disclosure is shown, as follows: Figure 5 and Figure 6 As shown, Figure 5 The actual edge contour of the region within the circle f is Figure 6 Curve g in the curve can be used to determine that the actual pixel with the largest column coordinate among all actual pixels corresponding to the smallest row coordinate in the actual edge contour is point D. That is, point D is the first starting point. Then, starting from point D, the pixels are obtained sequentially in a clockwise direction. Figure 5The coordinates of all actual pixels on the actual edge contour of the phone cover are used to obtain the first overall coordinate value. This can be understood as the first and last coordinates corresponding to point D. The smooth edge contour corresponding to curve g is curve h, and the smooth pixel point corresponding to point D is point E. Therefore, point E is the second starting point. Starting from point E, the coordinates are obtained sequentially in a clockwise direction. Figure 5 The coordinates of all smooth pixels on the smooth edge contour of the phone cover are used to obtain the second overall coordinate value. It can be understood that the first and last coordinates corresponding to the second overall coordinate value are the coordinates of point E.

[0075] In one possible implementation, such as Figure 5 The first global coordinates of the actual pixels on the actual edge contour of the phone cover shown can be:

[0076]

[0077] like Figure 5 The second global coordinate values ​​of the smoothed pixel points on the smooth edge contour of the phone cover shown can be:

[0078]

[0079] In the seventh embodiment of this disclosure, step S203 mainly includes:

[0080] If the first distance is greater than the first defect determination distance, the actual pixel point corresponding to the first distance is determined as the defect point on the actual edge contour; the defect points with adjacent numbers are determined as the first candidate point set; the first candidate point set is adjusted according to the start point number and end point number of the first candidate point set to obtain the candidate defect point set.

[0081] In this embodiment, when determining the candidate defect point set on the actual edge contour based on the first distance between the actual pixel and the smooth pixel corresponding to its position, if the first distance is greater than the first defect determination distance, the actual pixel corresponding to the first distance is determined as a defect point on the actual edge contour. For example, if the first distance between the actual pixel numbered 1 and its corresponding smooth pixel is greater than the first defect determination distance, the actual pixel numbered 1 is determined as a defect point, and the defect points with adjacent numbers are determined as the first candidate point set. Then, the first candidate point set is adjusted according to the start point number and end point number of the first candidate point set to obtain the candidate defect point set. The first defect determination distance can be set by the user according to the actual situation.

[0082] In one implementation, when adjusting the first candidate point set, the number of defect points in the first candidate point set can be determined first based on the start point number and end point number of the first candidate point set. Then, the first candidate point set is adjusted according to the number of defect points to obtain a candidate defect point set. Specifically, if the number of defect points in the first candidate point set is greater than a third preset threshold, the first candidate point set is expanded according to an expansion threshold to obtain a second candidate point set. The second candidate point set is then merged to obtain a candidate defect point set. The third preset threshold and the expansion threshold can be set according to actual conditions. Preferably, the third preset threshold can be 2, meaning that before adjusting the first candidate defect point set, first candidate point sets with no more than 2 defect points are removed.

[0083] In one possible implementation, if the first candidate point set is:

[0084]

[0085] Where, abnormal_start_index1[] represents the starting point number of the first candidate point set, and abnormal_end_index1[] represents the ending point number of the first candidate point set. That is, the actual pixels numbered 1 to 25 form a first candidate point set, the actual pixels numbered 49 to 110 form a first candidate point set, and so on. And the expansion threshold is 10, so each first candidate point set is expanded by 10 pixels to obtain the second candidate point set. That is, the second candidate point set is:

[0086]

[0087] This is equivalent to expanding the first candidate point set by 10 pixels at each end, thus connecting discontinuous points, such as... Figure 7 and Figure 8 As shown, Figure 7 There are discontinuous points in the first candidate point set. Figure 8 After expanding the first candidate point set and connecting discontinuous points, the second candidate point set is finally merged to obtain the candidate defect point set, which is as follows:

[0088]

[0089] As shown in Formula 6, the second candidate point set numbered 3989 to 4017 has overlapping points with the second candidate point set numbered 4000 to 4054. These two second candidate point sets can be merged to obtain the candidate defect point set as shown in Formula 7.

[0090] In the fifth, sixth, and seventh embodiments of this disclosure, if the first distance between an actual pixel and the smooth pixel corresponding to its position is greater than the first defect determination distance, the actual pixel is determined as a defect point, and adjacent defect points are determined as a first candidate point set. Based on the number of defect points in the first candidate point set, the first candidate point set is adjusted to obtain a candidate defect point set. This results in a more accurate candidate defect point set, further ensuring the accuracy of the edge defect detection results.

[0091] In the eighth embodiment of this disclosure, step S104 mainly includes:

[0092] Based on the preset number of neighborhood points, obtain the neighborhood point sets at both ends of the candidate defect point set on the actual edge contour; perform spline interpolation on the neighborhood point sets to obtain the standard contour of the candidate defect point set.

[0093] In this embodiment, firstly, based on the preset number of neighboring points, the neighboring point sets at both ends of the candidate defect point set on the actual edge contour are obtained. Then, spline interpolation is performed on the neighboring point sets to obtain the standard contour of the candidate defect point set. The preset number of neighboring points can be set according to the actual situation. Preferably, the preset number of neighboring points can be 50, that is, 50 actual pixels are sampled in each of the two neighboring point sets.

[0094] Figure 9 This diagram illustrates a first scenario of an edge defect detection method according to the eighth embodiment of this disclosure. Figure 10 A second scenario diagram of an edge defect detection method according to the eighth embodiment of this disclosure is shown, as follows: Figure 9 As shown, curve i is a segment of the actual edge contour, and there exists a set of candidate defect points on curve i; as Figure 10 As shown, if the preset number of neighboring points is 50, then in Figure 9 Fifty actual pixels are selected at each end of the candidate defect point set on the actual edge contour as a neighborhood point set. Then, spline difference is performed on the two neighborhood point sets to obtain the standard contour corresponding to the candidate defect point set, i.e., curve j.

[0095] In the eighth embodiment of this disclosure, a standard profile is obtained by performing spline difference on the neighborhood point sets at both ends of the candidate defect point set. This standard profile is the local standard profile corresponding to the area with defects on the actual edge profile. Therefore, this standard profile is closer to the local real edge of the corresponding target object.

[0096] In the ninth embodiment of this disclosure, step S105 mainly includes:

[0097] Calculate the second distance between the defect points in the candidate defect region and the standard contour; if the second distance is greater than the second defect determination distance, determine the target defect point set based on the defect points corresponding to the second distance; and determine the target defect region corresponding to the actual edge contour based on the target defect point set.

[0098] In this embodiment, after obtaining the standard contour, the second distance between the defect point in the candidate defect area and the standard contour is first calculated. That is, the distance between the defect point in the candidate defect area and the pixel point on the standard contour corresponding to its position is calculated. If the second distance is greater than the second defect determination distance, the defect point is determined as the target defect point, and the target defect point set is formed by the adjacent target defect points. Finally, the target defect area corresponding to the actual edge contour can be determined according to the target defect point set. The second defect determination distance can be set by the user according to the actual situation. Figure 11 This illustration shows a scenario diagram of an edge defect detection method according to the ninth embodiment of this disclosure. A target defect region on a target object can be detected as follows: Figure 11 As shown in the image.

[0099] In one possible implementation, when determining the target defect region corresponding to the actual edge contour, firstly, based on the target defect point set and the standard contour, the first defect region corresponding to the actual edge contour is determined, that is, the region between the target defect point set and its corresponding standard contour is taken as the first defect region. Then, based on the second area of ​​the first defect region, the first defect region is adjusted to obtain the target defect region.

[0100] In one possible implementation, when adjusting the first defect region, firstly, the second area of ​​the first defect region is obtained, and first defect regions with second areas greater than the minimum fusion area are selected to obtain second defect regions, i.e., first defect regions with second areas not greater than the minimum fusion area are eliminated; then, the second defect regions are fused according to the defect clustering distance to obtain the target defect region, i.e., if the distance between multiple second defect regions is less than the defect clustering distance, the multiple second defect regions are fused into one target defect region. The minimum fusion area and the defect clustering distance can be set according to the actual situation. Specifically, the number of pixels within the first defect region can be used as its second area.

[0101] In the ninth embodiment of this disclosure, a first defect region is generated from a standard contour and a set of candidate defect points. The first defect region is then screened and fused to finally obtain the target defect region. This can result in a more accurate target defect region, thereby improving the accuracy of edge defect detection results.

[0102] In the tenth embodiment of this disclosure, step S106 mainly includes:

[0103] Obtain the grayscale value of the target defect area; determine the defect type of the target defect area based on the defect classification threshold and the grayscale value.

[0104] In this embodiment, after determining the target defect region, it is necessary to classify the target defect region. Specifically, the grayscale value of the target defect region can be obtained first, and then the defect type of the target defect region can be determined according to the defect classification threshold and the grayscale value. The grayscale value can be the center point of the target defect region, or the average grayscale value of all pixels within the target defect region can be used as the grayscale value of the target defect region.

[0105] In one possible implementation, when determining the defect type of a target defect area based on a defect classification threshold and a grayscale value, if the grayscale value meets the defect classification threshold, the defect type of the target defect area is determined to be a bud defect; if the grayscale value does not meet the defect classification threshold, the defect type of the target defect area is determined to be a sprout. The defect classification threshold can be set according to the actual situation.

[0106] Figure 12 A schematic diagram of a scenario for an edge defect detection method according to the tenth embodiment of this disclosure is shown, as follows: Figure 12 As shown, if the grayscale of the foreground part (i.e., the target object) of the area to be detected is 0, the grayscale of the background part (the part other than the target object) is 255, and the defect classification threshold is 128 to 255, then if the grayscale value of the target defect area is greater than 128, the target defect area is the background, and the defect type of the target defect area can be determined as bud loss or edge collapse; if the grayscale value of the target defect area does not meet the requirement of 128 to 255, the target defect area is the foreground, and the defect type of the target defect area can be determined as bud growth.

[0107] In the tenth embodiment of this disclosure, the target defect region is classified according to the gray value of the target defect region, which can yield more accurate and specific edge defect detection results.

[0108] Figure 13 A schematic diagram of the structure of an edge defect detection device according to the eleventh embodiment of this disclosure is shown, as follows: Figure 13 As shown, the device mainly includes:

[0109] The acquisition module 10 is used to acquire the actual edge contour of the target object in the area to be detected; the smoothing module 11 is used to smooth the actual edge contour to obtain a smooth edge contour; the first determination module 12 is used to determine the candidate defect point set on the actual edge contour based on the smooth edge contour; the generation module 13 is used to generate the standard contour of the candidate defect point set based on the neighborhood point set of the candidate defect point set; the second determination module 14 is used to determine the target defect region corresponding to the actual edge contour based on the standard contour and the candidate defect point set; and the third determination module 15 is used to determine the edge defect detection result of the target object based on the target defect region.

[0110] In one embodiment, the device further includes: a segmentation module for thresholding the region of interest in the image to be detected to obtain a segmented region of interest; an area filtering module for filtering the connected component area of ​​the segmented region of interest to obtain a filtered region of interest; and a filling module for filling holes in the filtered region of interest to obtain a region to be detected.

[0111] In one embodiment, the area filtering module is further configured to: calculate the first area of ​​the connected components of the segmented region of interest; and remove connected components whose first area does not meet a first preset threshold to obtain the filtered region of interest.

[0112] In one embodiment, the acquisition module 10 is further configured to: perform contour transformation on the region to be detected to obtain the initial edge contour of the target object; if the number of pixels of the initial edge contour is greater than a second preset threshold, then the initial edge contour is determined as the actual edge contour.

[0113] In one embodiment, the smoothing module 11 includes: a sampling submodule, used to sample the neighborhood of the actual pixel points on the actual edge contour according to the number of smoothing samples, to obtain a sampling point set; a fitting submodule, used to fit the sampling point set according to the least squares method, to obtain a fitting result; and a smoothing processing submodule, used to smooth the actual edge contour according to the fitting result, to obtain a smooth edge contour.

[0114] In one embodiment, the smoothing submodule is further configured to: project the actual pixel points onto their corresponding fitting results to obtain smoothed pixel points; and generate smooth edge contours based on the smoothed pixel points.

[0115] In one embodiment, the first determining module 12 includes: an acquisition submodule, used to acquire a first overall coordinate value of an actual pixel point on an actual edge contour and a second overall coordinate value of a smooth pixel point on a smooth edge contour; a calculation submodule, used to calculate a first distance between an actual pixel point and a smooth pixel point corresponding to its position based on the first overall coordinate value and the second overall coordinate value; and a determining submodule, used to determine a set of candidate defect points on the actual edge contour based on the first distance.

[0116] In one embodiment, the acquisition submodule is further configured to: acquire a first starting point on the actual edge contour, and based on the first starting point, sequentially acquire the coordinate values ​​of all actual pixels on the actual edge contour along a first preset direction to obtain a first overall coordinate value; acquire a second starting point on the smooth edge contour, and based on the second starting point, sequentially acquire the coordinate values ​​of all smooth pixels on the smooth edge contour along the first preset direction to obtain a second overall coordinate value; wherein, the first starting point is the actual pixel with the largest column coordinate among all actual pixels corresponding to the smallest row coordinate, and the second starting point is the smooth pixel corresponding to the position of the first starting point.

[0117] In one embodiment, the determining submodule is further configured to: determine the actual pixel point corresponding to the first distance as the defect point on the actual edge contour when the first distance is greater than the first defect determination distance; determine the defect points with adjacent numbers as the first candidate point set; and adjust the first candidate point set according to the start point number and end point number of the first candidate point set to obtain the candidate defect point set.

[0118] In one embodiment, the determining submodule is further configured to: determine the number of defect points in the first candidate point set based on the start point number and end point number of the first candidate point set; and adjust the first candidate point set according to the number of defect points to obtain a candidate defect point set.

[0119] In one embodiment, the determining submodule is further configured to: expand the first candidate point set whose number of defect points is greater than a third preset threshold according to the expansion threshold to obtain a second candidate point set; and merge the second candidate point set to obtain a candidate defect point set.

[0120] In one embodiment, the generation module 13 includes: a neighborhood point set acquisition submodule, used to acquire the neighborhood point sets at both ends of the candidate defect point set on the actual edge contour according to a preset number of neighborhood points; and an interpolation submodule, used to perform spline interpolation on the neighborhood point set to obtain the standard contour of the candidate defect point set.

[0121] In one embodiment, the second determining module 14 includes: a second calculation submodule, used to calculate a second distance between a defect point in the candidate defect region and a standard contour; and a second determining submodule, used to determine a target defect point set based on the defect point corresponding to the second distance when the second distance is greater than the second defect determination distance, and to determine a target defect region corresponding to the actual edge contour based on the target defect point set.

[0122] In one embodiment, the second determining submodule is further configured to: determine the first defect region corresponding to the actual edge contour based on the target defect point set and the standard contour; and adjust the first defect region based on the second area of ​​the first defect region to obtain the target defect region.

[0123] In one embodiment, the second determining submodule is further configured to: filter a first defect region whose second area is greater than the minimum fusion area to obtain a second defect region; and fuse the second defect region according to the defect clustering distance to obtain a target defect region.

[0124] In one embodiment, the third determining module 15 includes: a grayscale value acquisition submodule, used to acquire the grayscale value of the center point of the target defect area; and a defect type determining submodule, used to determine the defect type of the target defect area based on the defect classification threshold and the grayscale value of the center point.

[0125] In one embodiment, the defect type determination submodule is further configured to: if the gray value of the center point is greater than the defect classification threshold, then determine the defect type of the target defect area as a bud defect; if the gray value of the center point is less than the defect classification threshold, then determine the defect type of the target defect area as a bud growth.

[0126] According to embodiments of this disclosure, this disclosure also provides an electronic device and a readable storage medium.

[0127] Figure 14 A schematic block diagram of an example electronic device 1400 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0128] like Figure 14As shown, device 1400 includes a computing unit 1401, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1402 or a computer program loaded from storage unit 1408 into random access memory (RAM) 1403. The RAM 1403 may also store various programs and data required for the operation of device 1400. The computing unit 1401, ROM 1402, and RAM 1403 are interconnected via bus 1404. Input / output (I / O) interface 1405 is also connected to bus 1404.

[0129] Multiple components in device 1400 are connected to I / O interface 1405, including: input unit 1406, such as a keyboard, mouse, etc.; output unit 1407, such as various types of displays, speakers, etc.; storage unit 1408, such as a disk, optical disk, etc.; and communication unit 1409, such as a network card, modem, wireless transceiver, etc. Communication unit 1409 allows device 1400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0130] The computing unit 1401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1401 performs the various methods and processes described above, such as an edge defect detection method. For example, in some embodiments, an edge defect detection method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1408. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1400 via ROM 1402 and / or communication unit 1409. When the computer program is loaded into RAM 1403 and executed by the computing unit 1401, one or more steps of an edge defect detection method described above may be performed. Alternatively, in other embodiments, the computing unit 1401 may be configured to perform an edge defect detection method by any other suitable means (e.g., by means of firmware).

[0131] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0132] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0133] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0134] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0135] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0136] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0137] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0138] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise explicitly specified.

[0139] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.

Claims

1. An edge defect detection method characterized by, The method comprises: acquiring an actual edge contour of a target object in a to-be-detected region; performing smoothing processing on the actual edge contour to obtain a smoothed edge contour; determining a candidate defect point set on the actual edge contour according to the smoothed edge contour; generating a standard contour of the candidate defect point set according to a neighborhood point set of the candidate defect point set; determining a target defect region corresponding to the actual edge contour according to the standard contour and the candidate defect point set; determining an edge defect detection result of the target object according to the target defect region; wherein the determining of the candidate defect point set on the actual edge contour according to the smoothed edge contour comprises: acquiring a first overall coordinate value of an actual pixel point on the actual edge contour and a second overall coordinate value of a smoothed pixel point on the smoothed edge contour; calculating a first distance between the actual pixel point and the smoothed pixel point corresponding to the position of the actual pixel point according to the first overall coordinate value and the second overall coordinate value; determining the candidate defect point set on the actual edge contour according to the first distance; wherein the acquiring of the first overall coordinate value of the actual pixel point on the actual edge contour and the second overall coordinate value of the smoothed pixel point on the smoothed edge contour comprises: acquiring a first starting point on the actual edge contour, and acquiring coordinate values of all actual pixel points on the actual edge contour in a first preset direction according to the first starting point to obtain the first overall coordinate value; acquiring a second starting point on the smoothed edge contour, and acquiring coordinate values of all smoothed pixel points on the smoothed edge contour in the first preset direction according to the second starting point to obtain the second overall coordinate value; wherein the first starting point is an actual pixel point with the maximum column coordinate among all actual pixel points corresponding to the minimum row coordinate, and the second starting point is a smoothed pixel point corresponding to the position of the first starting point; wherein the generating of the standard contour of the candidate defect point set according to the neighborhood point set of the candidate defect point set comprises: acquiring a neighborhood point set at two ends of the candidate defect point set on the actual edge contour according to a preset number of neighborhood points; performing spline interpolation on the neighborhood point set to obtain the standard contour of the candidate defect point set.

2. The method of claim 1, wherein, The to-be-detected region is acquired in the following manner: performing threshold segmentation on a region of interest in a to-be-detected image to obtain a segmented region of interest; performing connected domain area screening on the segmented region of interest to obtain a screened region of interest; performing hole filling on the screened region of interest to obtain the to-be-detected region.

3. The method of claim 2, wherein, The performing of the connected domain area screening on the segmented region of interest to obtain the screened region of interest comprises: calculating a first area of a connected domain of the segmented region of interest; eliminating connected domains with a first area not satisfying a first preset threshold to obtain the screened region of interest.

4. The method of claim 1, wherein, The acquiring of the actual edge contour of the target object in the to-be-detected region comprises: performing contour conversion on the to-be-detected region to obtain an initial edge contour of the target object; If the number of pixel points of the initial edge contour is greater than a second preset threshold, the initial edge contour is determined as the actual edge contour.

5. The method of claim 1, wherein, The smoothing processing on the actual edge contour comprises: According to the number of sampling, the neighborhood of the actual pixel point on the actual edge contour is sampled to obtain a sample point set; According to the least square method, the sample point set is fitted to obtain a fitting result; According to the fitting result, the actual edge contour is smoothed to obtain the smoothed edge contour.

6. The method of claim 5, wherein, The smoothing processing on the actual edge contour according to the fitting result to obtain the smoothed edge contour comprises: The actual pixel point is projected to the corresponding fitting result to obtain a smoothed pixel point; The smoothed edge contour is generated according to the smoothed pixel point.

7. An edge defect detection apparatus characterized by comprising: The device comprises: An acquisition module is configured to acquire an actual edge contour of a target object in a to-be-detected region; A smoothing module is configured to perform smoothing processing on the actual edge contour to obtain a smoothed edge contour; A first determination module is configured to determine a candidate defect point set on the actual edge contour according to the smoothed edge contour; A generation module is configured to generate a standard contour of the candidate defect point set according to a neighborhood point set of the candidate defect point set; A second determination module is configured to determine a target defect region corresponding to the actual edge contour according to the standard contour and the candidate defect point set; A third determination module is configured to determine an edge defect detection result of the target object according to the target defect region. The determination of the candidate defect point set on the actual edge contour according to the smoothed edge contour comprises: A first overall coordinate value of an actual pixel point on the actual edge contour and a second overall coordinate value of a smoothed pixel point on the smoothed edge contour are acquired; A first distance between the actual pixel point and the smoothed pixel point corresponding to the position of the actual pixel point is calculated according to the first overall coordinate value and the second overall coordinate value; The candidate defect point set on the actual edge contour is determined according to the first distance. The acquisition of the first overall coordinate value of the actual pixel point on the actual edge contour and the second overall coordinate value of the smoothed pixel point on the smoothed edge contour comprises: A first starting point on the actual edge contour is acquired, and coordinate values of all actual pixel points on the actual edge contour are acquired in a first preset direction according to the first starting point to obtain the first overall coordinate value; A second starting point on the smoothed edge contour is acquired, and coordinate values of all smoothed pixel points on the smoothed edge contour are acquired in the first preset direction according to the second starting point to obtain the second overall coordinate value; The first starting point is an actual pixel point with the maximum column coordinate among all actual pixel points corresponding to the minimum row coordinate, and the second starting point is a smoothed pixel point corresponding to the position of the first starting point. The generation of the standard contour of the candidate defect point set according to the neighborhood point set of the candidate defect point set comprises: According to a preset number of neighborhood points, a set of neighborhood points at two ends of the set of candidate defect points on the actual edge contour is obtained; Spline interpolation is performed on the set of neighborhood points to obtain a standard contour of the set of candidate defect points.

8. An electronic device, comprising: Comprise: At least one processor; And The memory is in communication connection with the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any one of claims 1-6.

9. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to make the computer execute the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Edge defect detection method and device

    CN113034447A

  • Product appearance detection method and device and storage medium

    CN113888503A

  • Glass edge detection method and system based on machine vision

    CN114140416A