Defect detection method and device, computer equipment and computer readable storage medium
By uniformly processing and stitching of multi-view angle multi-light source images, the target image is formed, and the problems of high cost of development and maintenance of defect detection models in the existing technology are solved, and efficient and accurate defect detection is achieved. .
Patent Information
- Application Number
- CN202411868227.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-02-07
AI Technical Summary
In the detection of multi-view multi-light source image defects, the model development and maintenance cost is high, the inference efficiency is low, the computing resource consumption is large, and the trained model is poorly robust, making it difficult to adapt to a variety of viewing light source scenarios.
By uniformly processing the images captured by multiple viewing angles and multiple light sources, multiple projected images are obtained and stitched together to form the target image, reducing the position and viewing angle differences of input data and improving the efficiency of defect detection.
It reduces the development and maintenance cost of defect detection models, reduces computing resource consumption, improves the efficiency and accuracy of defect detection, and enhances the robustness of the model.
Smart Images

Figure CN119399183A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of defect detection, and in particular to a defect detection method, apparatus, computer equipment and computer-readable storage medium. Background Art
[0002] The defect detection technology based on multi-angle and multi-light source combined images of flying camera technology is widely used in the manufacturing industry, especially in industries such as electronics, machinery and automobiles that have high requirements on product surface quality, for automated defect detection and quality control.
[0003] The material positions and visual effects in a large number of images acquired based on flying photography technology are different, which will increase the complexity and difficulty of the defect detection step.
[0004] Since the material position in each flight image may be different, it is usually necessary to separately annotate each image and train the corresponding detection model. This situation leads to increased model development and maintenance costs, reduced reasoning efficiency, and high consumption of computing resources. In addition, the trained defect detection model is trained for images of a single perspective or light source, which makes it difficult to adapt to defect scenes with a variety of perspectives and light sources, and the defect detection model has poor robustness. Summary of the invention
[0005] Based on this, it is necessary to provide a defect detection method, apparatus, computer equipment, computer-readable storage medium and computer program product to address the above technical problems, which can reduce the implementation cost of defect detection in various scenarios.
[0006] In a first aspect, the present application provides a defect detection method, comprising:
[0007] Performing unified viewing angle processing on multiple acquired images of the product surface to obtain multiple projection images; wherein each acquired image is an image obtained based on multi-viewing angle and multi-light source shooting;
[0008] Perform stitching processing on multiple projection images to obtain a target image;
[0009] The target image is input into the trained defect detection model for processing, and the defect detection results of the product surface are output.
[0010] In a second aspect, the present application provides a defect detection device, comprising:
[0011] A projection module is used to process multiple acquired images of the product surface in a unified viewing angle to obtain multiple projection images; wherein each acquired image is an image obtained based on multi-viewing angles and multi-light sources;
[0012] A stitching module, used for stitching multiple projection images to obtain a target image;
[0013] The detection module is used to input the target image into the trained defect detection model for processing and output the defect detection results of the product surface.
[0014] In a third aspect, the present application provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method when executing the computer program.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.
[0016] In a fifth aspect, the present application provides a computer program product, which includes a computer program, and the computer program implements the steps in the above method when executed by a processor.
[0017] The above-mentioned defect detection method, device, computer equipment, computer-readable storage medium and computer program product obtain a target image by fusing multiple projection images obtained by performing unified perspective processing on images taken from multiple perspectives and multiple light sources, thereby reducing the position and perspective differences of the input data, causing the error increased in the defect detection process to be reduced, and detecting defects on the surface of the product in the target image. Target detection is performed on the fused image to reduce redundant information, thereby improving the efficiency of defect detection. In addition, a separate defect detection model is used to implement defect detection, which can solve the problems of increased development and maintenance costs, reduced reasoning efficiency, and high computing resource consumption caused by separate annotation and training of corresponding detection models for each flying image in the prior art, and the trained defect detection model is trained for images of a single perspective or light source, which is difficult to adapt to defect scenes of various perspectives and light sources. The development and maintenance costs of the defect detection model are reduced, the consumption of computing resources is reduced, the efficiency of defect detection is improved, and the robustness of the defect detection model can be improved, thereby improving the accuracy of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 An application environment diagram of a defect detection method provided in an embodiment of the present application;
[0019] Figure 2 A schematic diagram of a defect detection method provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a defect detection method provided in an embodiment of the present application;
[0021] Figure 4 A structural block diagram of a defect detection device provided in an embodiment of the present application;
[0022] Figure 5 An internal structure diagram of a computer device provided in an embodiment of the present application;
[0023] Figure 6 An internal structure diagram of another computer device provided in an embodiment of the present application;
[0024] Figure 7 An internal structure diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail 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 used to limit the present application.
[0026] The defect detection method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through a communication network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0027] like Figure 2 As shown, the embodiment of the present application provides a defect detection method, which is applied to Figure 1 The terminal 102 or the server 104 in the example is used for explanation. It is understandable that the computer device may include at least one of the terminal and the server. The method comprises the following steps:
[0028] S201, performing unified viewing angle processing on a plurality of acquired images of the product surface to obtain a plurality of projection images; wherein each acquired image is an image obtained by shooting based on multiple viewing angles and multiple light sources.
[0029] Among them, on industrial production lines, flying photography technology is used to capture surface images of materials from multiple different light sources and viewing angles. Flying photography technology captures images of materials under different conditions by quickly switching multiple light sources and camera angles, thereby obtaining more comprehensive surface information. Light source combination: Capture surface details of materials through different light source arrangements (such as bright field light and dark field light, etc.). View angle combination: Obtain images of the material surface at different angles through multiple different camera positions to ensure that more defect features are covered. Light source combination and view angle combination can be set according to production needs.
[0030] The products on the production line are photographed using multiple viewpoints and multiple light sources to obtain multiple captured images. The unified viewpoint is used to transform the product surface in different captured images to the same scale and viewpoint. There are differences in the viewpoint and position of the products in different captured images, and the processing steps of the unified viewpoint can be used to eliminate the viewpoint and position differences.
[0031] S202: performing splicing processing on a plurality of projection images to obtain a target image.
[0032] The projected images are spliced to integrate image information from different light sources and viewing angles to form a target image, which includes image information of the product surface captured by all viewing angles and light sources.
[0033] S203: Input the target image into the trained defect detection model for processing, and output the defect detection result of the product surface.
[0034] The defect detection model may be a deep learning model. In some embodiments, the defect detection model may extract features from the target image to obtain image features, decode the image features, and obtain defect areas and defect types of the defect areas. In some embodiments, defect areas of at least one defect type such as scratches, pits, and stains may be identified.
[0035] It can be seen that in the embodiment of the present application, multiple projection images obtained by performing unified perspective processing on images captured by multiple perspectives and multiple light sources are fused to obtain a target image, thereby reducing the position and perspective differences of the input data, causing the error increased in the defect detection process to be reduced, and the defects on the surface of the product are detected in the target image. The fused image is subjected to target detection to reduce redundant information, thereby improving the efficiency of defect detection, and a unified defect detection model is used to process the spliced target image to detect various defects on the surface of the product. This can solve the problems in the prior art of separately annotating and training the corresponding detection model for each flying image, resulting in increased development and maintenance costs, reduced reasoning efficiency, and high computing resource consumption. The trained defect detection model is trained for images of a single perspective or light source, and is difficult to adapt to defect scenes of various perspectives and light sources. There is no need to develop an independent model for each flying image, thereby reducing development and maintenance costs, reducing computing resource consumption, and improving the efficiency of defect detection. At the same time, the robustness of the defect detection model can be improved, thereby improving the accuracy of defect detection.
[0036] In some embodiments, stitching multiple projection images to obtain a target image includes:
[0037] Multiple projection images are stitched on the channels to obtain a target image; the target image is a multi-channel image.
[0038] Among them, one projection image is used as an image of a channel, and the images of multiple channels formed by multiple projection images are spliced in the channel dimension to obtain a target image. Splicing multiple projection images on the channel to obtain a target image can retain the image information in the projection image to the greatest extent, so that the target image has more comprehensive information on the product surface and can more effectively characterize defects.
[0039] In some embodiments, projection image A: 4*4 (width*height); projection image B: 4*4; projection image C: 4*4; the target image obtained by stitching is: 4*4*3 (width*height*number of channels).
[0040] It can be seen that in this embodiment, multiple projection images are spliced on the channel to form a multi-channel image, and used as the target image, which can simplify the stitching operation, while reducing the loss of effective information in the stitching process, increasing the image information of the product surface in the target image, and increasing the representativeness of defect features. The details of the product surface under multiple angles and light sources are comprehensively presented, reducing the detection blind spots caused by a single angle or light source, and the defect detection model can more accurately capture various defect features, significantly improving the accuracy of detection.
[0041] In some embodiments, a plurality of acquired images of the product surface are processed with a unified viewing angle to obtain a plurality of projection images, including:
[0042] For any one of the multiple acquired images of the product surface, a target area where the product is located is identified and cropped in the acquired image to obtain an area image;
[0043] The images of each region are projected into the same viewing plane to obtain multiple projection images.
[0044] The captured image includes image information of the product surface and redundant image information. The redundant image information in the captured image can be deleted by identifying and cropping the regional image in the captured image. The target area can refer to the area on the product surface. Product recognition is performed on each captured image to obtain the target area in each captured image. The regional image can refer to the image corresponding to the target area. The regional image only includes image information on the product surface. Transmission transformation is performed on each regional image and projected into the same viewing plane to obtain the projection image corresponding to each regional image.
[0045] In some embodiments, manual annotation can be used to determine the area on the surface of the product, and a small amount of position annotation and type annotation can be performed in the captured image or sample image. Through these small amount of annotation detection results, a surface recognition model is trained. The surface recognition model can be a deep learning model, which is used to automatically identify the area on the surface of the product in the image. Only a few fly-by-wire images need to be annotated with the position of the product surface, which reduces the workload of manual annotation and simplifies annotation. It can avoid the arduous work of individually annotating defects for each fly-by-wire image, and use the annotated surface recognition model to automatically locate and crop the product surface area, which greatly reduces the need for manual intervention and improves annotation efficiency. Use the annotated data to train the surface recognition model, which can automatically detect and mark the position of the product surface in all fly-by-wire images.
[0046] It can be seen that in this embodiment, by cropping out the area including only the product surface and ensuring that only the image information of the product surface is retained, redundant information can be reduced and data enhancement of the projected image can be achieved, making the defect detection model particularly suitable for scenes where material surface defects are difficult to observe under specific light sources or viewing angles, and being able to uniformly analyze image information under different angles and light sources, thereby enhancing the adaptability of the defect detection model.
[0047] In some embodiments, the target image is input into a trained defect detection model for processing, and a defect detection result of the product surface is output, including:
[0048] Input the target image into the spatial variation network in the trained defect detection model for processing, and output a corrected image of the target image;
[0049] The corrected image of the target image is input into the defect detection network in the defect detection model for processing, and the defect detection result of the product surface is output.
[0050] Among them, the spatial variation network is used to correct the offset of the position of the product surface in the image. The input image is a multi-view image spliced after preliminary perspective transformation processing. Due to different perspectives, the position of the product in the image will be offset. The spatial variation network is used to predict the offset and geometric changes of the product surface in the target image, and compensate it in the target image to obtain the corrected image. Among them, the defect detection network can be a model based on deep learning or traditional machine learning. The defect detection network encodes the corrected image to obtain image features, decodes the image features, automatically classifies defects, outputs the type and severity of the defects, and obtains the final defect detection results.
[0051] It can be seen that in this embodiment, the target image is preferentially spatially transformed and corrected through the spatial variation network to obtain a corrected image, and the corrected image is subjected to defect detection through the defect detection network. This can correct the spatial offset of the product in the target image and reduce the defect detection error caused by the spatial offset. It can more accurately process defect information from multiple angles and multiple light sources, and ultimately improve the accuracy of defect detection.
[0052] In some embodiments, the spatial variation network includes a positioning network, a grid generator, and a sampler; inputting a target image into the spatial variation network in the trained defect detection model for processing, and outputting a corrected image of the target image, including:
[0053] Input the target image into the positioning network for processing and output the affine transformation matrix;
[0054] Input the affine transformation matrix into the grid generator for processing, and output the sampling coordinate set of the target image;
[0055] The sampling coordinate set is input into the sampler for processing, and a corrected image of the target image is output.
[0056] Among them, the positioning network is used to predict the geometric transformation information of the product surface. The affine transformation matrix can refer to the matrix for geometric transformation of the target image. The positioning network is a multi-layer neural network structure. The six parameters of the affine transformation matrix are: θ 1 ,θ2,θ3,θ4,θ5 and θ 6 These parameters form a 2x3 affine transformation matrix, which is used to describe the geometric transformation of the image. The affine transformation matrix is as follows:
[0057]
[0058] Among them, the affine transformation matrix describes the geometric transformation of pixels in the target image, where translation: θ3 and θ 6 Represents the translation of the target image on the x and y axes. Rotation: θ 1 , θ2, θ4 and θ5 represent the rotation of the image. Scaling: θ1 and θ5 represent the scaling ratio in the x and y directions. Distortion: θ2 and θ4 represent the distortion of the image.
[0059] Among them, the grid generator is used to determine the sampled pixels in the target image. The sampling coordinate set may refer to a set of coordinates of pixels sampled in the target image. In some implementations, the network generator generates a sampling grid in the coordinate system corresponding to the target image according to the affine transformation matrix, and the sampling network is used to determine how the position of each pixel in the output image (corrected image) is sampled from the input image (target image). The grid generator maps the pixel coordinates of the output corrected image back to the coordinate system of the target image. For each pixel coordinate (x', y') in the corrected image, the corresponding coordinate (x, y) in the target image is calculated by the affine transformation matrix T:
[0060]
[0061] In this way, the grid generator generates a coordinate sampled from the target image for each pixel of the rectified image.
[0062] Among them, the sampler is used to sample from the target image according to the sampling coordinate set. In some embodiments, in order to ensure that the sampling process is differentiable, the sampler uses bilinear interpolation. Bilinear interpolation can smoothly select values from the target image to generate the final corrected image. The corrected image output by the sampler is the image after position alignment. In the corrected image, the position of the product surface has been corrected by the affine transformation matrix, reducing the offset caused by the viewing angle and the light source. The aligned image will be used as the input of the defect detection network.
[0063] It can be seen that in this embodiment, by acquiring the affine transformation matrix of the target image and the sampling coordinate set of the pixels in the target image, and sampling pixels from the target image based on the sampling coordinate set and transforming them according to the affine transformation matrix, a corrected image is generated, and the spatial offset correction of the product surface can be performed at the pixel level, which can improve the accuracy of the image information in the corrected image.
[0064] In some embodiments, before inputting the target image into the spatial variation network in the trained defect detection model for processing and outputting a corrected image of the target image, the method further includes:
[0065] Input the acquired sample image into the spatial variation network in the defect detection model for processing, and output a corrected image of the sample image;
[0066] Inputting the corrected image of the sample image into the defect detection network in the defect detection model for processing, and outputting the defect detection result of the sample image;
[0067] Based on the difference between the defect detection result of the sample image and the annotated detection result of the sample image, the parameters of the spatial variation network and the defect detection network are adjusted to obtain a trained defect detection model.
[0068] Among them, the defect detection result may refer to the detection result obtained by the defect detection model to predict the defects in the sample image, and the defect detection result may include whether there is a defect area, and the location and defect type of the existing defect area. The labeled detection result may refer to the detection result of the real and correct defects in the sample image. The labeled detection result may include the defect area labeled in the sample image, and the defect area is attached with a label, and the label may include the defect type of the defect area. The difference between the defect detection result and the labeled detection result of the same sample image is used as the loss function of the two networks, the spatial variation network and the defect detection network, and the parameters are adjusted together. In some embodiments, when the loss function converges or is less than a preset threshold, a trained defect detection model is formed based on the trained spatial variation network and the defect detection network.
[0069] In some embodiments, the space-varying network indirectly learns the optimization direction of the affine transformation parameters by optimizing the loss function of the defect detection network. Through back propagation, the parameters of the sampler, grid generator, and positioning network are updated. The space-varying network and the defect detection network are trained together to ensure that the space-varying network can accurately predict the offset of the material and provide the defect detection network with aligned high-quality images. The space-varying network and the defect detection network can be trained through standard deep learning processes. Through a large-scale data set of aerial images, the space-varying network and the defect detection network can learn the defect characteristics of the product surface under various light sources and viewing angles. After training, the space-varying network and the defect detection network can be deployed in actual industrial inspection systems to process newly input aerial images in real time.
[0070] It can be seen that in this embodiment, by using the difference between the defect detection result and the labeled detection result of the same sample image and adjusting the parameters of both the spatial variation network and the defect detection network, it is possible to learn both the defect characteristics of the product surface under various light sources and viewing angles and the offset of the product surface under various light sources and viewing angles, so that the spatial variation network provides aligned high-quality images, thereby making the defect detection results more accurate.
[0071] In some embodiments, the labeling detection result of the sample image includes: at least one standard defect area; the standard defect area is obtained by screening defect areas of the same defect in images captured by each viewing angle light source combination.
[0072] Among them, the standard defect area can refer to the correct defect area in the sample image. The same defect can appear in multiple sampled images collected by multiple perspectives and multiple light sources. However, the image information of the defect area of the defect in some sampled images is less or it is difficult to extract effective defect features from it. Such defect areas, as standard defect areas, will affect the defect detection model from learning the correct defect features and spatial transformation information. In order to ensure that the spatial variation network effectively learns the spatial variation information of the product surface, and the defect detection model effectively learns the defect information of the product surface, the clearest and most complete defect area under all perspectives can be selected as the labeled detection result to train the defect detection model, to ensure that the defect detection model can learn effective spatial variation information and obtain accurate defect location prediction results.
[0073] In some embodiments, when the number of defective regions of the same defect is one, the defective region is determined as a standard defective region. When the number of defective regions of the same defect is multiple, the size, grayscale variation range, and clarity of each defective region are obtained, and the defective region with at least one of the largest size, the widest grayscale variation range, and the highest clarity can be selected and determined as the standard defective region. Alternatively, the weights of multiple parameters can be preset, and the parameter values of each parameter are weighted summed, and the defective region with the highest summation result is determined as the standard defective region.
[0074] It can be seen that in this embodiment, by screening the defect areas of the same defect and selecting the optimal defect area as the standard defect area, the features of the standard defect area can be enhanced so that the defect detection model can learn the spatial change information of the product surface and the defect information of the product surface, thereby improving the defect detection accuracy of the defect detection model.
[0075] In some embodiments, a schematic diagram of a defect detection method is shown in FIG. Figure 3 As shown, the flying photography technology is used to take pictures of materials. For example, light source 1 is used to take pictures of multiple perspectives, and light source 2 is used to take pictures of the same perspective. For each picture, the material position is detected by the surface recognition model, and the material picture is cropped. The material pictures of each light source and each perspective are perspective transformed to obtain images of the same viewing plane, and all transformed images of the same viewing plane are spliced to obtain a multi-channel target image. The target image is input into the defect detection model for processing. Specifically, the target image is input into the spatial variation network for processing, and the corrected image is output. The corrected image is input into the defect detection network for processing, and the defect detection result is output. In practical applications, after the flying photography images of multiple light sources and multiple perspectives are cropped, normalized and spliced, the defect detection model performs defect recognition and classification and outputs the final detection result.
[0076] In some embodiments, the embodiments of the present application normalize and splice the images obtained by flying photography, and ultimately only need to use a single defect detection model to process all images, which significantly reduces the need for multiple detection models, simplifies the model development process, and saves a lot of computing resources, while also speeding up the speed of detection reasoning. In addition, only one unified defect detection model needs to be developed and maintained, avoiding the cumbersome process of developing a model separately for each flying image, thereby greatly reducing the cost of system development and subsequent maintenance, which has significant economic advantages for industrial scenarios that need to process a large number of material images; by normalizing the cropped material images to the same scale and plane through perspective transformation, it can be ensured that images under different perspectives and light sources can be processed in the same reference frame, so that the unified detection model can effectively identify and process defects, overcoming the problem of material position differences caused by different perspectives and light sources; by splicing material images under multiple different angles and light sources, and inputting the spliced images into a single defect detection model for defect detection, the defect detection model can process material images from different perspectives and light source combinations, so that the features learned by the defect detection model are more comprehensive and rich, compared with traditional methods that rely on image processing from a single perspective, defects The detection model can more accurately identify potential defects on the surface of materials in a variety of scenarios, overcoming the detection blind spot problem caused by different viewing angles and light sources in traditional methods, and greatly improving the robustness and generalization ability of the model; through the unified processing of unmanned aerial images, it not only greatly reduces the demand for computing resources in the development and reasoning process, but also improves the robustness of the defect detection model through the comprehensive processing of multi-view and multi-light source images, solves the problem of dependence on a single viewpoint in the model training process in the existing technology, can uniformly analyze image information under different angles and light sources, and can effectively process multi-view and multi-light source images in various industrial scenarios, improving It improves the accuracy and efficiency of defect detection and has stronger adaptability to complex industrial scenarios. It is especially suitable for scenarios where surface defects of materials are difficult to observe under specific light sources or viewing angles, and realizes automated quality inspection in a variety of industrial scenarios. By introducing a spatial transformation network to solve the problem of image position alignment of materials under different viewing angles and light source conditions, it can automatically learn and predict the geometric transformation parameters (such as translation, rotation, and scaling) of the material in the image to correct the position offset of the material in the image, so that images from different viewing angles can achieve position consistency before entering a unified defect detection model, thereby ensuring the uniform position of defect features.
[0077] It should be understood that, although the steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indications of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0078] Based on the same inventive concept, the embodiment of the present application also provides a defect detection device. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more defect detection device embodiments provided below can refer to the limitations on the defect detection method above, and will not be repeated here.
[0079] like Figure 4 As shown, an embodiment of the present application provides a defect detection device, comprising:
[0080] The projection module 401 is used to perform unified viewing angle processing on multiple acquired images of the product surface to obtain multiple projection images, wherein each acquired image is an image obtained based on multi-viewing angle and multi-light source shooting;
[0081] A stitching module 402 is used to stitch multiple projection images to obtain a target image;
[0082] The detection module 403 is used to input the target image into the trained defect detection model for processing and output the defect detection result of the product surface.
[0083] In some embodiments, in terms of performing stitching processing on multiple projection images to obtain a target image, the stitching module 402 is specifically used to:
[0084] Multiple projection images are stitched on the channels to obtain a target image; the target image is a multi-channel image.
[0085] In some embodiments, in terms of performing unified viewing angle processing on multiple acquired images of the product surface to obtain multiple projection images, the projection module 401 is specifically used to:
[0086] For any one of the multiple acquired images of the product surface, a target area where the product is located is identified and cropped in the acquired image to obtain an area image;
[0087] The images of each region are projected into the same viewing plane to obtain multiple projection images.
[0088] In some embodiments, in terms of inputting the target image into the trained defect detection model for processing and outputting the defect detection result of the product surface, the detection module 403 is specifically used to:
[0089] Input the target image into the spatial variation network in the trained defect detection model for processing, and output a corrected image of the target image;
[0090] The corrected image of the target image is input into the defect detection network in the defect detection model for processing, and the defect detection result of the product surface is output.
[0091] In some embodiments, the spatial variation network includes a positioning network, a grid generator, and a sampler; in terms of inputting the target image into the spatial variation network in the trained defect detection model for processing and outputting a corrected image of the target image, the detection module 403 is specifically used to:
[0092] Input the target image into the positioning network for processing and output the affine transformation matrix;
[0093] Input the affine transformation matrix into the grid generator for processing, and output the sampling coordinate set of the target image;
[0094] The sampling coordinate set is input into the sampler for processing, and a corrected image of the target image is output.
[0095] In some embodiments, the defect detection device further includes a training module, which is specifically used to:
[0096] Input the acquired sample image into the spatial variation network in the defect detection model for processing, and output a corrected image of the sample image;
[0097] Inputting the corrected image of the sample image into the defect detection network in the defect detection model for processing, and outputting the defect detection result of the sample image;
[0098] Based on the difference between the defect detection result of the sample image and the annotated detection result of the sample image, the parameters of the spatial variation network and the defect detection network are adjusted to obtain a trained defect detection model.
[0099] In some embodiments, the labeling detection result of the sample image includes: at least one standard defect area; the standard defect area is obtained by screening defect areas of the same defect in images captured by each viewing angle light source combination.
[0100] Each module in the above defect detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0101] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer 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 computer device is used to store data related to defect detection. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in the above-mentioned defect detection method are implemented.
[0102] In some embodiments, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, the steps in the above-mentioned defect detection method are implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen; the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0103] Those skilled in the art will understand that Figure 5 or Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0104] In some embodiments, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps in the above method embodiments are implemented.
[0105] In some embodiments, Figure 7 The figure shows an internal structure diagram of a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0106] In some embodiments, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0107] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0108] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments 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 the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0109] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above 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.
[0110] The above 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 present application. 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 present application shall be subject to the attached claims.
Claims
1. A defect detection method, characterized in that: include: Performing unified viewing angle processing on multiple acquired images of the product surface to obtain multiple projection images; wherein each of the acquired images is an image obtained based on multi-viewing angles and multi-light sources; Performing splicing processing on the multiple projection images to obtain a target image; The target image is input into a trained defect detection model for processing, and a defect detection result of the product surface is output.
2. The method according to claim 1, characterized in that The step of performing stitching processing on the plurality of projection images to obtain a target image includes: The multiple projection images are spliced on the channels to obtain a target image; the target image is a multi-channel image.
3. The method according to claim 1, characterized in that The step of performing unified viewing angle processing on the multiple acquired images of the product surface to obtain multiple projection images includes: For any one of the multiple acquired images of the product surface, a target area where the product is located is identified and cropped in the acquired image to obtain an area image; The regional images are projected onto the same viewing plane to obtain a plurality of projection images.
4. The method according to claim 1, characterized in that The step of inputting the target image into a trained defect detection model for processing and outputting a defect detection result of the product surface includes: Inputting the target image into a spatial variation network in a trained defect detection model for processing, and outputting a corrected image of the target image; The corrected image of the target image is input into the defect detection network in the defect detection model for processing, and the defect detection result of the product surface is output.
5. The method according to claim 4, characterized in that The spatial variation network includes a positioning network, a grid generator and a sampler; the inputting the target image into the spatial variation network in the trained defect detection model for processing and outputting a corrected image of the target image includes: Input the target image into the positioning network for processing, and output an affine transformation matrix; Input the affine transformation matrix into the grid generator for processing, and output a sampling coordinate set of the target image; The sampling coordinate set is input into the sampler for processing, and a corrected image of the target image is output.
6. The method according to claim 4, characterized in that Before inputting the target image into the spatial variation network in the trained defect detection model for processing and outputting a corrected image of the target image, the method further includes: Inputting the acquired sample image into the spatial variation network in the defect detection model for processing, and outputting a corrected image of the sample image; Inputting the corrected image of the sample image into the defect detection network in the defect detection model for processing, and outputting the defect detection result of the sample image; Based on the difference between the defect detection result of the sample image and the annotated detection result of the sample image, the parameters of the spatial variation network and the defect detection network are adjusted to obtain the trained defect detection model.
7. The method according to claim 6, characterized in that The labeling detection result of the sample image includes: at least one standard defect area; the standard defect area is obtained by screening defect areas of the same defect in the images collected based on the combination of light sources at each viewing angle.
8. A defect detection device, characterized in that: include: A projection module, used to perform unified viewing angle processing on multiple acquired images of the product surface to obtain multiple projection images; wherein each of the acquired images is an image obtained based on multi-viewing angles and multi-light sources; A stitching module, used for stitching the multiple projection images to obtain a target image; The detection module is used to input the target image into a trained defect detection model for processing and output defect detection results of the product surface.
9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Wafer defect detection method, device, equipment, storage medium and program product
CN119863466A