Surface defect detection method and device
By using a technology combining a linear scan camera and a spherical integral light source, the problems of low efficiency and poor accuracy in surface defect detection of flexible packaging battery cells are solved, and efficient and accurate surface defect detection is achieved.
Patent Information
- Application Number
- CN202411908579.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-23
AI Technical Summary
The prior art is inefficient in the detection of surface defects of flexible packaging battery cells, and two-dimensional imaging methods are difficult to accurately capture small defects, resulting in defective products flowing into subsequent processes and affecting product quality.
The line scanning camera and multiple spherical integral light sources are used for illumination. By moving the object to be detected and controlling the interval illumination of the spherical integral light sources, the image of the object to be detected is obtained, and through image splitting, average curvature image reconstruction and image conversion, an enhanced image is generated for training the object detection model.
Improve image quality, reduce shadow problems, and achieve fast and efficient defect detection through deep learning, improving detection accuracy and efficiency.
Smart Images

Figure CN119804319A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing and machine vision, and in particular to a surface defect detection method and device. Background Art
[0002] In the industrial manufacturing process, surface defect detection of objects is a crucial link, especially in the field of new energy. Various surface defects often occur in the manufacturing process of products such as batteries and battery cells. These surface defect types include scratches, pits, bubbles, abrasions, bumps, etc.
[0003] Taking the surface defect detection of soft-packaged batteries as an example, the existing means of surface defect detection are mainly manual inspection and visual inspection using machines. Manual inspection is inefficient and difficult to meet quality control requirements, while traditional visual inspection uses a two-dimensional imaging method, which is usually performed under a single light source and fixed light path conditions, and the imaging effect of tiny defects is often unsatisfactory. In addition, surface defects may have special shapes, depths or directions, which are difficult to accurately capture using two-dimensional imaging methods, resulting in the inability to detect the above surface defects in a timely manner during the surface defect detection process, causing defective products to flow into subsequent processes, which can easily have a negative impact on the product quality of the finished product.
[0004] Therefore, there is an urgent need for a soft-pack battery cell surface defect detection method, system and storage medium to overcome the above defects. Summary of the invention
[0005] The object of the present invention is to provide a surface defect detection method and device to solve or at least partially solve the technical problems existing in the prior art.
[0006] To achieve this object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a surface defect detection method, which comprises the following steps:
[0008] S1. providing a line scan camera with a fixed shooting position and a plurality of spherical integrating light sources, wherein different spherical integrating light sources have different fixed illumination directions;
[0009] S2, moving the object to be detected at a preset speed and trajectory, and during the movement of the object to be detected, controlling all spherical integrating light sources to illuminate at intervals, and continuously photographing the object to be detected by the line scan camera to obtain an image of the object to be detected;
[0010] S3, splitting the image of the object to be detected into sub-images with the same number as the spherical integrating light sources, wherein the image information contained in each sub-image is obtained by photographing the line scan camera under the independent illumination of the corresponding spherical integrating light source;
[0011] S4, reconstructing the mean curvature image of the object to be detected based on all sub-images;
[0012] S5, performing image conversion on the mean curvature image to obtain an enhanced image of the prominent defect area of the mean curvature image;
[0013] S6. Using the enhanced image as training data to train a target detection model, and using the trained target detection model to perform surface defect detection.
[0014] Preferably, the light source opening of the spherical integrating light source is arranged in a thin strip shape.
[0015] Preferably, the step S2 specifically includes:
[0016] S21, placing the object to be detected on a mobile platform;
[0017] S22, adjusting the moving speed and moving trajectory of the mobile platform, and driving the object to be detected to move at a preset speed and trajectory through the mobile platform;
[0018] S23, during the movement of the object to be detected, all spherical integrating light sources are controlled to illuminate at intervals by combining time-sharing stroboscopic 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, the step S1 further comprises:
[0020] The spherical integrating light source is calibrated.
[0021] Specifically, the calibrating the spherical integrating light source includes:
[0022] Place the calibration ball on the detection platform;
[0023] Controlling all spherical integrating light sources to illuminate at intervals, and continuously photographing the calibration sphere through the line scan camera to obtain calibration images of the calibration sphere under independent illumination of each spherical integrating light source;
[0024] Analyze the pixel coordinates of the center of the calibration sphere and the pixel coordinates of the highlight center in each calibration image;
[0025] Calculating the light source vector of each spherical integral light source according to the radius of the calibration sphere and the spherical center pixel coordinates and the highlight center pixel coordinates of the calibration sphere in each calibration image;
[0026] According to the light source vector of each spherical integrating light source, light source calibration is performed on each spherical integrating 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 integrating light sources specifically includes:
[0028] The image of the object to be detected is split into sub-images with the same number as the spherical integrating light sources through a sub-image algorithm.
[0029] Preferably, the step S4 specifically includes:
[0030] S41, transferring all sub-images from the CPU memory to the GPU memory;
[0031] S42, reconstructing a mean curvature image of the object to be detected in the GPU memory by using a photometric stereo algorithm;
[0032] S43, transmitting the mean curvature image of the object to be detected to the CPU memory.
[0033] Preferably, the step S6 specifically includes:
[0034] S61, marking defects on the enhanced image using DeepVision3 software;
[0035] S62, using the enhanced image after defect annotation as training data to train a target detection model;
[0036] S63. Use the trained target detection model to perform surface defect detection.
[0037] Preferably, the step S5 specifically includes:
[0038] S51, converting the mean curvature map into an integer digital image through a three-dimensional image;
[0039] S52, obtaining the maximum height and maximum color scale of the integer digital image;
[0040] S53, calculating the ratio of the maximum height and the maximum color scale of the integer digital image to obtain a conversion coefficient;
[0041] S54, adjusting the numerical value of the conversion coefficient to obtain an enhanced image of the prominent defect area of the mean curvature image.
[0042] In a second aspect, the present invention provides a surface defect detection device, comprising:
[0043] Line scan camera with fixed shooting position;
[0044] A plurality of spherical integrating light sources, different spherical integrating light sources having different fixed illumination directions;
[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 shoot the object to be detected through the line scan camera to obtain an image of the object to be detected;
[0046] A second execution unit is configured to split the image of the object to be detected into sub-images with the same number as the spherical integrating light sources, and the image information contained in each sub-image is obtained by photographing the line scan camera under the independent illumination of the corresponding spherical integrating light source;
[0047] A third execution unit is configured to reconstruct a mean curvature image of the object to be detected based on all sub-images;
[0048] a fourth execution unit configured to perform image conversion on the mean curvature image to obtain an enhanced image of a prominent defect area of the mean 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. Use multiple spherical integral light sources for lighting, and cooperate with the first scanning camera to effectively ensure the image quality. The light source opening of the spherical integral light source is set in a thin strip shape, which can reduce the shadow problem in the image;
[0052] 2. Compared with the traditional use of CPU memory for data processing, the present invention combines CUDA acceleration technology to place a large amount of data in GPU memory for parallel processing, thereby improving the detection speed and being able to adapt to various detection environments and detection requirements in real time;
[0053] 3. The present invention realizes fast and efficient detection and identification through deep learning by quickly marking defects in enhanced images on the DeepVision3 software and performing model training on the enhanced image data after defect annotation. It not only improves the accuracy of defect identification, but also optimizes the user's operating 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 described in detail in the accompanying drawings and the following detailed description incorporated herein, which together serve to explain the specific principles of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 It is a flow chart of a surface defect detection method provided by an embodiment of the present invention.
[0057] Figure 2 It is a schematic diagram of parameter settings of a spherical integrating light source in the surface defect detection method provided by an embodiment of the present invention.
[0058] Figure 3 It is a schematic diagram of the effect of splitting the image of the object to be detected into sub-images with the same number as the spherical integral light source in the surface defect detection method provided by an embodiment of the present invention;
[0059] Figure 4 It is a schematic diagram of the effect of an enhanced image of a prominent defect area of a mean curvature image in a surface defect detection method provided by an embodiment of the present invention;
[0060] Figure 5 It is a schematic diagram of the effect of defect annotation on the enhanced image by using DeepVision3 software in the surface defect detection method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] In order to explain in detail the possible application scenarios, technical principles, specific schemes that can be implemented, and the purposes and effects that can be achieved, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0062] Embodiment 1:
[0063] See also Figure 1 The surface defect detection method of the present invention is suitable for detecting surface defects such as soft-pack batteries. Of course, it can also be applied to surface defect detection of other products. The above-mentioned defect types include but are not limited to scratches, pits, bubbles, abrasions and bumps.
[0064] The surface defect detection method comprises the following steps:
[0065] S1. Provide a line scan camera with a fixed shooting position and multiple spherical integrating light sources, where different spherical integrating light sources have different fixed illumination directions.
[0066] Preferably, the light source opening of the spherical integrating light source is arranged in a thin strip shape. By setting the light source opening of the spherical integrating light source as a thin strip opening, the light emitted by the spherical integrating light source can be concentrated in an area matching the shape of the thin strip opening, thereby effectively reducing the problem of shadows in the image taken by the line scan camera.
[0067] Preferably, the step S1 further comprises:
[0068] The spherical integrating light source is calibrated. By calibrating each spherical integrating light source, the actual parameters of each spherical integrating light source are accurately determined to facilitate subsequent operations.
[0069] Specifically, the calibrating the spherical integrating light source includes:
[0070] Place the calibration ball on the detection platform;
[0071] Controlling all spherical integrating light sources to illuminate at intervals, and continuously photographing the calibration sphere through the line scan camera to obtain calibration images of the calibration sphere under independent illumination of each spherical integrating light source;
[0072] Analyze the pixel coordinates of the center of the calibration sphere and the pixel coordinates of the highlight center in each calibration image;
[0073] Calculating the light source vector of each spherical integral light source according to the radius of the calibration sphere and the spherical center pixel coordinates and the highlight center pixel coordinates of the calibration sphere in each calibration image;
[0074] According to the light source vector of each spherical integrating light source, light source calibration is performed on each spherical integrating light source.
[0075] It is understandable that the light source needs to be calibrated before performing photometric stereoscopic imaging of the surface of the soft-pack battery cell. Specifically, on a detection platform that can fix the light source camera, the calibration ball is placed at a preset position of the detection platform (such as a preset detection placement point), and four spherical integrating light sources are used to illuminate the calibration ball from different directions. When each spherical integrating light source is illuminated separately, the line scan camera captures the calibration image of the calibration ball. For the case 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, and this embodiment does not limit the specific number of spherical integrating light sources.
[0076] Analyze the center coordinates of the calibration sphere and the coordinates of the highlight point in the calibration image, and combine the radius of the calibration sphere to obtain the light source vector of each spherical integral light source through the light source calibration algorithm. The light source vector obtained here is a unit normal vector, and the range of these three values is (-1, 1). Assume that the coordinates of the center of the spherical imaging circle are (C x, C y ), the pixel coordinates of the highlight point are (P x , P y ), the spatial coordinates of the highlight point are P(P x , P y , z), then the distance r between the highlight point and the center of the sphere is:
[0077]
[0078] Normal vector N of the highlight point:
[0079] N=(Px-Cx,Py-Cy,z),
[0080] Finally, find the light source vector L:
[0081] L = 2(N·R)NR.
[0082] Figure 2 It shows that the angle Slants between one of the light sources and the central axis of the camera is 50.6°, and the angle Tilts projected from the central axis to the plane is 12.3°. The angle is converted into the light source vector [0.755399, -0.16472, 0.634224], and the effect is as shown in the attached figure. Figure 2 shown.
[0083] S2, moving the object to be detected at a preset speed and trajectory, and during the movement of the object to be detected, controlling all spherical integrating light sources to illuminate at intervals, and continuously photographing the object to be detected by the line scan camera to obtain an image of the object to be detected.
[0084] Preferably, the step S2 specifically includes:
[0085] S21, placing the object to be detected on a mobile platform;
[0086] S22, adjusting the moving speed and moving trajectory of the mobile platform, and driving the object to be detected to move at a preset speed and trajectory through the mobile platform;
[0087] S23, during the movement of the object to be detected, all spherical integrating light sources are controlled to illuminate at intervals by combining time-sharing stroboscopic 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] It is understandable that in the above steps, it is necessary to keep the position of each spherical integrating light source unchanged, place the object to be detected on the mobile platform, set the speed value and field of view value of the conveyor belt of the equipment with preset parameters, and use a combination of time-sharing stroboscopic triggering and frame triggering to control the interval illumination of all spherical integrating light sources, and continuously shoot the object to be detected through the line scan camera to obtain the image of the object to be detected. Every time the line scan camera scans a line, the light source controller will send frame signals to the line scan camera and each spherical integrating light source to control the four spherical integrating light sources to illuminate separately in the corresponding partitions, and complete a shooting through the line scan camera.
[0089] S3, splitting the image of the object to be detected into sub-images with the same number as the spherical integrating light sources, and the image information contained in each sub-image is obtained by photographing 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 integrating light sources specifically includes:
[0091] The image of the object to be detected is split into sub-images with the same number as the spherical integrating light sources through a sub-image algorithm.
[0092] It is understandable that since the image of the object to be detected obtained in step S2 is stretched and not suitable for direct analysis and processing, image splitting is required. According to the number of spherical integral light sources, the image of the object to be detected is divided into multiple sub-images using a sub-image algorithm, each of which contains information about illumination from different directions. The effect is as shown in the attached figure. Figure 3 .
[0093] S4. Reconstructing a mean curvature image of the object to be detected based on all sub-images.
[0094] Preferably, the step S4 specifically includes:
[0095] S41, transferring all sub-images from the CPU memory to the GPU memory;
[0096] S42, reconstructing a mean curvature image of the object to be detected in the GPU memory by using a photometric stereo algorithm;
[0097] S43, transmitting the mean curvature image of the object to be detected to the CPU memory.
[0098] It is understandable that using GPU memory for acceleration can achieve fast imaging. Using the cuda programming framework, all sub-images are transferred from the host (CPU memory) to the device (GPU memory). The photometric stereo algorithm is calculated in parallel on the device (GPU memory) memory to reconstruct the mean curvature map. The generated mean curvature image data of the object to be detected is then transmitted back to the host (CPU memory).
[0099] The calculation principle is as follows: using a simplified Lambertian imaging model, the shape and reflectivity of the object are restored when the direction and intensity of the spherical integrated light source are determined. The two-dimensional texture of the object is called albedo, which corresponds to the local light absorption and reflection characteristics of the surface that is not affected by any shadows. The calculation formula for the grayscale value of a pixel in the four images taken by the line scan camera under different spherical integrated light sources is:
[0100]
[0101] Using the least squares method to solve, we can get the surface normal vector:
[0102]
[0103] Then, based on the normal vector obtained by photometric stereo, the gradient is used to generate the mean curvature image:
[0104]
[0105] S5. Perform image conversion on the mean curvature image to obtain an enhanced image of the prominent defect area of the mean curvature image.
[0106] Preferably, the step S5 specifically includes:
[0107] S51, converting the mean curvature map into an integer digital image through a three-dimensional image;
[0108] S52, obtaining the maximum height and maximum color scale of the integer digital image;
[0109] S53, calculating the ratio of the maximum height and the maximum color scale of the integer digital image to obtain a conversion coefficient;
[0110] S54, adjusting the numerical value of the conversion coefficient to obtain an enhanced image of the prominent defect area of the mean curvature image.
[0111] It can be understood that the enhanced image obtained in step S4 is converted into an eight-bit integer image by a three-dimensional image conversion algorithm, and the conversion coefficient is adjusted until an enhanced image of the prominent defect area of the mean curvature image is obtained. The generated enhanced image is as follows: Figure 4 shown.
[0112] S6. Using the enhanced image as training data to train a target detection model, and using the trained target detection model to perform surface defect detection.
[0113] Preferably, the step S6 specifically includes:
[0114] S61, using DeepVision3 software to mark defects on the enhanced image, such as Figure 5 As shown;
[0115] S62, using the enhanced image after defect annotation as training data to train a target detection model;
[0116] S63. Use the trained target detection model to perform surface defect detection.
[0117] It is understandable that step S62 and step S63 can be performed using DeepVision3 software or other types of model training software, which is not limited here. Since training requires a large amount of data, in order to obtain better surface defect detection results, a large amount of enhanced image data can be collected through this method for model training to obtain better model training results, thereby improving the surface defect detection accuracy of the target detection model.
[0118] The present invention also provides a surface defect detection device, which comprises:
[0119] Line scan camera with fixed shooting position;
[0120] A plurality of spherical integrating light sources, different spherical integrating light sources having different fixed illumination directions;
[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 shoot the object to be detected through the line scan camera to obtain an image of the object to be detected;
[0122] A second execution unit is configured to split the image of the object to be detected into sub-images with the same number as the spherical integrating light sources, and the image information contained in each sub-image is obtained by photographing the line scan camera under the independent illumination of the corresponding spherical integrating light source;
[0123] A third execution unit is configured to reconstruct a mean curvature image of the object to be detected based on all sub-images;
[0124] a fourth execution unit configured to perform image conversion on the mean curvature image to obtain an enhanced image of a prominent defect area of the mean 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. Use multiple spherical integral light sources for lighting, and cooperate with the first scanning camera to effectively ensure the image quality. The light source opening of the spherical integral light source is set in a thin strip shape, which can reduce the shadow problem in the image;
[0128] 2. Compared with the traditional use of CPU memory for data processing, the present invention combines CUDA acceleration technology and, based on the photometric stereo algorithm, places a large amount of data in GPU memory for parallel processing, thereby improving the detection speed and being able to adapt to various detection environments and detection requirements in real time;
[0129] 3. The present invention realizes fast and efficient detection and identification through deep learning by quickly marking defects in enhanced images on the DeepVision3 software and performing model training on the enhanced image data after defect annotation. It not only improves the accuracy of defect identification, but also optimizes the user's operating experience, making complex data processing more intuitive and convenient, and greatly improving detection accuracy and efficiency.
[0130] Based on the same concept, an embodiment of the present invention further provides a computer program product, including a computer program / instruction. When the computer program / instruction is executed by a processor, a surface defect detection method provided by an embodiment of the present invention is implemented.
[0131] The computer program product may be loaded on a computer device, the components of which may include but are not limited to: one or more processors or processing units, a system memory, and a bus connecting different system components (including the system memory and the processing unit).
[0132] Computer devices typically include a variety of computer system readable media. These media can be any available media that can be accessed by the computer device, including volatile and non-volatile media, removable and non-removable media.
[0133] The 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 that are configured to perform the functions of various embodiments of the present invention.
[0134] A program / utility having a set (at least one) of program modules may be stored, for example, in a memory, such program modules including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules generally perform the functions and / or methods of the embodiments described herein.
[0135] The computer device can also communicate with one or more external devices (such as keyboards, pointing devices, displays, etc.), and can also communicate with one or more devices that enable users to interact with the computer device, and / or communicate with any device (such as a network card, a modem, etc.) that enables the computer device to communicate with one or more other computing devices. This communication can be carried out through an input / output (I / O) interface. In addition, the computer device can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter. As shown in the figure, the network adapter communicates with other modules of the computer device through 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, etc.
[0136] The processing unit executes various functional applications and data processing by running programs stored in the system memory, for example, implementing a surface defect detection method provided by an embodiment of the present invention.
[0137] Those skilled in the art can understand that all or part of the steps of the above embodiments can be completed by hardware, or by a program to instruct the relevant hardware to complete the steps. The program can be stored in a computer-readable storage medium, and the storage medium mentioned above can be a read-only memory, a disk or an optical disk, etc. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0138] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
[0139] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
[0140] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A surface defect detection method, characterized in that: The steps include: Providing a line scan camera with a fixed shooting position and a plurality of spherical integrating light sources, wherein different spherical integrating light sources have different fixed illumination directions; Moving the object to be detected at a preset speed and trajectory, and during the movement of the object to be detected, controlling all spherical integrating light sources to illuminate at intervals, and continuously photographing the object to be detected by the line scan camera to obtain an image of the object to be detected; Splitting the image of the object to be detected into sub-images with the same number as the spherical integrating light sources, wherein the image information contained in each sub-image is obtained by photographing the line scan camera under the independent illumination of the corresponding spherical integrating light source; Reconstructing a mean curvature image of the object to be detected based on all sub-images; Performing image conversion on the mean curvature image to obtain an enhanced image of a prominent defect area of the mean curvature image; The enhanced image is used as training data to train a target detection model, and the trained target detection model is used to perform surface defect detection.
2. The surface defect detection method according to claim 1, characterized in that: The light source opening of the spherical integrating light source is arranged in a thin strip shape.
3. The surface defect detection method according to claim 1, characterized in that: The method of moving the object to be detected at a preset speed and trajectory, and during the movement of the object to be detected, controlling all spherical integrating light sources to illuminate at intervals, and continuously photographing the object to be detected by the line scan camera to obtain an image of the object to be detected specifically includes: Placing the object to be detected on a mobile platform; Adjusting the moving speed and moving trajectory of the mobile platform, and driving the object to be detected to move at a preset speed and trajectory through the mobile platform; During the movement of the object to be detected, a combination of time-sharing stroboscopic triggering and frame triggering is used to control the interval illumination of all spherical integrating light sources, and the object to be detected is continuously photographed by the line scan camera to obtain an image of the object to be detected.
4. The surface defect detection method according to claim 1, characterized in that: The method of providing a line scan camera with a fixed shooting position and a plurality of spherical integrating light sources, wherein different spherical integrating light sources have different fixed lighting directions, further comprises: The spherical integrating light source is calibrated.
5. The surface defect detection method according to claim 4, characterized in that: The calibrating the spherical integrating light source specifically includes: Place the calibration ball on the detection platform; Controlling all spherical integrating light sources to illuminate at intervals, and continuously photographing the calibration sphere through the line scan camera to obtain calibration images of the calibration sphere under independent illumination of each spherical integrating light source; Analyze the pixel coordinates of the center of the calibration sphere and the pixel coordinates of the highlight center in each calibration image; Calculating the light source vector of each spherical integral light source according to the radius of the calibration sphere and the spherical center pixel coordinates and the highlight center pixel coordinates of the calibration sphere in each calibration image; According to the light source vector of each spherical integrating light source, light source calibration is performed on each spherical integrating light source.
6. The surface defect detection method according to claim 1, characterized in that: The step of splitting the image of the object to be detected into sub-images having the same number as the spherical integrating light sources specifically includes: The image of the object to be detected is split into sub-images with the same number as the spherical integrating light sources through a sub-image algorithm.
7. The surface defect detection method according to claim 1, characterized in that: The reconstructing the mean curvature image of the object to be detected based on all the sub-images specifically includes: Transfer all sub-images from CPU memory to GPU memory; In the GPU memory, a mean curvature image of the object to be detected is reconstructed by calculating a photometric stereo algorithm; The mean curvature image of the object to be detected is transmitted to the CPU memory.
8. The surface defect detection method according to claim 1, characterized in that: The method of using the enhanced image as training data to train a target detection model and using the trained target detection model to perform surface defect detection specifically includes: Annotating defects on the enhanced image using DeepVision3 software; Using the enhanced image after defect annotation as training data to train the target detection model; Use the trained object detection model to perform surface defect detection.
9. The surface defect detection method according to claim 1, characterized in that: The performing image conversion on the mean curvature image to obtain an enhanced image of the prominent defect area of the mean curvature image specifically includes: Converting the mean curvature map into an integer digital image through a three-dimensional image; Obtaining the maximum height and maximum color scale of the integer digital image; Calculating the ratio of the maximum height and the maximum color scale of the integer digital image to obtain a conversion coefficient; The numerical value of the conversion coefficient is adjusted to obtain an enhanced image of the prominent defect area of the mean curvature image.
10. A surface defect detection device, characterized in that: include: Line scan camera with fixed shooting position; A plurality of spherical integrating light sources, different spherical integrating light sources having different fixed illumination directions; 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 shoot the object to be detected through the line scan camera to obtain an image of the object to be detected; A second execution unit is configured to split the image of the object to be detected into sub-images with the same number as the spherical integrating light sources, and the image information contained in each sub-image is obtained by photographing the line scan camera under the independent illumination of the corresponding spherical integrating light source; A third execution unit is configured to reconstruct a mean curvature image of the object to be detected based on all sub-images; a fourth execution unit configured to perform image conversion on the mean curvature image to obtain an enhanced image of a prominent defect area of the mean 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.
Citation Information
Patent Citations
Product appearance detection device and method
CN106018413A
Convolutional neural network-based photovoltaic glass defect classification method and device
CN108108768A
Pistachio nut head and tail recognition device based on multi-channel information fusion and recognition method thereof
CN111724339A
Defect detection system, method and device, equipment and storage medium
CN112748120A
Laser marking method and device based on machine learning
CN113134683A