Surface defect detection method and apparatus

By combining image acquisition technology with a line scan camera and a spherical integrating light source, along with photometric stereo algorithms and deep learning, the problem of low efficiency in detecting surface defects in flexible battery cells has been solved, achieving efficient and accurate defect detection.

CN119804319BActive Publication Date: 2026-06-23GUANGDONG AOPUTE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG AOPUTE TECH CO LTD
Filing Date
2024-12-23
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

In existing technologies, the surface defect detection efficiency of flexible packaging battery cells is low and it is difficult to accurately capture minute defects, resulting in defective products flowing into subsequent processes and affecting product quality.

Method used

Image acquisition is performed using a line scan camera and multiple spherical integral light sources. By combining photometric stereo algorithm and deep learning, a target detection model is trained to achieve surface defect detection.

Benefits of technology

It improves the accuracy and efficiency of defect detection, reduces shadowing issues, optimizes the user experience, and adapts to various detection environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119804319B_ABST
    Figure CN119804319B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing and machine vision technology, and discloses a surface defect detection method and device.The method comprises the following steps: providing a line scanning camera and a plurality of spherical integral light sources, different spherical integral light sources having different fixed illumination directions; moving a to-be-detected object at a preset speed and trajectory, and in the moving process of the to-be-detected object, controlling all spherical integral light sources to illuminate at intervals, and continuously shooting the to-be-detected object by the line scanning camera to obtain an image of the to-be-detected object; splitting the image of the to-be-detected object into sub-images consistent with the number of spherical integral light sources; reconstructing an average curvature image of the to-be-detected object; performing image conversion on the average curvature image to obtain an enhanced image; training a target detection model, and using the target detection model to detect surface defects; the present application uses a plurality of spherical integral light sources in combination with a line scanning camera to effectively ensure image quality, and the light source openings of the spherical integral light sources are arranged in the form of thin strips, which can reduce the shadow problem existing in the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of image processing and machine vision technology, and in particular to methods and apparatus for surface defect detection. Background Technology

[0002] In the industrial manufacturing process, the detection of surface defects is a crucial step, especially in the new energy field. During the manufacturing of products such as batteries and cells, various surface defects often occur, including scratches, dents, blistering, abrasions, and dents.

[0003] Taking the surface defect detection of flexible battery cells as an example, existing surface defect detection methods mainly include manual inspection and machine-based visual inspection. Manual inspection is inefficient and difficult to meet quality control requirements, while traditional visual inspection uses two-dimensional imaging methods. This method is usually carried out under single light source and fixed optical path conditions, and the imaging effect for tiny defects is often unsatisfactory. In addition, surface defects may have special shapes, depths, or orientations, which are difficult for two-dimensional imaging methods to capture accurately. As a result, these surface defects cannot be detected in time during the surface defect detection process, leading to defective products flowing into subsequent processes and easily having a negative impact on the quality of the finished product.

[0004] Therefore, there is an urgent need for methods, systems, and storage media for detecting surface defects in pouch cells to overcome the aforementioned defects. Summary of the Invention

[0005] The purpose of this invention is to provide a surface defect detection method and apparatus to solve or at least partially solve the technical problems existing in the prior art.

[0006] To achieve this objective, the present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a surface defect detection method, which includes the following steps:

[0008] S1. Provides a line scan camera with a fixed shooting position and multiple spherical integrating light sources, wherein different spherical integrating light sources have different fixed illumination directions;

[0009] S2. Move the object to be detected at a preset speed and trajectory, and during the movement of the object to be detected, control all spherical integrating light sources to illuminate at intervals, and continuously capture images of the object to be detected through the line scan camera to obtain images of the object to be detected;

[0010] S3. The image of the object to be detected is divided into sub-images with the same number of spherical integrating light sources. The image information contained in each sub-image is obtained by the line scan camera under the independent illumination of the corresponding spherical integrating light source.

[0011] S4. Reconstruct the average curvature image of the object to be detected based on all sub-images;

[0012] S5. Perform image transformation on the average curvature image to obtain an enhanced image of the prominent defect area of ​​the average curvature image;

[0013] S6. Use the enhanced image as training data to train the target detection model, and use the trained target detection model to detect surface defects.

[0014] Preferably, the light source opening of the spherical integrating light source is arranged in a thin strip shape.

[0015] Preferably, step S2 specifically includes:

[0016] S21. Place the object to be tested on the mobile platform;

[0017] S22. Adjust the moving speed and trajectory of the mobile platform, and use the mobile platform to move the object to be detected at a preset speed and trajectory;

[0018] S23. During the movement of the object to be detected, all spherical integral light sources are controlled to illuminate at intervals by a combination of time-division strobe triggering and frame triggering, and the object to be detected is continuously photographed by the line scan camera to obtain an image of the object to be detected.

[0019] Preferably, step S1 further includes:

[0020] The spherical integrating light source is calibrated.

[0021] Specifically, the calibration of the spherical integrating light source includes:

[0022] Place the calibration ball on the testing platform;

[0023] Control all spherical integrating light sources to illuminate at intervals, and continuously capture images of the calibration sphere using the line scan camera to obtain calibration images of the calibration sphere under independent illumination by each of the spherical integrating light sources;

[0024] Analyze the center pixel coordinates and highlight center pixel coordinates of the calibration sphere in each calibration image;

[0025] Based on the radius of the calibration sphere, and the pixel coordinates of the center of the calibration sphere and the pixel coordinates of the highlight center of the calibration sphere in each calibration image, calculate the light source vector of each sphere integral light source;

[0026] Based on the light source vector of each sphere integral light source, light source calibration is performed on each sphere integral light source.

[0027] Preferably, in step S3, splitting the image of the object to be detected into sub-images with the same number of spherical integral light sources specifically includes:

[0028] The image of the object to be detected is divided into sub-images with the same number of spherical integral light sources using a segmentation algorithm.

[0029] Preferably, step S4 specifically includes:

[0030] S41. Transfer all sub-images from CPU memory to GPU memory;

[0031] S42. In the GPU memory, the average curvature image of the object to be detected is reconstructed by a photometric stereo algorithm.

[0032] S43. Transmit the average curvature image of the object to be detected to the CPU memory.

[0033] Preferably, step S6 specifically includes:

[0034] S61. Defect annotation is performed on the enhanced image using DeepVision3 software;

[0035] S62. Use the enhanced image after defect annotation as training data to train the target detection model;

[0036] S63. Use the trained target detection model to detect surface defects.

[0037] Preferably, step S5 specifically includes:

[0038] S51. Convert the average curvature diagram into an integer digital image using a three-dimensional image;

[0039] S52. Obtain the maximum height and maximum color level of the integer digital image;

[0040] S53. Calculate the ratio of the maximum height to the maximum color level of the integer digital image to obtain the conversion coefficient;

[0041] S54. Adjust the value of the conversion coefficient to obtain an enhanced image of the prominent defect area of ​​the average curvature image.

[0042] In a second aspect, the present invention provides a surface defect detection device, comprising:

[0043] Line scan camera with a fixed shooting position;

[0044] Multiple spherical integrating light sources, each having a different fixed illumination direction;

[0045] The first execution unit is configured to move the object to be detected at a preset speed and trajectory, and during the movement of the object to be detected, control all spherical integrating light sources to illuminate at intervals, and continuously capture images of the object to be detected through the line scan camera to obtain images of the object to be detected;

[0046] The second execution unit is configured to split the image of the object to be detected into sub-images with the same number of spherical integrating light sources, wherein the image information contained in each sub-image is obtained by the line scan camera under the independent illumination of the corresponding spherical integrating light source;

[0047] The third execution unit is configured to reconstruct the average curvature image of the object to be detected based on all sub-images;

[0048] The fourth execution unit is configured to perform image transformation on the average curvature image to obtain an enhanced image of the prominent defect region of the average curvature image;

[0049] The fifth execution unit is configured to use the enhanced image as training data to train a target detection model and use the trained target detection model to perform surface defect detection.

[0050] Compared with the prior art, the present invention has the following beneficial effects:

[0051] 1. Multiple spherical integrating light sources are used for illumination, and the pre-scanning camera is used for shooting to effectively ensure image quality. In addition, the light source opening of the spherical integrating light source is set in a narrow strip shape, which can reduce the shadow problem in the image.

[0052] 2. Compared with the traditional method of using CPU memory for data processing, this invention combines CUDA acceleration technology to process a large amount of data in parallel on GPU memory, which improves the detection speed and can adapt to various detection environments and needs in real time.

[0053] 3. This invention achieves rapid and efficient detection and recognition by quickly annotating enhanced images with defects on DeepVision3 software and training a model on the annotated enhanced image data. This not only improves the accuracy of defect recognition but also optimizes the user experience, making complex data processing more intuitive and convenient, and greatly improving detection accuracy and efficiency.

[0054] The present invention has other features and advantages, which will be apparent from or will be set forth in detail in the accompanying drawings and the following detailed description, which together serve to explain the particular principles of the invention. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0056] Figure 1 This is a schematic flowchart of the surface defect detection method provided in an embodiment of the present invention.

[0057] Figure 2 This is a schematic diagram of the parameter settings of a spherical integrating light source in the surface defect detection method provided in this embodiment of the invention.

[0058] Figure 3 This is a schematic diagram illustrating the effect of splitting the image of the object to be detected into sub-images with the same number of spherical integral light sources in the surface defect detection method provided in this embodiment of the invention.

[0059] Figure 4 This is a schematic diagram illustrating the effect of enhancing the image of the prominent defect region in the average curvature image in the surface defect detection method provided in this embodiment of the invention;

[0060] Figure 5 This is a schematic diagram illustrating the effect of using DeepVision3 software to annotate an enhanced image in the surface defect detection method provided in this embodiment of the invention. Detailed Implementation

[0061] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.

[0062] Example 1:

[0063] Please see Figure 1 The surface defect detection method of the present invention is suitable for detecting surface defects such as those in pouch cells. Of course, it can also be applied to the surface defect detection of other products. The types of defects mentioned above include, but are not limited to, scratches, pits, bubbles, abrasions and dents.

[0064] The surface defect detection method includes the following steps:

[0065] S1. Provides a line scan camera with a fixed shooting position and multiple spherical integrating light sources, each of which has a different fixed illumination direction.

[0066] Preferably, the light source opening of the sphere integrating light source is arranged in a narrow strip shape. By setting the light source opening of the sphere integrating light source to a narrow strip shape, the light emitted by the sphere integrating light source can be concentrated in an area that matches the shape of the narrow strip shape, thereby effectively reducing the problem of shadows in the images captured by the line scan camera.

[0067] Preferably, step S1 further includes:

[0068] The sphere integrating light sources are calibrated. By calibrating each sphere integrating light source, the actual parameters of each light source are accurately determined, facilitating subsequent operations.

[0069] Specifically, the calibration of the spherical integrating light source includes:

[0070] Place the calibration ball on the testing platform;

[0071] Control all spherical integrating light sources to illuminate at intervals, and continuously capture images of the calibration sphere using the line scan camera to obtain calibration images of the calibration sphere under independent illumination by each of the spherical integrating light sources;

[0072] Analyze the center pixel coordinates and highlight center pixel coordinates of the calibration sphere in each calibration image;

[0073] Based on the radius of the calibration sphere, and the pixel coordinates of the center of the calibration sphere and the pixel coordinates of the highlight center of the calibration sphere in each calibration image, calculate the light source vector of each sphere integral light source;

[0074] Based on the light source vector of each sphere integral light source, light source calibration is performed on each sphere integral light source.

[0075] It is understandable that the light source needs to be calibrated before performing photometric stereoscopic imaging on the surface of the pouch cell. Specifically, on a detection platform that can fix the light source camera, the calibration sphere is placed at a preset position on the detection platform (such as a preset detection placement point). Four spherical integrating light sources illuminate the calibration sphere from different directions. When each spherical integrating light source is illuminated individually, a line scan camera captures a calibration image of the calibration sphere. With four spherical integrating light sources, four calibration images can be obtained. Of course, in other embodiments, the number of spherical integrating light sources can be three, four, or more; this embodiment does not limit the specific number of spherical integrating light sources.

[0076] By analyzing the center coordinates and highlight coordinates of the calibration sphere in the calibration image, and combining this with the radius of the calibration sphere, the light source vectors of each sphere's integral light source are obtained using a light source calibration algorithm. The obtained light source vectors are unit normal vectors, and the range of these three values ​​is (-1, 1). Let the coordinates of the sphere's imaging center be (C...). xC y The highlight pixel coordinates are (P) x P y The spatial coordinates of the highlight point are P(P x P y If z), then the distance r between the highlight point and the center of the sphere is:

[0077]

[0078] The normal vector N of the highlight point:

[0079] N = (Px - Cx, Py - Cy, z)

[0080] Finally, the light source vector L is calculated:

[0081] L = 2(N·R)NR.

[0082] Figure 2 The diagram shows that the angle between one of the light sources and the camera's central axis is calculated to be 50.6° (Slants), and the angle (Tilts) projected onto the plane by the central axis is 12.3°. These angles are then converted into light source vectors [0.755399, -0.16472, 0.634224], as shown in the attached diagram. Figure 2 As shown.

[0083] S2. Move the object to be detected at a preset speed and trajectory, and during the movement of the object to be detected, control all spherical integrating light sources to illuminate at intervals, and continuously capture images of the object to be detected through the line scan camera to obtain images of the object to be detected.

[0084] Preferably, step S2 specifically includes:

[0085] S21. Place the object to be tested on the mobile platform;

[0086] S22. Adjust the moving speed and trajectory of the mobile platform, and use the mobile platform to move the object to be detected at a preset speed and trajectory;

[0087] S23. During the movement of the object to be detected, all spherical integral light sources are controlled to illuminate at intervals by a combination of time-division strobe triggering and frame triggering, and the object to be detected is continuously photographed by the line scan camera to obtain an image of the object to be detected.

[0088] Understandably, in the above steps, it is necessary to keep the positions of each spherical integrating light source unchanged, place the object to be inspected on the moving platform, set the conveyor belt speed and field of view of the equipment with preset parameters, and control the intermittent illumination of all spherical integrating light sources using a combination of time-division strobe triggering and frame triggering. The line scan camera continuously captures images of the object to be inspected. Each time the line scan camera scans a line, the light source controller sends frame signals to the line scan camera and each spherical integrating light source to control the four spherical integrating light sources to illuminate individually in their corresponding zones, and the line scan camera completes one image capture.

[0089] S3. The image of the object to be detected is divided into sub-images with the same number of spherical integrating light sources. The image information contained in each sub-image is obtained by the line scan camera under the independent illumination of the corresponding spherical integrating light source.

[0090] Preferably, in step S3, splitting the image of the object to be detected into sub-images with the same number of spherical integral light sources specifically includes:

[0091] The image of the object to be detected is divided into sub-images with the same number of spherical integral light sources using a segmentation algorithm.

[0092] Understandably, since the image of the object to be detected obtained in step S2 is stretched, it is not suitable for direct analysis and processing, so image segmentation is required. Based on the number of spherical integral light sources, an image segmentation algorithm is used to divide the image of the object to be detected into multiple sub-images, each containing information about illumination from different directions. The effect is shown in the attached figure. Figure 3 .

[0093] S4. Reconstruct the average curvature image of the object to be detected based on all sub-images.

[0094] Preferably, step S4 specifically includes:

[0095] S41. Transfer all sub-images from CPU memory to GPU memory;

[0096] S42. In the GPU memory, the average curvature image of the object to be detected is reconstructed by a photometric stereo algorithm.

[0097] S43. Transmit the average curvature image of the object to be detected to the CPU memory.

[0098] Understandably, using GPU memory for acceleration enables rapid imaging. Employing the CUDA programming framework, all sub-images are transferred from the host (CPU memory) to the device (GPU memory). A photometric stereo algorithm is then computed in parallel on the device (GPU memory) to reconstruct the average curvature map. Finally, the generated average curvature image data of the object to be detected is transmitted back to the host (CPU memory).

[0099] The calculation principle is as follows: using a simplified Lambertian imaging model, the object's shape and reflectivity are recovered given a fixed spherical integral light source direction and intensity. The object's two-dimensional texture is called albedo, which corresponds to the local light absorption and reflection characteristics of a surface unaffected by any shadows. The formula for calculating the grayscale value of a pixel in four images taken by a line-scan camera under different spherical integral light source illumination is as follows:

[0100]

[0101] Using the least squares method, the surface normal vector can be obtained:

[0102]

[0103] Then, based on the normal vector obtained from the photometric stereo model, the average curvature image is generated using the gradient:

[0104]

[0105] S5. Perform image transformation on the average curvature image to obtain an enhanced image of the prominent defect area of ​​the average curvature image.

[0106] Preferably, step S5 specifically includes:

[0107] S51. Convert the average curvature diagram into an integer digital image using a three-dimensional image;

[0108] S52. Obtain the maximum height and maximum color level of the integer digital image;

[0109] S53. Calculate the ratio of the maximum height to the maximum color level of the integer digital image to obtain the conversion coefficient;

[0110] S54. Adjust the value of the conversion coefficient to obtain an enhanced image of the prominent defect area of ​​the average curvature image.

[0111] Understandably, the enhanced image obtained in step S4 is converted into an eight-bit integer image using a three-dimensional image conversion algorithm, and the conversion coefficients are adjusted until an enhanced image of the prominent defect area of ​​the average curvature image is obtained. The generated enhanced image is as follows: Figure 4 As shown.

[0112] S6. Use the enhanced image as training data to train the target detection model, and use the trained target detection model to detect surface defects.

[0113] Preferably, step S6 specifically includes:

[0114] S61. Defect annotation is performed on the enhanced image using DeepVision3 software, such as... Figure 5 As shown;

[0115] S62. Use the enhanced image after defect annotation as training data to train the target detection model;

[0116] S63. Use the trained target detection model to detect surface defects.

[0117] It is understood that steps S62 and S63 can be performed using DeepVision3 software or other types of model training software, and no limitation is made here. Since training requires a large amount of data, in order to obtain better surface defect detection results, this method can be used to collect a large amount of enhanced image data for model training, thereby obtaining better model training results and improving the surface defect detection accuracy of the target detection model.

[0118] The present invention also provides a surface defect detection device, comprising:

[0119] Line scan camera with a fixed shooting position;

[0120] Multiple spherical integrating light sources, each having a different fixed illumination direction;

[0121] The first execution unit is configured to move the object to be detected at a preset speed and trajectory, and during the movement of the object to be detected, control all spherical integrating light sources to illuminate at intervals, and continuously capture images of the object to be detected through the line scan camera to obtain images of the object to be detected;

[0122] The second execution unit is configured to split the image of the object to be detected into sub-images with the same number of spherical integrating light sources, wherein the image information contained in each sub-image is obtained by the line scan camera under the independent illumination of the corresponding spherical integrating light source;

[0123] The third execution unit is configured to reconstruct the average curvature image of the object to be detected based on all sub-images;

[0124] The fourth execution unit is configured to perform image transformation on the average curvature image to obtain an enhanced image of the prominent defect region of the average curvature image;

[0125] The fifth execution unit is configured to use the enhanced image as training data to train a target detection model and use the trained target detection model to perform surface defect detection.

[0126] Compared with the prior art, the present invention has the following beneficial effects:

[0127] 1. Multiple spherical integrating light sources are used for illumination, and the pre-scanning camera is used for shooting to effectively ensure image quality. In addition, the light source opening of the spherical integrating light source is set in a narrow strip shape, which can reduce the shadow problem in the image.

[0128] 2. Compared with the traditional method of using CPU memory for data processing, this invention combines CUDA acceleration technology and is based on photometric stereo algorithm to put a large amount of data in GPU memory for parallel processing, which improves the detection speed and can adapt to various detection environments and detection needs in real time.

[0129] 3. This invention achieves rapid and efficient detection and recognition by quickly annotating enhanced images with defects on DeepVision3 software and training a model on the annotated enhanced image data. This not only improves the accuracy of defect recognition but also optimizes the user experience, making complex data processing more intuitive and convenient, and greatly improving detection accuracy and efficiency.

[0130] Based on the same concept, embodiments of the present invention also provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements a surface defect detection method provided in embodiments of the present invention.

[0131] Computer program products may be loaded onto computer devices, and the components of computer devices may include, but are not limited to: one or more processors or processing units, system memory, and buses connecting different system components (including system memory and processing units).

[0132] Computer devices typically include a variety of computer system-readable media. These media can be any available media that can be accessed by a computer device, including volatile and non-volatile media, and removable and non-removable media.

[0133] System memory may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The computer device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system may be used to read and write non-removable, non-volatile magnetic media. The computer program product has a set (e.g., at least one) of program modules configured to perform the functions of the various embodiments of the present invention.

[0134] A program / utility having a set (at least one) of program modules can be stored, for example, in memory. Such program modules include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules typically perform the functions and / or methods described in the embodiments of this invention.

[0135] Computer devices can also communicate with one or more external devices (e.g., keyboards, pointing devices, monitors, etc.), one or more devices that enable user interaction with the computer device, and / or any device that enables the computer device to communicate with one or more other computing devices (e.g., network interface cards, modems, etc.). This communication can be achieved through input / output (I / O) interfaces. Furthermore, computer devices can communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapters. As shown in the figure, the network adapter communicates with other modules of the computer device via a bus. It should be understood that other hardware and / or software modules can be used in conjunction with the computer device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0136] The processing unit executes various functional applications and data processing by running programs stored in the system memory, such as implementing a surface defect detection method provided in an embodiment of the present invention.

[0137] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0138] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

[0139] The above-described embodiments are merely illustrative of the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

[0140] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting surface defects, characterized in that, Includes the following steps: A line scan camera with a fixed shooting position and multiple spherical integrating light sources are provided. The different spherical integrating light sources have different fixed illumination directions, and the light source openings of the spherical integrating light sources are arranged in a thin strip shape. The object to be detected is moved at a preset speed and trajectory. During the movement of the object to be detected, all spherical integral light sources are controlled to illuminate at intervals by a combination of time-division strobe instantaneous triggering and frame triggering. The object to be detected is continuously photographed by the line scan camera to obtain an image of the object to be detected. The image of the object to be detected is divided into sub-images with the same number of spherical integral light sources by an image segmentation algorithm. The image information contained in each sub-image is obtained by the line scan camera under the independent illumination of the corresponding spherical integral light source. Reconstruct the average curvature image of the object to be detected based on all sub-images; The average curvature image is transformed to obtain an enhanced image of the prominent defect area of ​​the average curvature image; The enhanced image is used as training data to train the target detection model, and the trained target detection model is used to detect surface defects.

2. The surface defect detection method as described in claim 1, characterized in that, The process of moving the object to be detected at a preset speed and trajectory, and during the movement of the object, controlling all spherical integrating light sources to illuminate at intervals, and continuously capturing images of the object using the line scan camera to obtain images of the object, specifically includes: The object to be tested is placed on the mobile platform; Adjust the moving speed and trajectory of the mobile platform, and use the mobile platform to move the object to be detected at a preset speed and trajectory; During the movement of the object to be detected, all spherical integral light sources are controlled to illuminate at intervals using a combination of time-division strobe triggering and frame triggering, and the object to be detected is continuously photographed by the line scan camera to acquire images of the object to be detected.

3. The surface defect detection method as described in claim 1, characterized in that, The system provides a line scan camera with a fixed shooting position and multiple spherical integrating light sources, each of which has a different fixed illumination direction, and further includes: The spherical integrating light source is calibrated.

4. The surface defect detection method as described in claim 3, characterized in that, The calibration of the spherical integrating light source specifically includes: Place the calibration ball on the testing platform; Control all spherical integrating light sources to illuminate at intervals, and continuously capture images of the calibration sphere using the line scan camera to obtain calibration images of the calibration sphere under independent illumination by each of the spherical integrating light sources; Analyze the center pixel coordinates and highlight center pixel coordinates of the calibration sphere in each calibration image; Based on the radius of the calibration sphere, and the pixel coordinates of the center of the calibration sphere and the pixel coordinates of the highlight center of the calibration sphere in each calibration image, calculate the light source vector of each sphere integral light source; Based on the light source vector of each sphere integral light source, light source calibration is performed on each sphere integral light source.

5. The surface defect detection method as described in claim 1, characterized in that, The step of reconstructing the average curvature image of the object to be detected based on all sub-images specifically includes: Transfer all sub-images from CPU memory to GPU memory; In the GPU memory, the average curvature image of the object to be detected is reconstructed using a photometric stereo algorithm. The average curvature image of the object to be detected is transmitted to the CPU memory.

6. The surface defect detection method as described in claim 1, characterized in that, The step of using the enhanced image as training data to train a target detection model, and then using the trained target detection model to perform surface defect detection, specifically includes: Defect annotation was performed on the enhanced image using DeepVision3 software; The enhanced image after defect annotation is used as training data to train the target detection model; Surface defect detection is performed using a trained target detection model.

7. The surface defect detection method as described in claim 1, characterized in that, The step of performing image transformation on the average curvature image to obtain an enhanced image of the prominent defect region of the average curvature image specifically includes: The average curvature map is converted from a three-dimensional image into an integer digital image; Obtain the maximum height and maximum color level of the integer digital image; Calculate the ratio of the maximum height to the maximum color level of the integer digital image to obtain the conversion coefficient; Adjust the value of the conversion coefficient to obtain an enhanced image of the prominent defect area of ​​the average curvature image.

8. A surface defect detection device, characterized in that, include: Line scan camera with a fixed shooting position; Multiple spherical integrating light sources, each having a different fixed illumination direction, and the light source openings of the spherical integrating light sources are arranged in a thin strip shape; The first execution unit is configured to move the object to be detected at a preset speed and trajectory, and during the movement of the object to be detected, control all spherical integral light sources to illuminate at intervals by a combination of time-division strobe instantaneous triggering and frame triggering, and continuously capture images of the object to be detected by the line scan camera to obtain images of the object to be detected. The second execution unit is configured to split the image of the object to be detected into sub-images with the same number of spherical integral light sources using an image splitting algorithm. The image information contained in each sub-image is obtained by the line scan camera under the independent illumination of the corresponding spherical integral light source. The third execution unit is configured to reconstruct the average curvature image of the object to be detected based on all sub-images; The fourth execution unit is configured to perform image transformation on the average curvature image to obtain an enhanced image of the prominent defect region of the average curvature image; The fifth execution unit is configured to use the enhanced image as training data to train a target detection model and use the trained target detection model to perform surface defect detection.