Surface defect detection method, system, electronic device and storage medium

Through the 2.5D imaging system and Gaussian bandpass frequency domain filtering method, combined with 3D point cloud map alignment, the problem of low accuracy of object surface defect detection is solved, efficient identification and distinction of subtle defects is achieved, and detection efficiency and accuracy are improved. .

CN118655084BActive Publication Date: 2024-12-24HANGZHOU LINGXI ROBOT INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411148073.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-24
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

In the prior art, the detection accuracy of surface defects of objects is low, especially fine or low contrast defects, which are difficult to accurately identify, and the detection efficiency is not high.

Method used

The 2.5D image set of the target object is obtained by using a 2.5D imaging system, and the high-speed line scanning camera and high-speed stripe line scanning light source are combined with the Gaussian band pass frequency domain filtering method and 3D point cloud map alignment to achieve high contrast display of the concave and convex conditions on the surface of the object. and defect detection.

Benefits of technology

It improves the accuracy and efficiency of defect detection, can clearly distinguish defect areas from normal surfaces, and enhances the ability to identify subtle defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118655084B_ABST
    Figure CN118655084B_ABST
Patent Text Reader

Abstract

The present application relates to a surface defect detection method and system, and relates to the field of defect detection. The method includes: obtaining a 2.5D image set of a target object through a 2.5D imaging system, removing the background of the images in the 2.5D image set to obtain a main 2.5D image set of the target object, obtaining a shape map from the main 2.5D image set, and performing surface defect detection on the target object according to the shape map based on a Gaussian bandpass frequency domain filtering method. The shape map is synthesized from images obtained by a light source at different phases, and characterizes the surface concave-convex conditions of the target object. Through this application, the problem of low accuracy in detecting surface defects of objects is solved. The 2.5D image set obtained by the 2.5D imaging system has good imaging effect for subtle defects. The shape map displays the changes in the concave-convex conditions of the battery surface with high contrast, so that the defect area is distinguished from the normal surface, thereby improving the accuracy and efficiency of defect detection.
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 defect detection method, system, electronic device and storage medium. Background Art

[0002] Appearance inspection is a key quality control step in the manufacturing process of some products (e.g., cylindrical batteries), and is usually divided into three main methods: manual inspection, traditional 2D image inspection, and deep learning-based inspection.

[0003] Manual inspection relies on the visual judgment of workers to identify defects, which is inefficient, and long-term repetitive work can easily lead to visual fatigue of the operator, affecting the accuracy of judgment; traditional 2D image detection technology uses a high-resolution camera to capture images of the battery surface and uses image processing technology to identify defects. 2D image detection is greatly affected by the shooting angle and lighting conditions, which may result in poor imaging quality of defects, making some subtle or low-contrast defects difficult to accurately identify; deep learning detection methods automatically identify and classify defects on the battery surface by training algorithm models. Deep learning models usually require a large amount of labeled data for training. For specific defects with a small sample size, the detection capability may be reduced.

[0004] Currently, no effective solution has been proposed for the problem of low accuracy in object surface defect detection in related technologies. Summary of the invention

[0005] The embodiments of the present application provide a surface defect detection method, system, electronic device and storage medium to at least solve the problem of low accuracy in object surface defect detection in the related art.

[0006] In a first aspect, an embodiment of the present application provides a surface defect detection method, the method comprising:

[0007] Acquire a 2.5D image set of the target object by a 2.5D imaging system, wherein the 2.5D imaging system includes a high-speed line scanning camera and a high-speed stripe line scanning light source;

[0008] Performing background removal on the images in the 2.5D image set to obtain a main 2.5D image set of the target object;

[0009] A shape map is obtained from the 2.5D image set of the subject, and surface defect detection of the target object is performed according to the shape map based on a Gaussian bandpass frequency domain filtering method. The shape map is synthesized by images obtained by a light source at different phases, and characterizes the surface concave-convexity of the target object.

[0010] In some embodiments, the surface defect detection of the target object based on the shape graph based on the Gaussian bandpass frequency domain filtering method includes:

[0011] Performing Gaussian bandpass frequency domain filtering on the shape graph to obtain a filtered graph;

[0012] Obtaining a difference map before and after filtering according to the filter map and the shape map;

[0013] Binarizing the difference map to obtain the surface defect map;

[0014] Surface defect data of the target object is obtained according to the surface defect map.

[0015] In some embodiments, binarizing the difference map to obtain the surface defect map includes:

[0016] Generate a defect circumscribed rectangular frame based on the difference map, and determine a binarization threshold according to the grayscale values ​​of pixels within the defect circumscribed rectangular frame;

[0017] Based on the binarization threshold, the difference map is binarized to obtain the surface defect map.

[0018] In some embodiments, performing Gaussian bandpass frequency domain filtering on the shape graph to obtain a filtered graph comprises:

[0019] Determining the number of pixel rows and pixel columns of the shape graph, and generating a Gaussian kernel based on the number of pixel rows and the number of pixel columns;

[0020] Based on Fourier transform, spatial filtering is performed on the shape image according to the Gaussian kernel to obtain a filtered image.

[0021] In some embodiments, the surface defect data includes coordinate data of the defect in the shape map, and the method further includes:

[0022] Acquire a 3D point cloud image of the target object;

[0023] Aligning the 3D point cloud image with the shape image, and obtaining 3D coordinate data of the defect in the 3D point cloud image according to the alignment result and the coordinate data of the defect in the shape image;

[0024] Based on the 3D coordinate data, 3D data of the surface defects of the target object are obtained from the 3D point cloud image.

[0025] In some embodiments, the coordinate data of the defect in the shape map includes a defect circumscribed rectangular frame of the defect in the shape map, and 2.5D coordinate data of the defect circumscribed rectangular frame;

[0026] The aligning the 3D point cloud image with the shape image, and obtaining the 3D coordinate data of the defect in the 3D point cloud image according to the alignment result and the coordinate data of the defect in the shape image comprises:

[0027] Generating a first main body circumscribed rectangular frame of the target object according to the main body 2.5D image set;

[0028] Performing background removal on the 3D point cloud image to obtain a second main body circumscribed rectangular frame of the target object;

[0029] The 3D coordinate data of the defect circumscribed rectangular frame in the 3D point cloud image is determined according to the 2.5D coordinate data, the first main body circumscribed rectangular frame and the second main body circumscribed rectangular frame.

[0030] In some embodiments, the method further comprises:

[0031] comparing the defect data with a preset defect threshold,

[0032] If the defect data is less than or equal to the preset defect threshold, the target object is a qualified product.

[0033] If the defect data is greater than a preset defect threshold, the target object is a defective product.

[0034] In a second aspect, an embodiment of the present application provides a surface defect detection system, the system comprising: an acquisition module, a processing module and a detection module, wherein:

[0035] The acquisition module is used to acquire a 2.5D image set of the target object through a 2.5D imaging system, wherein the 2.5D imaging system includes a high-speed line scanning camera and a high-speed stripe line scanning light source;

[0036] The processing module is used to remove the background of the images in the 2.5D image set to obtain a main 2.5D image set of the target object;

[0037] The detection module is used to obtain a shape map from the main body 2.5D image set, and based on a Gaussian bandpass frequency domain filtering method, perform surface defect detection on the target object according to the shape map. The shape map is synthesized by images obtained by a light source at different phases, and represents the surface convexity of the target object.

[0038] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the surface defect detection method as described in the first aspect above is implemented.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the surface defect detection method as described in the first aspect above.

[0040] Compared with the related art, the surface defect detection method provided in the embodiment of the present application obtains a 2.5D image set of the target object through a 2.5D imaging system. The 2.5D imaging system includes a high-speed line scan camera and a high-speed stripe line scan light source. The background of the images in the 2.5D image set is removed to obtain a main 2.5D image set of the target object, and a shape map is obtained from the main 2.5D image set. Based on the Gaussian bandpass frequency domain filtering method, surface defect detection is performed on the target object according to the shape map. The shape map is synthesized by images obtained by the light source at different phases, and characterizes the surface concave-convex conditions of the target object. The 2.5D image set obtained by the 2.5D imaging system has a good imaging effect of subtle defects. The shape map displays the concave-convex changes of the battery surface with high contrast, so that the defect area is distinguished from the normal surface, thereby improving the accuracy and efficiency of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0042] Figure 1 is a flow chart of a surface defect detection method according to an embodiment of the present application;

[0043] Figure 2 is a flow chart of a Gaussian bandpass frequency domain filtering detection method according to an embodiment of the present application;

[0044] Figure 3 is a flow chart of a surface defect detection method according to an embodiment of the present application;

[0045] Figure 4 is a structural block diagram of a surface defect detection system according to an embodiment of the present application;

[0046] Figure 5 It is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0048] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.

[0049] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0050] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0051] This embodiment provides a surface defect detection method. Figure 1 is a flow chart of a surface defect detection method according to an embodiment of the present application, such as Figure 1 As shown, the process includes the following steps:

[0052] Step S101 , obtaining a 2.5D image set of a target object through a 2.5D imaging system, wherein the 2.5D imaging system includes a high-speed line scan camera and a high-speed stripe line scan light source.

[0053] The high-speed line scan camera is used to obtain an image of the object to be scanned. The light source used in the 2.5D imaging system is a dedicated high-speed stripe line scan light source, which can emit stripe light while changing the phase to achieve high-speed changes in the stripes, thereby achieving synchronization with the high-speed shooting of the camera. The 2.5D imaging system may also include a controller for controlling the line scan light source and the high-speed line scan camera.

[0054] A 2.5D image set of the target object surface is obtained through a 2.5D imaging system. The 2.5D image set includes an average image, a specular reflection image, a diffuse reflection image, a gloss ratio image, a depth map and a shape map. The shape map is obtained by decoding and synthesizing images obtained at different phases of the light source, and represents the surface concave-convex changes of the target object.

[0055] Step S102, performing background removal on the images in the 2.5D image set to obtain a main 2.5D image set of the target object.

[0056] The 2.5D image set is preprocessed, including removing the background and extracting the main area of ​​the target object, ensuring that the image only contains information about the target object itself, and calculating the position and size of the circumscribed rectangle of the main area of ​​the target object.

[0057] In traditional single 2D image processing, background removal requires complex steps to distinguish the main contour of the target object. In this embodiment, images with less background interference can be selected from the 2.5D image set to quickly extract the main area of ​​the target object through simple binarization, and the extracted main area of ​​the target object is applicable to all images in the group, thereby maintaining the consistency of processing and improving processing efficiency.

[0058] Step S103, obtaining a shape map from the main 2.5D image set, and performing surface defect detection on the target object according to the shape map based on the Gaussian bandpass frequency domain filtering method. The shape map is synthesized by images obtained by the light source at different phases, and represents the surface concave-convex condition of the target object.

[0059] It should be noted that the shape image is a shape image after the background is removed and the main area of ​​the target object is extracted.

[0060] In this embodiment, a shape map with relatively obvious concave-convex changes is selected for defect detection. For defects with concave-convex changes, such as when the target object is a cylindrical battery, the shape map is helpful for detecting surface scratches, pits and welding slag of the cylindrical battery. The shape map shows the concave-convex changes on the battery surface with high contrast, distinguishing the defective area from the normal surface, and improving the recognition accuracy and efficiency of height difference defects that are difficult to detect with conventional plane images.

[0061] In some embodiments, the surface defect detection of the target object according to the shape graph based on the Gaussian bandpass frequency domain filtering method in step S103 includes:

[0062] Step S1031, performing Gaussian bandpass frequency domain filtering on the shape graph to obtain a filtered graph.

[0063] In some embodiments, step S1031 specifically includes:

[0064] Step S201, determining the number of pixel rows and pixel columns of the shape image, and generating a Gaussian kernel based on the number of pixel rows and pixel columns.

[0065] Assume that the number of pixel rows in the shape image is M, the number of pixel columns is N, and σ 1 Generate N*1 dimensional Gaussian kernel G respectively 11 and M*1-dimensional Gaussian kernel G 12, and calculate the M*N dimensional Gaussian kernel G 1 :

[0066]

[0067] Among them, α 11 and α 12 express The scaling factor is , and T represents the transpose.

[0068] Then, by the same method, 2 (σ 2 > σ 1 ) Calculate the M*N dimensional Gaussian kernel G 2 .

[0069] Step S202 , based on Fourier transform, spatial filtering is performed on the shape image according to the Gaussian kernel to obtain a filtered image.

[0070] Calculate the Gaussian kernel difference G 3 :

[0071] G 3 =G 2 -G 1

[0072] Rearrange G 3 Get G' 3 , for G' 3 Perform discrete Fourier transform and obtain G(u,v).

[0073] Take a Fourier transform of the shape map:

[0074]

[0075] Where F(u,v) is the frequency domain result of the discrete Fourier transform of the shape image f(m,n), M and N represent the number of rows and columns of the image, u and v represent the frequency domain pixel coordinates, m and n represent the spatial domain pixel coordinates, and j represents the imaginary unit.

[0076] Multiply F(u,v) by G(u,v) to get H(u,v):

[0077] H(u,v)=F(u,v)*G(u,v)

[0078] Then, perform inverse discrete Fourier transform on H(u,v) to obtain the spatial domain filtering result:

[0079]

[0080] f'(m,n) is the filtered image after spatial filtering of the shape image.

[0081] Step S1032, obtaining a difference map before and after filtering according to the filter map and the shape map.

[0082] Subtract the filtered image f'(m,n) from f(m,n) to get the difference image f before and after filtering sub :

[0083] f sub =|f'(m,n)-f(m,n)|

[0084] Here, |.| represents the absolute value.

[0085] Step S1033, binarizing the difference map to obtain a surface defect map.

[0086] In some embodiments, step S1033 specifically includes:

[0087] Step S301, generating a defect bounding rectangle based on the difference map, and determining a binarization threshold according to the grayscale values ​​of the pixels in the defect bounding rectangle.

[0088] Step S302: binarize the difference image based on the binarization threshold to obtain a surface defect image.

[0089] Set the size of the defect's bounding rectangle to w b *h b , calculate the average value μ and variance δ of the grayscale value of the pixels within the defect's circumscribed rectangular frame, and set the threshold t:

[0090] t=μ+k*δ

[0091] Where k is the preset coefficient. sub Perform local binarization to obtain the defect map f bin :

[0092]

[0093] Step S1034, obtaining surface defect data of the target object according to the surface defect map.

[0094] Surface defect data includes but is not limited to defect location and size. Figure 2 This is a flow chart of a Gaussian bandpass frequency domain filtering detection method according to an embodiment of the present application. In this embodiment, a Gaussian bandpass frequency domain filtering method is used to detect defects and calculate the defect location and size information. The Gaussian bandpass filter allows signals in a specific frequency range to pass through, which can effectively enhance specific details in the image while suppressing excessively high or low frequency components, thereby improving the detection accuracy of defects with a specific frequency range in the frequency domain.

[0095] In some embodiments, the surface defect data includes coordinate data of the defect in the shape map, and the method further includes:

[0096] Step S1035, obtaining a 3D point cloud image of the target object;

[0097] Step S1036, aligning the 3D point cloud image with the shape image, and obtaining the 3D coordinate data of the defect in the 3D point cloud image based on the alignment result and the coordinate data of the defect in the shape image.

[0098] To measure non-3D defect information, such as scratch length and solder joint area, only the defect image f bin Simple statistical processing is performed, and to measure 3D defect information, such as the actual depth of scratches, pits, and solder joints, it is necessary to obtain their 3D information for depth measurement.

[0099] In the point cloud image, it is difficult to locate slight and small defects due to the influence of noise and fluctuation accuracy. High-precision 3D cameras are expensive. Therefore, in this embodiment, 2.5D images are used to locate defects, which are then aligned with the 3D point cloud image for defect measurement. Figure 3 It is a flow chart of a surface defect detection method according to an embodiment of the present application.

[0100] The resolution of the 2.5D image is different from that of the 3D point cloud image, and the position of the target object in the image is also different. The defect coordinates of the 2.5D image need to be mapped to the 3D point cloud image.

[0101] In some embodiments, the coordinate data of the defect in the shape map includes the defect circumscribed rectangular frame of the defect in the shape map, and the 2.5D coordinate data of the defect circumscribed rectangular frame; step S1036 specifically includes:

[0102] Step S401 : generating a first main body circumscribed rectangular frame of a target object according to a main body 2.5D image set.

[0103] Step S402: removing the background of the 3D point cloud image to obtain a second main body circumscribed rectangular frame of the target object.

[0104] Step S403, determining the 3D coordinate data of the defect circumscribed rectangular frame in the 3D point cloud image according to the 2.5D coordinate data, the first main body circumscribed rectangular frame and the second main body circumscribed rectangular frame.

[0105] Optionally, the acquired 3D point cloud image is denoised and the main area of ​​the target object is extracted, and the circumscribed rectangular frame of the main area of ​​the target object is calculated, with a width and a length of w respectively. 3d ,h 3d At the same time, the width and length of the bounding rectangle of the main area of ​​the target object in the shape image are calculated as w 2.5d ,h2.5d The width and length of the defect circumscribed rectangle are w d ,h d , the coordinates of the upper left corner are (m d , n d ). The defect coordinates in the 2.5D shape image are mapped to the 3D point cloud image:

[0106]

[0107] (m' d , n' d ) is the mapping coordinate of the upper left corner of the defect circumscribed rectangular box in the 3D point cloud image, w' d , h' d are the width and length of the defect's circumscribed rectangle, respectively.

[0108] Step S1037, based on the 3D coordinate data, obtaining 3D data of surface defects of the target object from the 3D point cloud image.

[0109] It should be noted that for mapping the 2.5D image defect coordinates to the 3D point cloud, the image can also be aligned by feature point matching, and then the coordinates can be converted. After the defect is located in the 3D point cloud, the point cloud distance value can be used to calculate the required defect depth information.

[0110] In some embodiments, the method further comprises:

[0111] The defect data is compared with a preset defect threshold. If the defect data is less than or equal to the preset defect threshold, the target object is a qualified product. If the defect data is greater than the preset defect threshold, the target object is a failed product.

[0112] When the target item is a product that needs to be tested for compliance, the length, width, and depth information of each type of defect extracted is calculated and compared with the standard threshold for detection. If it is lower than the standard threshold, it is considered a qualified product, and if it is higher than the standard threshold, it is considered an unqualified product.

[0113] Through the above steps S101 to S103, a 2.5D image set of the target object is obtained by using a 2.5D imaging system. The 2.5D imaging system includes a high-speed line scan camera and a high-speed stripe line scan light source. The background of the image in the 2.5D image set is removed to obtain a main 2.5D image set of the target object. A shape map is obtained from the main 2.5D image set. Based on the Gaussian bandpass frequency domain filtering method, surface defect detection of the target object is performed according to the shape map. The shape map is synthesized by images obtained by the light source at different phases, which characterizes the surface concave and convex conditions of the target object and solves the problem of low accuracy in surface defect detection of the object. The 2.5D image set obtained by the 2.5D imaging system has good imaging effect of subtle defects. The shape map displays the concave and convex changes of the battery surface with high contrast, so that the defect area is distinguished from the normal surface, thereby improving the accuracy and efficiency of defect detection.

[0114] The main area of ​​the target object is quickly extracted by selecting images with less background interference from the 2.5D image set through simple binarization. The extracted main area of ​​the target object is applicable to all images in the group, which maintains the consistency of processing and improves the processing efficiency.

[0115] Shape maps are used for defect detection. Shape maps show the changes in the concave and convex surfaces of the battery with high contrast, distinguishing the defective area from the normal surface, thereby improving the accuracy and efficiency of identifying height difference defects that are difficult to detect with conventional plane images.

[0116] The defects detected by the 2.5D image are mapped to the 3D point cloud map to obtain the 3D information of the defects, and further perform qualitative and quantitative analysis of the defects.

[0117] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0118] This embodiment also provides a surface defect detection system, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the terms "module", "unit", "subunit", etc. can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0119] Figure 4 is a structural block diagram of a surface defect detection system according to an embodiment of the present application, such as Figure 4 As shown, the system includes: an acquisition module 51, a processing module 52 and a detection module 53.

[0120] The acquisition module 51 is used to acquire a 2.5D image set of the target object through a 2.5D imaging system, where the 2.5D imaging system includes a high-speed line scanning camera and a high-speed stripe line scanning light source.

[0121] The processing module 52 is used to remove the background of the images in the 2.5D image set to obtain a main 2.5D image set of the target object.

[0122] The detection module 53 obtains a shape map from the main body 2.5D image set, and performs surface defect detection on the target object according to the shape map based on the Gaussian bandpass frequency domain filtering method. The shape map is synthesized by images obtained by the light source at different phases, and represents the surface convexity of the target object.

[0123] In some embodiments, the detection module 53 includes: a filtering module, a difference module, a defect map generation module and a defect data acquisition module.

[0124] A filtering module, used for performing Gaussian bandpass frequency domain filtering on the shape graph to obtain a filtered graph;

[0125] The difference module is used to obtain the difference image before and after filtering based on the filter image and the shape image.

[0126] The defect map generation module is used to binarize the difference map to obtain a surface defect map.

[0127] The defect data acquisition module is used to obtain the surface defect data of the target object according to the surface defect map.

[0128] In some of the embodiments, the defect map generating module includes: a threshold determination module and a binarization module.

[0129] The threshold determination module is used to generate a defect circumscribed rectangular frame based on the difference map, and determine the binarization threshold according to the grayscale value of the pixel points in the defect circumscribed rectangular frame.

[0130] The binarization module is used to binarize the difference image based on the binarization threshold to obtain a surface defect image.

[0131] In some of the embodiments, the filtering module includes: a Gaussian kernel generation module and a filter map generation module.

[0132] A Gaussian kernel generation module, used for determining the number of pixel rows and pixel columns of the shape image, and generating a Gaussian kernel based on the number of pixel rows and pixel columns;

[0133] The filter image generation module is used to perform spatial filtering on the shape image based on Fourier transform and Gaussian kernel to obtain the filter image.

[0134] In some of the embodiments, the surface defect data includes coordinate data of the defect in the shape map, and the system further includes: a point cloud generation module, a mapping module and a 3D data acquisition module.

[0135] The point cloud generation module is used to obtain the 3D point cloud image of the target object.

[0136] The mapping module is used to align the 3D point cloud image with the shape image, and obtain the 3D coordinate data of the defect in the 3D point cloud image according to the alignment result and the coordinate data of the defect in the shape image.

[0137] The 3D data acquisition module is used to acquire 3D data of surface defects of the target object from the 3D point cloud image based on the 3D coordinate data.

[0138] In some embodiments, the coordinate data of the defect in the shape map includes the defect circumscribed rectangular box in the shape map and the 2.5D coordinate data of the defect circumscribed rectangular box; the mapping module includes: a first frame module, a second frame module and a coordinate determination module.

[0139] The first frame module is used to generate a first main body circumscribed rectangular frame of the target object according to the main body 2.5D image set.

[0140] The second frame module is used to remove the background of the 3D point cloud image to obtain a second main body circumscribed rectangular frame of the target object;

[0141] The coordinate determination module is used to determine the 3D coordinate data of the defect circumscribed rectangular frame in the 3D point cloud image according to the 2.5D coordinate data, the first main body circumscribed rectangular frame and the second main body circumscribed rectangular frame.

[0142] In some of the embodiments, the system further includes: a judgment module.

[0143] The judgment module is used to compare the defect data with a preset defect threshold. If the defect data is less than or equal to the preset defect threshold, the target object is a qualified product. If the defect data is greater than the preset defect threshold, the target object is a failed product.

[0144] Through the above system, the acquisition module 51 acquires a 2.5D image set of the target object through a 2.5D imaging system, the 2.5D imaging system includes a high-speed line scan camera and a high-speed stripe line scan light source, the processing module 52 removes the background of the image in the 2.5D image set to obtain a main 2.5D image set of the target object, and the detection module 53 acquires a shape map from the main 2.5D image set, and performs surface defect detection on the target object according to the shape map based on a Gaussian bandpass frequency domain filtering method. The shape map is synthesized by images acquired by the light source at different phases, and characterizes the surface concave-convex condition of the target object, thereby solving the problem of low accuracy in detecting surface defects of the object. The 2.5D image set acquired by the 2.5D imaging system has good imaging effect for subtle defects, and the shape map displays the concave-convex changes of the battery surface with high contrast, so that the defective area is distinguished from the normal surface, thereby improving the accuracy and efficiency of defect detection.

[0145] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0146] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0147] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0148] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0149] S1, acquiring a 2.5D image set of a target object through a 2.5D imaging system, wherein the 2.5D imaging system includes a high-speed line scanning camera and a high-speed stripe line scanning light source.

[0150] S2, performing background removal on the images in the 2.5D image set to obtain a main 2.5D image set of the target object.

[0151] S3, obtains a shape map from the main 2.5D image set, and performs surface defect detection on the target object based on the shape map based on the Gaussian bandpass frequency domain filtering method. The shape map is synthesized by images obtained by the light source at different phases, and represents the surface concave-convexity of the target object.

[0152] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0153] In one embodiment, Figure 5 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application, such as Figure 5 As shown, an electronic device is provided, which may be a server, and its internal structure diagram may be as shown in Figure 5 As shown. The electronic device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a surface defect detection method is implemented.

[0154] Those skilled in the art will understand that Figure 5 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0155] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

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

[0157] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A surface defect detection method, characterized in that: The method comprises: Acquire a 2.5D image set of the target object by a 2.5D imaging system, wherein the 2.5D imaging system includes a high-speed line scanning camera and a high-speed stripe line scanning light source; Performing background removal on the images in the 2.5D image set to obtain a main 2.5D image set of the target object; A shape map is obtained from the 2.5D image set of the subject, and surface defect detection of the target object is performed based on the shape map based on a Gaussian bandpass frequency domain filtering method to obtain surface defect data of the target object, wherein the surface defect data includes coordinate data of the defect in the shape map, and the shape map is synthesized by images obtained by a light source at different phases, and represents the surface concave-convex condition of the target object; Acquire a 3D point cloud image of the target object; Aligning the 3D point cloud image with the shape image, and obtaining 3D coordinate data of the defect in the 3D point cloud image according to the alignment result and the coordinate data of the defect in the shape image; Based on the 3D coordinate data, 3D data of the surface defects of the target object are obtained from the 3D point cloud image.

2. The method according to claim 1, characterized in that The surface defect detection of the target object based on the shape graph based on the Gaussian bandpass frequency domain filtering method includes: Performing Gaussian bandpass frequency domain filtering on the shape graph to obtain a filtered graph; Obtaining a difference map before and after filtering according to the filter map and the shape map; Binarizing the difference map to obtain a surface defect map; Surface defect data of the target object is obtained according to the surface defect map.

3. The method according to claim 2, characterized in that Binarizing the difference map to obtain the surface defect map includes: Generate a defect circumscribed rectangular frame based on the difference map, and determine a binarization threshold according to the grayscale values ​​of pixels within the defect circumscribed rectangular frame; Based on the binarization threshold, the difference map is binarized to obtain the surface defect map.

4. The method according to claim 2, characterized in that: The performing of Gaussian bandpass frequency domain filtering on the shape graph to obtain a filtered graph comprises: Determining the number of pixel rows and pixel columns of the shape graph, and generating a Gaussian kernel based on the number of pixel rows and the number of pixel columns; Based on Fourier transform, spatial filtering is performed on the shape image according to the Gaussian kernel to obtain a filtered image.

5. The method according to claim 1, characterized in that: The coordinate data of the defect in the shape map includes a defect circumscribed rectangular frame of the defect in the shape map, and 2.5D coordinate data of the defect circumscribed rectangular frame; The aligning the 3D point cloud image with the shape image, and obtaining the 3D coordinate data of the defect in the 3D point cloud image according to the alignment result and the coordinate data of the defect in the shape image comprises: Generating a first main body circumscribed rectangular frame of the target object according to the main body 2.5D image set; Performing background removal on the 3D point cloud image to obtain a second main body circumscribed rectangular frame of the target object; The 3D coordinate data of the defect circumscribed rectangular frame in the 3D point cloud image is determined according to the 2.5D coordinate data, the first main body circumscribed rectangular frame and the second main body circumscribed rectangular frame.

6. The method according to claim 2, characterized in that The method further comprises: comparing the defect data with a preset defect threshold, If the defect data is less than or equal to the preset defect threshold, the target object is a qualified product. If the defect data is greater than a preset defect threshold, the target object is a defective product.

7. A surface defect detection system, characterized in that: The system comprises: an acquisition module, a processing module and a detection module, wherein: The acquisition module is used to acquire a 2.5D image set of the target object through a 2.5D imaging system, wherein the 2.5D imaging system includes a high-speed line scanning camera and a high-speed stripe line scanning light source; The processing module is used to remove the background of the images in the 2.5D image set to obtain a main 2.5D image set of the target object; The detection module is used to obtain a shape map from the main body 2.5D image set, and based on a Gaussian bandpass frequency domain filtering method, perform surface defect detection on the target object according to the shape map to obtain surface defect data of the target object, wherein the surface defect data includes coordinate data of the defect in the shape map, and the shape map is synthesized by images obtained by a light source at different phases, and represents the surface concave-convex condition of the target object; Acquire a 3D point cloud image of the target object; Aligning the 3D point cloud image with the shape image, and obtaining 3D coordinate data of the defect in the 3D point cloud image according to the alignment result and the coordinate data of the defect in the shape image; Based on the 3D coordinate data, 3D data of the surface defects of the target object are obtained from the 3D point cloud image.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the surface defect detection method according to any one of claims 1 to 6 is implemented.

9. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the surface defect detection method according to any one of claims 1 to 6 is implemented.