Surface inspection method, device, and computer-readable storage medium

By acquiring edge detection data in non-parallel directions, determining candidate surface defect areas and performing image acquisition, the problems of low detection efficiency and low accuracy in the existing technology are solved, and fast and accurate defect detection is achieved.

CN113870291BActive Publication Date: 2025-09-09RICOH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010607997.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-29
Publication Date
2025-09-09
Estimated Expiration
2040-06-29

AI Technical Summary

Technical Problem

In the existing technology, the efficiency and accuracy of product surface defect detection are low, and the defect position cannot be located quickly and accurately.

Method used

By acquiring edge detection data in at least two non-parallel directions, it is determined whether there is a defect candidate area on the surface, and surface image acquisition and defect detection are performed on this basis.

Benefits of technology

It achieves precise positioning of surface defects, improves detection accuracy and saves detection time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113870291B_ABST
    Figure CN113870291B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a surface inspection method, a surface inspection apparatus, and a computer-readable storage medium. The surface inspection method according to an embodiment of the present invention includes: acquiring at least first edge detection data and second edge detection data, wherein the first edge detection data is a first surface profile obtained by detecting an edge of the surface in a first detection direction, and the second edge detection data is a second surface profile obtained by detecting an edge of the surface in a second detection direction, wherein the first detection direction and the second detection direction are non-parallel; determining whether a defect candidate region exists on the surface based on at least the first edge detection data and the second edge detection data; when it is determined that the defect candidate region exists on the surface, acquiring a surface image based on the defect candidate region, and performing defect detection based on the surface image based on the defect candidate region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of defect detection, and in particular to a surface inspection method, a surface inspection device, and a computer-readable storage medium. Background Art

[0002] In industrial production, surface defect detection is a crucial step in ensuring product quality. Traditionally, experienced workers have been responsible for manual surface inspection and quality control. However, this approach can lead to inefficient, time-consuming, and inconsistent product quality inspection standards.

[0003] Based on this premise, automated product surface inspection and quality control solutions have been further developed. For example, users can use three-dimensional sensors as tools to capture images and detect defects on the product surface. However, this surface defect detection method is often limited by the sensor's field of view, image acquisition speed, and detection accuracy. For example, high-precision three-dimensional sensors often have a very small field of view, making it impossible to quickly obtain accurate surface data over a large area. Therefore, scanning the entire product surface area for inspection would be very time-consuming. In addition, the inability to accurately locate the defect position leads to large errors when performing image fitting, and therefore high detection accuracy cannot be achieved.

[0004] It can be seen that there is a need for a method and device that can quickly and effectively locate surface defects and further improve the accuracy of defect detection. Summary of the Invention

[0005] In order to solve the above technical problems, according to one aspect of the present invention, a surface inspection method is provided, including: acquiring at least first edge detection data and second edge detection data, the first edge detection data being a first surface contour obtained by detecting the edge of the surface in a first detection direction, and the second edge detection data being a second surface contour obtained by detecting the edge of the surface in a second detection direction, and the first detection direction and the second detection direction are non-parallel; determining whether there is a defect candidate area on the surface based on at least the first edge detection data and the second edge detection data; when it is determined that the defect candidate area exists on the surface, acquiring a surface image based on the defect candidate area, and performing defect detection based on the surface image based on the defect candidate area.

[0006] According to another aspect of the present invention, a surface inspection device is provided, including: an acquisition unit configured to acquire at least first edge detection data and second edge detection data, wherein the first edge detection data is a first surface contour obtained by detecting the edge of the surface in a first detection direction, and the second edge detection data is a second surface contour obtained by detecting the edge of the surface in a second detection direction, and the first detection direction and the second detection direction are non-parallel; a determination unit configured to determine whether there is a defect candidate area on the surface based on at least the first edge detection data and the second edge detection data; and a detection unit configured to, when it is determined that the defect candidate area exists on the surface, acquire a surface image based on the defect candidate area, and perform defect detection based on the surface image based on the defect candidate area.

[0007] According to another aspect of the present invention, a surface inspection device is provided, comprising: a processor; and a memory, computer program instructions being stored in the memory, wherein when the computer program instructions are executed by the processor, the processor is caused to perform the following steps: acquiring at least first edge detection data and second edge detection data, the first edge detection data being a first surface contour obtained by detecting an edge of the surface in a first detection direction, and the second edge detection data being a second surface contour obtained by detecting an edge of the surface in a second detection direction, the first detection direction and the second detection direction being non-parallel; determining whether there is a defect candidate area on the surface based on at least the first edge detection data and the second edge detection data; when it is determined that the defect candidate area exists on the surface, acquiring a surface image based on the defect candidate area, and performing defect detection based on the surface image based on the defect candidate area.

[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions, when executed by a processor, implement the following steps: obtaining at least first edge detection data and second edge detection data, the first edge detection data being a first surface contour obtained by detecting an edge of the surface in a first detection direction, and the second edge detection data being a second surface contour obtained by detecting an edge of the surface in a second detection direction, the first detection direction and the second detection direction being non-parallel; determining whether there is a defect candidate area on the surface based on at least the first edge detection data and the second edge detection data; when it is determined that the defect candidate area exists on the surface, obtaining a surface image based on the defect candidate area, and performing defect detection based on the surface image based on the defect candidate area.

[0009] The surface inspection method, apparatus, and computer-readable storage medium of the present invention first perform edge detection on the surface edge to obtain a side profile of the surface. Defect candidate areas are then located based on the obtained side profiles of the surface in at least two non-parallel directions, and accurate surface defect detection is performed based on this location. The surface inspection method, apparatus, and computer-readable storage medium of the present invention can accurately locate surface defects, thereby effectively improving defect detection accuracy and reducing defect detection time. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above and other objects, features and advantages of the present invention will become more apparent by describing in detail the embodiments of the present invention with reference to the accompanying drawings.

[0011] Figure 1 A flow chart showing a surface inspection method according to one embodiment of the present invention is shown:

[0012] Figure 2 A schematic diagram of a surface to be detected and an example of a detection direction of a surface edge according to an embodiment of the present invention is shown;

[0013] Figure 3 A schematic diagram illustrating an example surface inspection method according to an embodiment of the present invention;

[0014] Figure 4 Schematic diagrams of first and second surface profiles and corresponding defect candidate regions according to an example of an embodiment of the present invention are shown;

[0015] Figure 5 A schematic diagram illustrating surface image acquisition based on defect candidate areas according to an example of an embodiment of the present invention is shown;

[0016] Figure 6 A block diagram showing a surface inspection apparatus according to an embodiment of the present invention;

[0017] Figure 7 A block diagram showing a surface inspection apparatus according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0018] The surface inspection method, apparatus, and computer-readable storage medium according to embodiments of the present invention will be described below with reference to the accompanying drawings. In the accompanying drawings, like reference numerals represent like elements throughout. It should be understood that the embodiments described herein are merely illustrative and should not be construed as limiting the scope of the present invention.

[0019] The surface inspection method and apparatus of the embodiments of the present invention can be applied to a variety of surfaces in a variety of application fields. For example, the surface inspection method and apparatus of the embodiments of the present invention can be applied to the field of product surface quality inspection, such as surface quality inspection and defect location for various products such as decals, product component surfaces, furniture, or electrical appliances, and can be applied to various regular or irregular surface shapes.

[0020] The following will refer to Figure 1 A surface inspection method according to an embodiment of the present invention is described. Figure 1 A flow chart of the surface inspection method 100 is shown.

[0021] like Figure 1 As shown, in step S101, at least first edge detection data and second edge detection data are obtained, wherein the first edge detection data is a first surface contour obtained by detecting the edge of the surface in a first detection direction, and the second edge detection data is a second surface contour obtained by detecting the edge of the surface in a second detection direction, and the first detection direction is non-parallel to the second detection direction.

[0022] In one embodiment of the present invention, edge detection data obtained by detecting the detection directions of at least two non-parallel edges of the surface can be obtained. In one example, the edge detection data obtained can include at least first edge detection data for a first detection direction and second edge detection data for a second detection direction. Optionally, the first detection direction and the second detection direction can be orthogonal to each other. In addition, optionally, the first detection direction or the second detection direction can be a detection direction that is always along an edge of the surface, or a detection direction that is not strictly along an edge of the surface. Figure 2 FIG1 shows a schematic diagram of a surface to be detected and an example of a detection direction of a surface edge according to an embodiment of the present invention. Figure 2 In the figure, for the surface A shown, the first edge detection direction used to obtain the first edge detection data can be direction a along a certain edge of surface A, or direction b along a tangent of a certain point on the edge of surface A. In addition, the second edge detection direction used to obtain the second edge detection data can also be direction c or direction d, as long as the first detection direction and the second detection direction are not parallel, and the contents of the first surface profile detected in the first detection direction and the second surface profile detected in the second detection direction are not completely consistent, and no other restrictions are imposed. Optionally, the surface shape of the surface to be inspected can be obtained in advance, so as to use geometric priors and other methods to more accurately calculate and analyze the application of the first or second edge detection data obtained to the corresponding surface edge, thereby further improving the accuracy of surface inspection and expanding the scope of application of defect detection.

[0023] In one embodiment of the present invention, the first edge detection data and the second edge detection data may be the side-view surface profiles (i.e., the first surface profile and the second surface profile) obtained by detecting the corresponding detection directions from the edges of the surface respectively. Optionally, the side-view surface profile obtained in the embodiment of the present invention may be a surface profile curve along the corresponding detection direction, which is used to indicate the degree of surface deformation along the detection direction, that is, the surface undulation. For example, when the obtained surface profile curve has large fluctuations, it indicates that the corresponding area of ​​the surface has a large degree of deformation and the surface is relatively uneven, which generally indicates that there are defects on the surface; and when the obtained surface profile curve has small fluctuations, it indicates that the surface deformation is small and the surface is relatively flat, which generally indicates that there are no defects on the surface. In addition, the surface profile curve can also specifically indicate the specific position and range of surface deformation in the corresponding detection direction, thereby enabling accurate positioning of surface defects.

[0024] In step S102 , it is determined whether a defect candidate region exists on the surface based on at least the first edge detection data and the second edge detection data.

[0025] According to one embodiment of the present invention, it is possible to determine whether there is a first non-planar area in the first surface contour and whether there is a second non-planar area in the second surface contour; when there is a first non-planar area in the first surface contour and a second non-planar area in the second surface contour, at least one first non-planar area of ​​the first surface contour and at least one second non-planar area of ​​the second surface contour are obtained respectively; and one or more intersection areas indicated on the surface by at least one first non-planar area and at least one second non-planar area are used as the defect candidate areas.

[0026] Optionally, the position of the corresponding non-planar area on the corresponding edge of the surface can be determined based on the position of one or more first non-planar areas of the first surface contour along the first detection direction. In one example, one or more coordinate value ranges of the non-planar area on the edge of the surface corresponding to the first detection direction in a preset coordinate system can be determined based on the position of the one or more first non-planar areas. Similarly, the position of the corresponding non-planar area on the corresponding edge of the surface can also be determined based on the position of one or more second non-planar areas of the second surface contour along the second detection direction. In one example, one or more coordinate value ranges of the non-planar area on the edge of the surface corresponding to the second detection direction in a preset coordinate system can be determined. Subsequently, after obtaining the coordinate value ranges of the respective non-planar areas on the edges of the surface corresponding to the first detection direction and the second detection direction, the coordinate value ranges of one or more intersection areas between the non-planar areas on the edges corresponding to the two non-parallel directions can be obtained to determine the specific position of the intersection area on the surface, that is, the specific position of the defect candidate area on the surface.

[0027] In addition, optionally, when only the first surface contour satisfies the existence of a first non-planar area, but the second surface contour does not contain a second non-planar area, at least one first non-planar area of ​​the first surface contour can be obtained, and the area indicated by the at least one first non-planar area on the surface can be used as a defect candidate area. Similarly, when only the second surface contour satisfies the existence of a second non-planar area, but the first surface contour does not contain a first non-planar area, at least one second non-planar area of ​​the second surface contour can be obtained, and the area indicated by the at least one second non-planar area on the surface can be used as a defect candidate area. In one example, when only the first surface contour exists a first non-planar area, but the second surface contour does not contain a second non-planar area, one or more coordinate value ranges of the non-planar area on the edge of the surface corresponding to the first detection direction in a preset coordinate system can be obtained, so that all areas on the surface within the coordinate value range are used as defect candidate areas without further determining the intersection area. For example, when the surface is a rectangle, the first detection direction is the long side of the rectangle, and the second detection direction is the short side of the rectangle, if only a first non-planar area is detected at the long side of the rectangle, the defect candidate area can be determined as a rectangular area on the surface, which is limited by the coordinate value range of the long side of the rectangle corresponding to the first non-planar area and the short side of the entire rectangle. Optionally, when there is no first non-planar area in the first surface contour and there is no second non-planar area in the second surface contour, it can be considered that there is no defect candidate area on the surface. In the actual application process of the embodiment of the present invention, it is also possible to judge the first non-planar area only for the first surface contour without judging the second non-planar area of ​​the second surface contour; or, it is possible to judge the second non-planar area only for the second surface contour without judging the first non-planar area of ​​the first surface contour, and determine the corresponding defect candidate area on the surface. The judgment method is similar to the above and will not be repeated here.

[0028] Optionally, determining whether the first surface profile has a first non-planar area and whether the second surface profile has a second non-planar area may include: determining the degree of deformation of the first surface profile and the second surface profile respectively; when the degree of deformation of the area in the first surface profile exceeds a first threshold, the area exceeding the first threshold may be regarded as the first non-planar area, and when the degree of deformation of the area in the second surface profile exceeds a second threshold, the area exceeding the second threshold may be regarded as the second non-planar area. In one example, the fluctuation pattern of the surface profile curve (such as whether the curve rises or falls) can be obtained by the first-order derivative of the obtained surface profile curve, and the fluctuation degree of the surface profile curve can be obtained by the second-order derivative, so that the peaks, valleys and changing trends from peaks to valleys of the surface profile curve can be obtained to determine the degree of deformation of the surface profile. In addition, optionally, the first threshold and the second threshold used to determine the degree of deformation may be the same or different, and the determination method can be freely selected according to the actual application scenario. In one example, in the process of determining the first or second non-planar area, the area within a certain range around the peak / valley of the surface contour curve and the surrounding area can be used as the corresponding non-planar area. For example, the area containing the peak of the surface contour curve can represent the area where defects such as protrusions, bubbles, impurities, etc. appear on the surface, and the area containing the peak and valley of the surface contour curve can represent the area where defects such as depressions, scratches, and cracks appear on the surface.

[0029] In another example, the distance of at least one first non-planar region and / or at least one second non-planar region from at least one edge of the surface can also be considered to further restrict whether one or more intersecting regions qualify as defect candidate regions. For example, the defect candidate regions can be restricted to being within the corresponding distance range obtained above, thereby excluding those intersecting regions whose distances from the corresponding edge of the surface are different from the corresponding distance range obtained above, and the remaining intersecting regions are used as the final defect candidate regions. In this example, various methods can be used to detect the distance of the first non-planar region and / or the second non-planar region from the surface edge. For example, a depth camera can be used to obtain the depth of the corresponding non-planar region from the camera to obtain the distance of the non-planar region from a certain edge of the surface. For another example, laser, ultrasonic, and other detection methods can also be used to obtain the distance of the non-planar region from a certain edge of the surface, which are not limited here. Of course, optionally, surface edge detection can also be performed on two approximately parallel edges around the surface to obtain the distance of a non-planar region from the two approximately parallel edges of the surface, thereby more accurately locating the non-planar region and further limiting the position of the selected defect candidate region.

[0030] In step S103 , when it is determined that the defect candidate region exists on the surface, a surface image based on the defect candidate region is acquired, and defect detection is performed based on the surface image based on the defect candidate region.

[0031] Optionally, after obtaining the coarsely located defect candidate area on the surface, a fine detection can be performed on the surface from a third detection direction to obtain a surface image based on the defect candidate area, and obtain the depth value of each point in the surface image based on the defect candidate area relative to, for example, a direction perpendicular to the surface, such as the third detection direction. The third detection direction is different from the first detection direction and the second detection direction. Subsequently, the defect position corresponding to the defect candidate area can also be determined based on the depth value of each point relative to the third detection direction. For example, the third detection direction can be orthogonal to the first detection direction and the second detection direction. In this embodiment, the surface image based on the defect candidate area obtained can be a surface image obtained by vertically irradiating from above the surface, which can be a surface image of the defect candidate area itself, or a surface image including the defect candidate area (for example, it can be a surface image with the defect candidate area as the center and a certain range extending outward). The specific range of the surface image can be determined by referring to the determination of the plane area and the effect of plane fitting described below. Of course, if the subsequent plane fitting effect is not good, resulting in an inaccurate defect position, the position and coverage of the surface image here can be adjusted at any time. Alternatively, a sensor such as light or ultrasound, or a depth camera, can be used to perform distance detection on each point within a portion of the surface based on the defect candidate area, thereby obtaining a depth value relative to a third detection direction for each point in the surface image based on the defect candidate area. After obtaining the depth value for each point in the surface image, a planar area in the surface image based on the defect candidate area can be determined based on these depth values, and plane fitting can be performed on the determined planar area to ultimately determine the location of the defect based on the plane fitting result.

[0032] In one example, points in a surface image based on a defect candidate area whose depth values ​​are within a certain range can be divided into plane areas. In another example, the plane area can also be determined by excluding certain points in the surface image based on the defect candidate area. For example, when the coverage of the surface image is larger than the defect candidate area, the plane area for plane fitting can be obtained by excluding points in the defect candidate area in the surface image, or excluding points within a certain range including the defect candidate area (such as points within a certain range defined with the defect candidate area as the center). For the determined plane area, the plane area can be plane fitted using a method such as the least squares method. After obtaining the results of the plane fitting, the depth values ​​of each point in the surface image can be compared with the depth values ​​of the points of the fitted plane, and the points in the surface image whose distance from the depth values ​​of the points of the plane exceeds a certain threshold are regarded as defect points. Optionally, when the distances between these defect points are within a certain range, these defect points can be treated as a whole defect and the locations of the defects can be determined; in addition, when the distances between certain defect points are far and cannot be considered as a whole defect, these defect points can be further processed, such as clustering discrete defect points to obtain multiple defects and further determining the corresponding location of each defect.

[0033] Optionally, when the surface is inspected in the third detection direction and it is impossible to obtain the entire surface image based on the defect candidate area, it is also possible to adjust the detection height of the sensor or depth camera used for detection to try to obtain the entire surface image based on the defect candidate area, so as to make the surface inspection results more accurate and improve the surface inspection efficiency.

[0034] The surface inspection method according to an embodiment of the present invention first performs edge detection on the surface edge to obtain a side profile of the surface. It then locates candidate defect areas based on the obtained side profiles of the surface in at least two non-parallel directions, and accurately detects surface defects based on these locations. The surface inspection method according to an embodiment of the present invention can accurately locate surface defects, thereby effectively improving defect detection accuracy and reducing defect detection time.

[0035] A specific example of a surface inspection method according to an example of an embodiment of the present invention is described in detail below. Figure 3 FIG. 1 is a schematic diagram showing a surface inspection method according to an example of an embodiment of the present invention. Figure 3 In the example shown, 1 is the surface of the object to be inspected, 2 is an example of one or more defects on the surface of the object 1, and the pairwise orthogonal x, y, and z are the first inspection direction, the second inspection direction, and the third inspection direction, respectively.

[0036] like Figure 3As shown, first and second edge detection data are obtained for the surface edge in the x and y directions, respectively, indicating a first surface profile along the x direction and a second surface profile along the y direction, respectively. After obtaining the first and second edge detection data, candidate defect areas can be further determined based on the first and second non-planar areas determined by the corresponding first and second surface profiles. Figure 4 Schematic diagrams of first and second surface profiles and corresponding defect candidate regions according to an example of an embodiment of the present invention are shown. Specifically, Figure 4 dist in x It can indicate the first edge detection data obtained by the x-direction detection, which represents the first surface contour of the object surface 1 along the x-direction; and dist y The second edge detection data obtained by detecting the y direction may be indicated, which represents the second surface contour of the object surface 1 along the y direction. Figure 4 As shown, it can be seen that when the x direction of the object surface 1 is detected, the surface profile curve of the corresponding first surface profile can have two peaks. By comparing with the corresponding first threshold, the dist x The two first non-planar areas around the two peaks are represented by "×", which indicate the two lateral area ranges indicated by the thin dotted lines on the object surface 1, and the specific coordinate values ​​of the two lateral area ranges in the xyz coordinate system can be obtained. Correspondingly, the surface profile curve of the second surface profile obtained by the y-direction detection of the object surface 1 can also have two peaks, and by comparing with the second threshold, the dist y The two second non-planar areas indicated by "×" around the two peaks indicate the two longitudinal area ranges indicated by the thin dotted lines on the surface 1 of the object, and the specific coordinate values ​​of the two longitudinal area ranges in the xyz coordinate system can also be obtained. By crossing the transverse and longitudinal area ranges indicated by the two first non-planar areas and the two second non-planar areas, the following can be obtained: Figure 4 The four candidate defect areas shown in gray are represented by ①, ②, ③ and ④ respectively, and their specific coordinate value ranges in the xyz coordinate system can also be obtained by calculation.

[0037] After initially obtaining four defect candidate regions indicated by two first non-planar regions and two second non-planar regions on the object surface 1, in this example, the distance between the defect candidate regions and a certain edge of the object surface 1 can be further detected and limited by, for example, a depth camera. Figure 4 As shown, the surface profile curve dist of the first surface profile is obtained from the right side. xWhen the depth camera detects the depth of the non-planar area, the defect candidate area can be selected from the four defect candidate areas ①, ②, ③ and ④. x The defect candidate areas ① and ② in the same first non-planar area can be detected by depth, and the distance between the aforementioned determined defect candidate area ② and the right edge of the object surface 1 is known, which is not on the surface contour curve dist x The depth range of the corresponding non-planar area is limited, so that the defect candidate area ② can be excluded and only the defect candidate area ① is retained. In addition, the surface contour curve dist can be detected in the same way. x The other two defect candidate areas ③ and ④ in the other first non-planar area. When the surface profile curve dist of the first surface profile is obtained from the right side x When the distance between the defect candidate area ④ and the right edge of the object surface 1 is known, the surface contour curve dist x , so that the defect candidate area ④ can be retained. Furthermore, since the current example of detecting the depth of the non-planar area from the right side cannot exclude the defect candidate area ③, for the four defect candidate areas ①, ②, ③ and ④, defect candidate areas ①, ③ and ④ can be selected as the final defect candidate areas. Of course, in another example, optionally, it is also possible to further detect the surface contour curve and the corresponding depth from the left side in the x direction to know whether the aforementioned defect candidate area ③ can be excluded, so as to further accurately define the range of the defect candidate area of ​​the object surface 1.

[0038] Then, after determining the above-mentioned defect candidate areas ①, ③ and ④, you can Figure 3 One or more surface images based on defect candidate areas are obtained in the z direction. Figure 5 FIG. 1 shows a schematic diagram of surface image acquisition based on defect candidate areas according to an example of an embodiment of the present invention. Figure 5As shown, light, ultrasonic and other sensors or depth cameras acquire images and collect the depth of points based on the defect candidate area on the surface 1 of the object. Among them, the light gray FOV indicates the field of view (Field of View) of the sensor or depth camera, indicating the coverage of the surface image based on the defect candidate area on the surface. Within the range of FOV, the defect candidate area determined previously is within the coarse positioning range of CL (Coarse Location) shown in black. By acquiring each point within the FOV range of the surface image, the depth value of each point in the surface image can be obtained. Subsequently, by expanding the defect candidate area CL accordingly (such as expanding a certain range of coordinate values ​​with CL as the center), an exclusion area CA (Cropped Area) including CL can be obtained, which includes the black CL area and the dark gray area around it. After excluding CA from the FOV, all remaining points in the FOV can be used as points in the plane area, and plane fitting can be performed. Finally, after obtaining the results of plane fitting, the depth values ​​of each point in the FOV can be compared with the depth values ​​of the points in the fitted plane, and the points whose distance from the depth values ​​of the points in the plane exceeds a certain threshold are regarded as defect points. These defect points can be further clustered into one or more defects to accurately locate the specific position and related parameters of each defect on the object surface 1 (such as the coordinate value range of the defect on the object surface 1, the average depth value of each point, the depth value corresponding to each point, etc.).

[0039] The surface inspection method of this example in the embodiment of the present invention can accurately locate surface defects, thereby effectively improving the defect detection accuracy and saving defect detection time.

[0040] Below, refer to Figure 6 A surface inspection apparatus according to an embodiment of the present invention will be described. Figure 6 FIG. 6 shows a block diagram of a surface inspection apparatus 600 according to an embodiment of the present invention. Figure 6 As shown, the surface inspection device 600 includes an acquisition unit 610, a determination unit 620, and a detection unit 630. In addition to these units, the surface inspection device 600 may also include other components. However, since these components are irrelevant to the content of the embodiment of the present invention, their illustration and description are omitted here. In addition, since the specific details of the following operations performed by the surface inspection device 600 according to the embodiment of the present invention are different from those described above with reference to Figure 1-Figure 5 The details described are the same, so repeated description of the same details is omitted here to avoid repetition.

[0041] Figure 6The acquisition unit 610 of the surface inspection device 600 acquires at least first edge detection data and second edge detection data, wherein the first edge detection data is a first surface contour obtained by detecting the edge of the surface in a first detection direction, and the second edge detection data is a second surface contour obtained by detecting the edge of the surface in a second detection direction, and the first detection direction and the second detection direction are non-parallel.

[0042] In one embodiment of the present invention, for the surface, the acquisition unit 610 may acquire edge detection data obtained by detecting the detection directions of at least two non-parallel edges. In one example, the edge detection data acquired by the acquisition unit 610 may include at least first edge detection data for a first detection direction and second edge detection data for a second detection direction. Optionally, the first detection direction and the second detection direction may be orthogonal to each other. In addition, optionally, the first detection direction or the second detection direction may be a detection direction that is always along an edge of the surface, or may be a detection direction that is not strictly along an edge of the surface. Figure 2 FIG1 shows a schematic diagram of a surface to be detected and an example of a detection direction of a surface edge according to an embodiment of the present invention. Figure 2 In the figure, for the surface A shown, the first edge detection direction used by the acquisition unit 610 to acquire the first edge detection data can be direction a along a certain edge of surface A, or direction b along a tangent line at a certain point on the edge of surface A. In addition, the second edge detection direction used by the acquisition unit 610 to acquire the second edge detection data can also be direction c or direction d. As long as the first detection direction and the second detection direction are not parallel, and the contents of the first surface profile detected in the first detection direction and the second surface profile detected in the second detection direction are not completely consistent, there are no other restrictions. Optionally, the acquisition unit 610 can also pre-acquire the surface shape of the surface to be inspected, so as to use geometric priors and other methods to more accurately calculate and analyze the application of the acquired first or second edge detection data to the corresponding surface edge, thereby further improving the accuracy of surface inspection and expanding the scope of application of defect detection.

[0043] In one embodiment of the present invention, the first edge detection data and the second edge detection data may be the side-view surface profiles (i.e., the first surface profile and the second surface profile) obtained by detecting the corresponding detection directions from the edges of the surface respectively. Optionally, the side-view surface profile obtained in the embodiment of the present invention may be a surface profile curve along the corresponding detection direction, which is used to indicate the degree of surface deformation along the detection direction, that is, the surface undulation. For example, when the obtained surface profile curve has large fluctuations, it indicates that the corresponding area of ​​the surface has a large degree of deformation and the surface is relatively uneven, which generally indicates that there are defects on the surface; and when the obtained surface profile curve has small fluctuations, it indicates that the surface deformation is small and the surface is relatively flat, which generally indicates that there are no defects on the surface. In addition, the surface profile curve can also specifically indicate the specific position and range of surface deformation in the corresponding detection direction, thereby enabling accurate positioning of surface defects.

[0044] The determination unit 620 determines whether a defect candidate region exists on the surface according to at least the first edge detection data and the second edge detection data.

[0045] According to one embodiment of the present invention, the determination unit 620 can determine whether there is a first non-planar area in the first surface contour and whether there is a second non-planar area in the second surface contour; when there is a first non-planar area in the first surface contour and there is a second non-planar area in the second surface contour, at least one first non-planar area of ​​the first surface contour and at least one second non-planar area of ​​the second surface contour are obtained respectively; and one or more intersection areas indicated by at least one first non-planar area and at least one second non-planar area on the surface are used as the defect candidate areas.

[0046] Optionally, the determination unit 620 can determine the location of the corresponding non-planar area on the corresponding edge of the surface based on the location of one or more first non-planar areas of the first surface contour along the first detection direction. In one example, the determination unit 620 can determine one or more coordinate value ranges of the non-planar area on the edge of the surface corresponding to the first detection direction in a preset coordinate system based on the location of the one or more first non-planar areas. Similarly, the determination unit 620 can also determine the location of the corresponding non-planar area on the corresponding edge of the surface based on the location of one or more second non-planar areas of the second surface contour along the second detection direction. In one example, the determination unit 620 can determine one or more coordinate value ranges of the non-planar area on the edge of the surface corresponding to the second detection direction in a preset coordinate system. Subsequently, after the determination unit 620 obtains the coordinate value ranges of the respective non-planar areas on the edge of the surface corresponding to the first detection direction and the second detection direction, it can obtain the coordinate value ranges of one or more intersecting areas between the non-planar areas on the edges corresponding to the two non-parallel directions to determine the specific location of the intersecting areas on the surface, that is, the specific location of the defect candidate areas on the surface.

[0047] In addition, optionally, when only the first surface contour satisfies the existence of a first non-planar area, but the second surface contour does not contain a second non-planar area, the determination unit 620 may obtain at least one first non-planar area of ​​the first surface contour, and use the at least one first non-planar area in the area indicated by the surface as a defect candidate area. Similarly, when only the second surface contour satisfies the existence of a second non-planar area, but the first surface contour does not contain a first non-planar area, the determination unit 620 may obtain at least one second non-planar area of ​​the second surface contour, and use the at least one second non-planar area in the area indicated by the surface as a defect candidate area. In one example, when only the first surface contour exists a first non-planar area, but the second surface contour does not contain a second non-planar area, the determination unit 620 may obtain one or more coordinate value ranges of the non-planar area on the edge of the surface corresponding to the first detection direction in a preset coordinate system, thereby using all areas on the surface within the coordinate value range as defect candidate areas without further determining the intersection area. For example, when the surface is a rectangle, the first detection direction is the long side of the rectangle, and the second detection direction is the short side of the rectangle, if only a first non-planar area is detected at the long side of the rectangle, the determination unit 620 can determine the defect candidate area as a rectangular area on the surface, which is limited by the coordinate value range of the long side of the rectangle corresponding to the first non-planar area and the short side of the entire rectangle. Optionally, when there is no first non-planar area in the first surface contour and there is no second non-planar area in the second surface contour, the determination unit 620 can deem that there is no defect candidate area on the surface. In the actual application process of the embodiment of the present invention, the determination unit 620 can also only judge the first non-planar area for the first surface contour without judging the second non-planar area of ​​the second surface contour; or, it can only judge the second non-planar area for the second surface contour without judging the first non-planar area of ​​the first surface contour, and determine the corresponding defect candidate area on the surface. The judgment method is similar to the above and will not be repeated here.

[0048] Optionally, the determination unit 620 can determine the degree of deformation of the first surface profile and the second surface profile respectively; when the degree of deformation of an area in the first surface profile exceeds a first threshold, the area exceeding the first threshold can be used as the first non-planar area, and when the degree of deformation of an area in the second surface profile exceeds a second threshold, the area exceeding the second threshold can be used as the second non-planar area. In one example, the determination unit 620 can obtain the fluctuation pattern of the surface profile curve (such as whether the curve rises or falls) through the first-order derivative of the obtained surface profile curve, and obtain the degree of fluctuation of the surface profile curve through the second-order derivative, so as to obtain the peaks, valleys and changing trends from peaks to valleys of the surface profile curve, etc., to determine the degree of deformation of the surface profile. In addition, optionally, the first threshold and the second threshold used to determine the degree of deformation can be the same or different, and the determination method can be freely selected according to the actual application scenario. In one example, in the process of determining the first or second non-planar area, the determination unit 620 may regard the area within a certain range around the peaks / valleys of the surface contour curve and the surrounding areas as the corresponding non-planar area. For example, the area including the peaks of the surface contour curve may represent an area where defects such as protrusions, bubbles, and impurities appear on the surface, and the area including the peaks and valleys of the surface contour curve may represent an area where defects such as depressions, scratches, and cracks appear on the surface.

[0049] In another example, the determination unit 620 may further consider the distance of at least one first non-planar area and / or at least one second non-planar area relative to at least one edge of the surface, thereby further limiting whether one or more intersection areas become defect candidate areas. For example, the determination unit 620 may limit the distance between the defect candidate area and the corresponding edge of the surface to be within the range of the corresponding distance obtained above, thereby excluding those intersection areas whose distance from the corresponding edge of the surface is different from the corresponding distance range obtained above from all intersection areas, and using the remaining intersection areas as the final defect candidate areas. In this example, the determination unit 620 may use a variety of methods to detect the distance of the first non-planar area and / or the second non-planar area relative to the edge of the surface. For example, the determination unit 620 may use a depth camera to obtain the depth of the corresponding non-planar area from the camera, thereby obtaining the distance of the non-planar area relative to a certain edge of the surface; for another example, the determination unit 620 may also use a variety of detection methods such as laser and ultrasonic waves to obtain the distance of the non-planar area relative to a certain edge of the surface, which is not limited here. Of course, optionally, the determination unit 620 can also perform edge detection on the two approximately parallel edges around the surface, so as to obtain the distance between a non-planar area and the two approximately parallel edges of the surface, so as to more accurately locate the non-planar area and further limit the position of the selected defect candidate area.

[0050] When determining that the defect candidate region exists on the surface, the detection unit 630 acquires a surface image based on the defect candidate region, and performs defect detection based on the surface image based on the defect candidate region.

[0051] Optionally, after the detection unit 630 obtains the coarsely located defect candidate area on the surface, it can perform fine detection on the surface from a third detection direction to obtain a surface image based on the defect candidate area, and obtain the depth value of each point in the surface image based on the defect candidate area relative to, for example, a direction perpendicular to the surface, such as the third detection direction. The third detection direction is different from the first detection direction and the second detection direction. Subsequently, the detection unit 630 can also determine the defect position corresponding to the defect candidate area based on the depth value of each point relative to the third detection direction. For example, the third detection direction can be orthogonal to the first detection direction and the second detection direction. In this embodiment, the surface image based on the defect candidate area obtained by the detection unit 630 can be a surface image obtained by vertically irradiating from above the surface, which can be a surface image of the defect candidate area itself, or a surface image including the defect candidate area (for example, it can be a surface image with the defect candidate area as the center and a certain range spreading outward). The determination of the specific range of the surface image can be adjusted with reference to the determination of the plane area and the effect of plane fitting described below. Of course, if the subsequent plane fitting effect is not good, resulting in the defect location being inaccurate, the position and coverage of the surface image here can be adjusted at any time. Optionally, the detection unit 630 can use sensors such as light and ultrasound, or use a depth camera to perform distance detection on each point within a portion of the surface range based on the defect candidate area, thereby obtaining the depth value of each point in the surface image based on the defect candidate area relative to the third detection direction. After obtaining the depth value of each point in the surface image, the detection unit 630 can determine the plane area in the surface image based on the defect candidate area based on these depth values, and perform plane fitting on the determined plane area to finally determine the location of the defect based on the result of the plane fitting.

[0052] In one example, the detection unit 630 may divide the points whose depth values ​​in the surface image based on the defect candidate area are within a certain range into plane areas. In another example, the plane area may also be determined by excluding certain points in the surface image based on the defect candidate area. For example, when the coverage of the surface image is larger than the defect candidate area, the plane area for plane fitting may be obtained by excluding points in the defect candidate area in the surface image, or excluding points within a certain range including the defect candidate area (such as points within a certain range defined with the defect candidate area as the center). For the determined plane area, the plane area may be plane fitted using a method such as the least squares method. After obtaining the result of the plane fitting, the detection unit 630 may compare the depth value of each point in the surface image with the depth value of the point of the fitted plane, and regard the point in the surface image whose distance from the depth value of the point of the plane exceeds a certain threshold as a defect point. Optionally, when the distances between these defect points are within a certain range, the detection unit 630 may treat these defect points as a whole defect and determine the location of the defect; in addition, when the distances between certain defect points are far and cannot be considered as a whole defect, the detection unit 630 may further process these defect points, such as clustering discrete defect points, obtaining multiple defects and further determining the corresponding location of each defect.

[0053] Optionally, when the detection unit 630 is unable to obtain the entire surface image based on a defect candidate area when detecting the surface in the third detection direction, it can also adjust the detection height of the sensor or depth camera used for detection to try to obtain the entire surface image based on the defect candidate area, so as to make the surface inspection result more accurate and improve the surface inspection efficiency.

[0054] The surface inspection apparatus according to an embodiment of the present invention can first perform edge detection on the surface edge to obtain a side profile of the surface. It then locates candidate defect areas based on the obtained side profiles of the surface in at least two non-parallel directions, and accurately detects surface defects based on these locations. The surface inspection method according to an embodiment of the present invention can accurately locate surface defects, thereby effectively improving defect detection accuracy and reducing defect detection time.

[0055] Below, refer to Figure 7 A surface inspection apparatus according to an embodiment of the present invention will be described. Figure 7 FIG. 7 shows a block diagram of a surface inspection apparatus 700 according to an embodiment of the present invention. Figure 7 As shown, the device 700 may be a computer or a server.

[0056] like Figure 7As shown, the surface inspection device 700 includes one or more processors 710 and a memory 720. Of course, in addition to these, the surface inspection device 700 may also include an input device, an output device (not shown), etc. These components can be interconnected through a bus system and / or other forms of connection mechanisms. It should be noted that Figure 7 The components and structures of the surface inspection device 700 shown are merely exemplary and non-limiting. The surface inspection device 700 may also have other components and structures as needed.

[0057] The processor 710 can be a central processing unit (CPU) or other form of processing unit with data processing capability and / or instruction execution capability, and can use the computer program instructions stored in the memory 720 to perform desired functions, which may include: obtaining at least first edge detection data and second edge detection data, the first edge detection data is a first surface contour obtained by detecting the edge of the surface in a first detection direction, and the second edge detection data is a second surface contour obtained by detecting the edge of the surface in a second detection direction, and the first detection direction is non-parallel to the second detection direction; determining whether there is a defect candidate area on the surface based on at least the first edge detection data and the second edge detection data; when it is determined that the defect candidate area exists on the surface, obtaining a surface image based on the defect candidate area, and performing defect detection based on the surface image based on the defect candidate area.

[0058] The memory 720 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 710 may execute the program instructions to implement the functions of the surface inspection apparatus according to the embodiment of the present invention described above and / or other desired functions, and / or to perform the surface inspection method according to the embodiment of the present invention. Various application programs and various data may also be stored in the computer-readable storage medium.

[0059] Below, a computer-readable storage medium according to an embodiment of the present invention is described, on which computer program instructions are stored, wherein the computer program instructions, when executed by a processor, implement the following steps: obtaining at least first edge detection data and second edge detection data, the first edge detection data being a first surface contour obtained by detecting an edge of the surface in a first detection direction, and the second edge detection data being a second surface contour obtained by detecting an edge of the surface in a second detection direction, the first detection direction and the second detection direction being non-parallel; determining whether there is a defect candidate area on the surface based on at least the first edge detection data and the second edge detection data; when it is determined that the defect candidate area exists on the surface, obtaining a surface image based on the defect candidate area, and performing defect detection based on the surface image based on the defect candidate area.

[0060] Of course, the above-mentioned specific embodiments are merely examples and not limitations, and those skilled in the art can, based on the concept of the present invention, merge and combine some steps and devices from the various embodiments described separately above to achieve the effects of the present invention. Such merged and combined embodiments are also included in the present invention, and such merges and combinations are not described one by one here.

[0061] Note that the advantages, benefits, and effects mentioned in the present invention are merely illustrative and non-limiting, and should not be construed as necessarily possessed by each embodiment of the present invention. Furthermore, the specific details of the invention described above are provided for illustrative purposes and to facilitate understanding, and are not intended to be limiting. The details do not necessarily limit the present invention to being implemented using the specific details.

[0062] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present invention are intended to be illustrative examples only and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems may be connected, arranged, or configured in any manner. Words such as "include," "comprise," "have," and the like are open-ended words, meaning "including but not limited to," and may be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or" and may be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and may be used interchangeably therewith.

[0063] The step flow charts and the above method descriptions in the present invention are intended to be illustrative examples only and are not intended to require or imply that the steps of the various embodiments must be performed in the order given. As will be appreciated by those skilled in the art, the order of the steps in the above embodiments can be performed in any order. Words such as "thereafter," "then," "next," and the like are not intended to limit the order of the steps; these words are merely used to guide the reader through the description of these methods. In addition, any reference to an element in the singular, such as using "a," "an," or "the," is not to be construed as limiting the element to the singular.

[0064] In addition, the steps and devices in the various embodiments of this document are not limited to being implemented in a certain embodiment. In fact, based on the concept of the present invention, relevant partial steps and partial devices in the various embodiments of this document can be combined to conceive new embodiments, and these new embodiments are also included in the scope of the present invention.

[0065] Each operation of the method described above may be performed by any suitable means capable of performing the corresponding functions, which may include various hardware and / or software components and / or modules, including but not limited to circuits, application specific integrated circuits (ASICs) or processors.

[0066] The various illustrated logic blocks, modules, and circuits may be implemented or performed using a general-purpose processor, a digital signal processor (DSP), an ASIC, a field programmable gate array signal (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but as an alternative, the processor may be any commercially available processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.

[0067] The steps of the method or algorithm described in conjunction with the present invention can be directly embedded in hardware, in a software module executed by a processor, or in a combination of the two. The software module can exist in any form of tangible storage medium. Some examples of storage media that can be used include random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, hard disks, removable disks, CD-ROMs, etc. A storage medium can be coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. In an alternative embodiment, the storage medium can be integral to the processor. A software module can be a single instruction or many instructions and can be distributed over several different code segments, between different programs, and across multiple storage media.

[0068] The methods herein include one or more actions for implementing the methods described. The methods and / or actions may be interchangeable with one another without departing from the scope of the claims. In other words, unless a specific order of actions is specified, the order and / or use of the specific actions may be modified without departing from the scope of the claims.

[0069] The functions described can be implemented by hardware, software, firmware or any combination thereof. If implemented in software, the functions can be stored as one or more instructions on a tangible computer-readable medium. The storage medium can be any available tangible medium that can be accessed by a computer. By way of example and not limitation, such computer-readable media can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage device or any other tangible medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer. As used herein, disc includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc.

[0070] Thus, a computer program product can perform the operations presented herein. For example, such a computer program product can be a computer-readable tangible medium having instructions tangibly stored (and / or encoded) thereon, the instructions being executable by one or more processors to perform the operations described herein. The computer program product can include packaging materials.

[0071] Software or instructions may also be transmitted via a transmission medium. For example, software may be transmitted from a website, server, or other remote source using a transmission medium such as coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, or microwave.

[0072] In addition, the modules and / or other appropriate means for performing the methods and techniques described herein can be downloaded and / or otherwise obtained by the user terminal and / or base station when appropriate. For example, such a device can be coupled to a server to facilitate the transmission of the means for performing the methods described herein. Alternatively, the various methods described herein can be provided via a storage component (e.g., RAM, ROM, a physical storage medium such as a CD or floppy disk) so that the user terminal and / or base station can obtain the various methods when being coupled to the device or providing a storage component to the device. In addition, any other appropriate technology for providing the methods and techniques described herein to a device can be utilized.

[0073] Other examples and implementations are within the scope and spirit of the invention and the appended claims. For example, due to the nature of software, the functions described above can be implemented using software executed by a processor, hardware, firmware, hardwiring, or any combination of these. Features that implement the functions can also be physically located in various locations, including being distributed so that parts of the functions are implemented at different physical locations. Moreover, as used herein, including as used in the claims, "or" used in a list of items that begin with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). In addition, the wording "exemplary" does not mean that the example described is preferred or better than other examples.

[0074] Various changes, substitutions, and modifications may be made to the technology described herein without departing from the teachings as defined by the appended claims. Moreover, the scope of the claims is not limited to the specific aspects of the processes, machines, manufacture, compositions of things, means, methods, and actions described above. Currently existing or later developed processes, machines, manufacture, compositions of things, means, methods, or actions that perform substantially the same function or achieve substantially the same results as the corresponding aspects described herein may be utilized. Accordingly, the appended claims include within their scope such processes, machines, manufacture, compositions of things, means, methods, or actions.

[0075] The above description of the invented aspects is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present invention. Therefore, the present invention is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features of the invention herein.

[0076] The above description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the present invention to the forms invented herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A surface inspection method comprising: Acquiring at least first edge detection data and second edge detection data, wherein the first edge detection data is a first surface profile obtained by detecting a plurality of different positions of the surface along a first detection direction of the edge of the surface, and the second edge detection data is a second surface profile obtained by detecting a plurality of different positions of the surface along a second detection direction of the edge of the surface, wherein the first detection direction and the second detection direction are non-parallel; determining whether a defect candidate region exists on the surface based on at least the first edge detection data and the second edge detection data; When it is determined that the defect candidate area exists on the surface, acquiring a surface image based on the defect candidate area, and performing defect detection based on the surface image based on the defect candidate area; Wherein, determining whether a defect candidate area exists according to at least the first edge detection data and the second edge detection data includes: Determining whether the first surface profile has a first non-planar area and whether the second surface profile has a second non-planar area; When the first surface profile has a first non-planar area and the second surface profile has a second non-planar area, respectively acquiring at least one first non-planar area of ​​the first surface profile and at least one second non-planar area of ​​the second surface profile; One or more intersection regions indicated by at least one of the first non-planar region and at least one of the second non-planar region on the surface are used as the defect candidate regions.

2. The method according to claim 1, wherein The first detection direction and the second detection direction are orthogonal to each other.

3. The method according to claim 1, wherein Determining whether the first surface profile has a first non-planar area and whether the second surface profile has a second non-planar area includes: respectively determining the deformation degrees of the first surface profile and the second surface profile; When the deformation degree of an area in the first surface profile exceeds a first threshold, the area exceeding the first threshold is regarded as the first non-planar area, and When the deformation degree of a region in the second surface profile exceeds a second threshold, the region exceeding the second threshold is regarded as the second non-planar region.

4. The method according to claim 1, wherein The method of using an intersection area indicated on the surface of at least one first non-planar area and at least one second non-planar area as the defect candidate area includes: Obtaining a distance between at least one of the first non-planar areas and / or at least one of the second non-planar areas and at least one edge of the surface; According to the acquired distance, at least one of the first non-planar region and at least one of the second non-planar region are selected from one or more intersection regions indicated by the surface to obtain the defect candidate region.

5. The method according to claim 1, wherein When the defect candidate area exists, acquiring a surface image based on the defect candidate area, and performing defect detection based on the surface image based on the defect candidate area includes: Acquire a surface image based on the defect candidate area from a third detection direction, and obtain a depth value of each point in the surface image based on the defect candidate area relative to the third detection direction, wherein the third detection direction is different from both the first detection direction and the second detection direction; The positions of the defects corresponding to the defect candidate area are determined according to the depth values ​​of the respective points relative to the third detection direction.

6. The method according to claim 5, wherein: Determining, according to the depth values ​​of the respective points relative to the third detection direction, positions of defects corresponding to the defect candidate area includes: Acquire a plane area in the surface image based on the defect candidate area according to the depth value of each point relative to the third detection direction; Performing plane fitting on the plane area, and determining the positions of one or more defects according to the results of the plane fitting.

7. A surface inspection device comprising: an acquiring unit configured to acquire at least first edge detection data and second edge detection data, wherein the first edge detection data is a first surface profile obtained by detecting a plurality of different positions of the surface along a first detection direction of the edge of the surface, and the second edge detection data is a second surface profile obtained by detecting a plurality of different positions of the surface along a second detection direction of the edge of the surface, wherein the first detection direction and the second detection direction are non-parallel; a determining unit configured to determine whether a defect candidate area exists on the surface based on at least the first edge detection data and the second edge detection data; a detection unit configured to, when determining that the defect candidate area exists on the surface, acquire a surface image based on the defect candidate area, and perform defect detection based on the surface image based on the defect candidate area; Wherein, the determining unit determines whether the first surface profile has a first non-planar area, and whether the second surface profile has a second non-planar area; When the first surface profile has a first non-planar area and the second surface profile has a second non-planar area, respectively acquiring at least one first non-planar area of ​​the first surface profile and at least one second non-planar area of ​​the second surface profile; One or more intersection regions indicated by at least one of the first non-planar region and at least one of the second non-planar region on the surface are used as the defect candidate regions.

8. A surface inspection device comprising: processor; and a memory having computer program instructions stored therein, When the computer program instructions are executed by the processor, the processor is caused to perform the following steps: Acquiring at least first edge detection data and second edge detection data, wherein the first edge detection data is a first surface profile obtained by detecting a plurality of different positions of the surface along a first detection direction of the edge of the surface, and the second edge detection data is a second surface profile obtained by detecting a plurality of different positions of the surface along a second detection direction of the edge of the surface, wherein the first detection direction and the second detection direction are non-parallel; determining whether a defect candidate region exists on the surface based on at least the first edge detection data and the second edge detection data; When it is determined that the defect candidate area exists on the surface, acquiring a surface image based on the defect candidate area, and performing defect detection based on the surface image based on the defect candidate area; Wherein, determining whether a defect candidate area exists according to at least the first edge detection data and the second edge detection data includes: Determining whether the first surface profile has a first non-planar area and whether the second surface profile has a second non-planar area; When the first surface profile has a first non-planar area and the second surface profile has a second non-planar area, respectively acquiring at least one first non-planar area of ​​the first surface profile and at least one second non-planar area of ​​the second surface profile; One or more intersection regions indicated by at least one of the first non-planar region and at least one of the second non-planar region on the surface are used as the defect candidate regions.

9. A computer-readable storage medium having computer program instructions stored thereon, wherein: When the computer program instructions are executed by a processor, the following steps are implemented: Acquiring at least first edge detection data and second edge detection data, wherein the first edge detection data is a first surface profile obtained by detecting a plurality of different positions of the surface along a first detection direction of the edge of the surface, and the second edge detection data is a second surface profile obtained by detecting a plurality of different positions of the surface along a second detection direction of the edge of the surface, wherein the first detection direction and the second detection direction are non-parallel; determining whether a defect candidate region exists on the surface based on at least the first edge detection data and the second edge detection data; When it is determined that the defect candidate area exists on the surface, acquiring a surface image based on the defect candidate area, and performing defect detection based on the surface image based on the defect candidate area; Wherein, determining whether a defect candidate area exists according to at least the first edge detection data and the second edge detection data includes: Determining whether the first surface profile has a first non-planar area and whether the second surface profile has a second non-planar area; When the first surface profile has a first non-planar area and the second surface profile has a second non-planar area, respectively acquiring at least one first non-planar area of ​​the first surface profile and at least one second non-planar area of ​​the second surface profile; One or more intersection regions indicated by at least one of the first non-planar region and at least one of the second non-planar region on the surface are used as the defect candidate regions.

Citation Information

Patent Citations

  • Coarse-fine optical surface defect detection method and coarse-fine optical surface defect detection device

    CN105447512A

  • Real time surface defect analysis and correction in friction stir welding process by image processing

    IN201831035477A

  • Method and device for detecting line defect on panel

    JP2005172559A