Appearance defect detection method, device, storage medium and electronic equipment

By identifying defects and performing geometric transformation fusion on the first and second appearance images of completely wireless Bluetooth headsets, the problem of defect segmentation caused by different shooting angles is solved, the detection accuracy is improved and the missed detection rate is reduced, ensuring Accurate assessment of cosmetic defects.

CN118334031BActive Publication Date: 2024-10-29SHENZHEN SMARTMORE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410764896.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-29
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

In the existing technology, in the detection of appearance defects of completely wireless Bluetooth headsets, defects caused by different shooting angles are divided into different partial appearance images, resulting in larger defects being misidentified as several smaller defects, resulting in Problems with low accuracy and high miss detection rate.

Method used

By obtaining the first appearance image and the second appearance image of the object to be detected, defects are identified respectively, and based on the geometric transformation description of the object to be detected, the defects in the overlapping area are fused to obtain the fused appearance defects to improve detection. accuracy and reduce missed detection rates.

Benefits of technology

Restore appearance defects that are segmented into different appearance images due to different shooting angles, which improves the accuracy of appearance defect detection, reduces the missed detection rate, and ensures accurate assessment of whether the object to be inspected meets the factory requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118334031B_ABST
    Figure CN118334031B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a method, device, storage medium and electronic device for detecting appearance defects. The method includes: obtaining a first appearance image and a second appearance image of an object to be detected; wherein there is a first overlapping area between the first appearance image and the second appearance image; performing defect recognition on the first appearance image and the second appearance image respectively to obtain a first appearance defect in the first appearance image and a second appearance defect in the second appearance image; based on the geometric transformation description of the object to be detected, the first appearance defect and the second appearance defect in the first overlapping area are fused to obtain a fused appearance defect; based on the fused appearance defect, the defect detection result of the object to be detected is determined. The present application can improve the accuracy of appearance defect detection and reduce the missed detection rate of appearance defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of appearance defect detection, and in particular to an appearance defect detection method, device, storage medium and electronic device. Background Art

[0002] Completely wireless Bluetooth headsets generally adopt irregular and complex curved surface designs. When visual means are used to inspect the appearance defects of completely wireless Bluetooth headsets, it is necessary to take photos of the completely wireless Bluetooth headsets from different angles. Since each angle can only capture the partial appearance of the completely wireless Bluetooth headset, in order to avoid missing some areas of the completely wireless Bluetooth headset, it is often necessary to take multiple partial appearance images of the completely wireless Bluetooth headset.

[0003] In the related art, the local appearance image of the completely wireless Bluetooth headset is generally used to directly detect the appearance defects of the completely wireless Bluetooth headset. However, the above-mentioned shooting method will cause the larger defects on the surface of the completely wireless Bluetooth headset to be segmented into different local appearance images, resulting in a larger defect being mistakenly identified as several smaller defects during the defect identification process. The size of the defect is an important reference for assessing the defect level. Using the related technology to detect the appearance defects of the completely wireless Bluetooth headset will have the problems of low accuracy and high missed detection rate. Summary of the invention

[0004] The present application provides an appearance defect detection method, device, storage medium and electronic device, which can improve the accuracy of appearance defect detection and reduce the missed detection rate of appearance defect detection.

[0005] In a first aspect of the present application, a method for detecting appearance defects is provided, comprising:

[0006] Acquire a first appearance image and a second appearance image of the object to be detected; wherein there is a first overlapping area between the first appearance image and the second appearance image;

[0007] Performing defect recognition on the first appearance image and the second appearance image respectively to obtain a first appearance defect in the first appearance image and a second appearance defect in the second appearance image;

[0008] Based on the geometric transformation description of the object to be detected, a first appearance defect and a second appearance defect in a first overlapping area are fused to obtain a fused appearance defect;

[0009] Based on the fused appearance defects, the defect detection result of the object to be inspected is determined.

[0010] In a second aspect of the present application, there is provided an appearance defect detection device, comprising:

[0011] An acquisition module, used to acquire a first appearance image and a second appearance image of the object to be detected; wherein there is a first overlapping area between the first appearance image and the second appearance image;

[0012] an identification module, used to perform defect identification on the first appearance image and the second appearance image respectively, to obtain a first appearance defect in the first appearance image and a second appearance defect in the second appearance image;

[0013] A fusion module, configured to fuse the first appearance defect and the second appearance defect in the first overlapping area based on a geometric transformation description of the object to be detected, to obtain a fused appearance defect;

[0014] The determination module is used to determine the defect detection result of the object to be detected based on the fused appearance defects.

[0015] According to a third aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the appearance defect detection method as described above are implemented.

[0016] According to a fourth aspect of the present application, an electronic device is provided. The electronic device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps in the appearance defect detection method as described above are implemented.

[0017] In a fifth aspect of the present application, 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 appearance defect detection method as described above are implemented.

[0018] The technical solution of the present application obtains a first appearance defect in the first appearance image and a second appearance defect in the second appearance image by respectively performing defect recognition on the first appearance image and the second appearance defect in the second appearance image. Then, based on the geometric transformation description of the object to be detected, the first appearance defect and the second appearance defect in the first overlapping area are fused to obtain a fused appearance defect. The present application can restore the appearance defects that are divided into different appearance images due to different shooting angles, and determine the defect detection result of the object to be detected based on the fused appearance defect obtained after restoration, which is conducive to improving the accuracy of appearance defect detection and reducing the missed detection rate of appearance defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 This is an application environment diagram of an appearance defect detection method provided by an embodiment of the present application;

[0020] Figure 2 is a flow chart of a first appearance defect detection method provided in an embodiment of the present application;

[0021] Figure 3 is a flow chart of a second appearance defect detection method provided in an embodiment of the present application;

[0022] Figure 4 is a flow chart of a third appearance defect detection method provided in an embodiment of the present application;

[0023] Figure 5 is a schematic structural diagram of an appearance defect detection device provided in an embodiment of the present application;

[0024] Figure 6 An internal structure diagram of an electronic device provided in an embodiment of the present application;

[0025] Figure 7 An internal structure diagram of another electronic device provided in an embodiment of the present application;

[0026] Figure 8 It is an internal structure diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] 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.

[0028] The appearance 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.

[0029] Figure 2 1 is a flowchart of the first appearance defect detection method provided in the embodiment of the present application. This embodiment can be applied to the appearance defect detection of a completely wireless Bluetooth headset to determine whether the completely wireless Bluetooth headset meets the factory requirements. Next, the method is applied to Figure 1The terminal 102 or the server 104 in the example is used for explanation. It is understandable that the electronic device may include at least one of the terminal and the server. The method includes the following steps:

[0030] S210, acquiring a first appearance image and a second appearance image of the object to be detected; wherein a first overlapping area exists between the first appearance image and the second appearance image.

[0031] The object to be inspected refers to the object that needs to be inspected for appearance defects. The appearance of the object to be inspected is mostly irregular and complex curved surfaces. The object to be inspected is a completely wireless Bluetooth headset. Appearance defect inspection of the object to be inspected refers to the inspection of defects on the surface of the object to be inspected, such as scratches and discoloration.

[0032] The first appearance image and the second appearance image are both used to describe the local appearance of the object to be detected. The first appearance image and the second appearance image are obtained by photographing the object to be detected at different shooting angles. The shooting angles corresponding to the first appearance image and the second appearance image are adjacent.

[0033] The first overlapping area refers to the area where the first appearance image and the second appearance image intersect in space. The first overlapping area includes the part where the object to be detected appears in both the first appearance image and the second appearance image.

[0034] S220 , performing defect recognition on the first appearance image and the second appearance image respectively to obtain a first appearance defect in the first appearance image and a second appearance defect in the second appearance image.

[0035] In some embodiments, a defect recognition model is used to perform defect recognition on the first appearance image and the second appearance image respectively. The defect recognition model may be a neural network model built using deep learning technology. In the process of using the defect detection model to perform defect detection, a GPU (Graphic Processing Unit) is used for reasoning acceleration. The defect recognition model may be an existing one, which is not the focus of the research of this application.

[0036] The first appearance defect refers to an appearance defect identified from the first appearance image, and the second appearance defect refers to an appearance defect identified from the second appearance image.

[0037] The number of the first appearance defect and the second appearance defect is not limited here, and is determined according to actual conditions. That is, there can be multiple first appearance defects and multiple second appearance defects.

[0038] S230 . Based on the geometric transformation description of the object to be detected, fuse the first appearance defect and the second appearance defect in the first overlapping area to obtain a fused appearance defect.

[0039] Since there is a first overlapping area between the first appearance image and the second appearance image, the first appearance defect identified from the first appearance image and the second appearance defect identified from the second appearance image may include the same appearance defect.

[0040] The geometric transformation description of the object to be detected is used to describe the geometric transformation of the object to be detected in space, and the positional relationship of each point on the surface of the object to be detected during the geometric transformation process. The geometric transformation can be an affine transformation such as rotation, scaling, and translation. Based on the geometric transformation description of the object to be detected, the positional relationship between the first appearance defect and the second appearance defect can be determined.

[0041] In some embodiments, based on the geometric transformation description of the object to be detected, the first appearance defect is mapped to the second appearance image. Then, the first appearance defect and the second appearance defect in the first overlapping area are fused in the second appearance image to obtain a fused appearance defect.

[0042] In some embodiments, the process of defect fusion is performed by using OpenMP (Open Multi-Processing) for parallel acceleration, wherein OpenMP is a set of multi-threaded concurrent programming APIs (Application Programming Interface) that can be run in most processor systems and operating systems.

[0043] S240: Determine a defect detection result of the object to be detected based on the fused appearance defects.

[0044] Among them, the defect detection result is used to measure whether the object to be detected meets the factory requirements. The fused appearance defect is obtained by fusing the first appearance defect and the second appearance defect belonging to the same appearance defect in the first overlapping area. The first appearance defect and the second appearance defect are appearance defects that fall at different shooting angles.

[0045] The fused appearance defect is the restoration of the appearance defect that is segmented into different appearance images due to different shooting angles. The defect specifications of the fused appearance defect are determined, and based on the defect specifications of the fused appearance defect, it is determined whether the object to be inspected meets the factory requirements.

[0046] It is worth noting that in the embodiment of the present application, the appearance defects in two appearance images with adjacent shooting angles are fused. This is because in actual production activities, generally, the fusion of appearance defects in two appearance images is sufficient to screen out the objects to be inspected that do not meet the factory requirements, which does not limit the technical solution of the present application. Inspired by the technical solution provided in the embodiment of the present application, those skilled in the art can fuse the appearance defects in multiple appearance images with adjacent shooting angles, which should all be included in the scope of protection of the present application.

[0047] The technical solution of the present application obtains the first appearance defect in the first appearance image and the second appearance defect in the second appearance image by respectively performing defect recognition on the first appearance image and the second appearance defect in the second appearance image. Then, based on the geometric transformation description of the object to be detected, the first appearance defect and the second appearance defect in the first overlapping area are fused to obtain a fused appearance defect. The present application can restore the appearance defects that are divided into different appearance images due to different shooting angles, and determine the defect detection results of the object to be detected based on the fused appearance defects obtained after restoration, which is conducive to improving the accuracy of appearance defect detection and reducing the missed detection rate of appearance defect detection. It solves the problem that larger defects on the surface of the object to be detected are divided into different local appearance images, resulting in a larger defect being mistakenly identified as several smaller defects, resulting in a high missed detection rate of appearance defects.

[0048] In some embodiments, obtaining a first appearance image and a second appearance image of the object to be detected includes:

[0049] Acquire multiple local appearance images of the object to be detected, and determine the shooting angle corresponding to each local appearance image;

[0050] Two partial appearance images with adjacent shooting angles are selected as the first appearance image and the second appearance image, so that there is an overlapping area between the first appearance image and the second appearance image.

[0051] In some embodiments, a profiling jig is used to fix the object to be inspected on a defect inspection machine, and a customized lighting light source is controlled to illuminate the object to be inspected. The defect inspection machine controls the object to be inspected to rotate at a set angle, and after the object to be inspected rotates at the set angle, the object to be inspected is photographed to obtain a partial appearance image of the object to be inspected.

[0052] The customized lighting light source may be a customized C-type light source, which is used to project a light spot onto the surface of the object to be inspected. Appearance defects of the object to be inspected will be exposed in the light spot projected by the customized lighting light source.

[0053] Every time the object to be detected rotates a set angle, the object to be detected will be photographed to obtain a local appearance image of the object to be detected. In other words, each local appearance image has a corresponding shooting angle. Among them, the set angle is determined according to actual business needs and is not limited here. What needs to be ensured is that there is an overlapping area between two local appearance images with adjacent shooting angles. Exemplarily, the set angle can be 6 degrees. The value of the set angle will affect the number of local appearance images. When the set angle is 6 degrees, the number of local appearance images is 60. Multiple local appearance images of the object to be detected together cover the entire surface of the object to be detected.

[0054] The first appearance image and the second appearance image are generated from the partial appearance images, and any two partial appearance images with adjacent shooting angles in the partial appearance images can be used as the first appearance image and the second appearance image. This is because there is an overlapping area between the two partial appearance images with adjacent shooting angles.

[0055] The above technical solution provides a practical solution for determining the first appearance image and the second appearance image. By selecting two local appearance images with adjacent shooting angles as the first appearance image and the second appearance image, it is ensured that there is an overlapping area between the first appearance image and the second appearance image, which provides data support for subsequent defect fusion to obtain a fused appearance defect.

[0056] In some embodiments, determining a defect detection result of the object to be detected based on the fused appearance defects includes:

[0057] Determine a defect specification of the fused appearance defect, and determine a target defect level to which the fused appearance defect belongs based on the defect specification;

[0058] Determine the defect detection results of the object to be inspected based on the target defect level and factory level requirements.

[0059] The defect specification of the fused appearance defect is used to measure the defect level to which the fused appearance defect belongs. Exemplarily, the defect specification of the fused appearance defect may include the size of the fused appearance defect such as length and width, and may also include the grayscale of the fused appearance defect. The target defect level refers to the defect level to which the fused appearance defect belongs, and is used to quantify the severity of the fused appearance defect.

[0060] The factory level requirement is used to measure whether the object to be inspected meets the factory requirements in terms of the fused appearance defects with the target defect level. The factory level requirement is determined based on actual business needs and is not limited here.

[0061] In some embodiments, the target defect level is compared with the factory level requirement to determine the relative size relationship between the two. The defect detection result of the object to be detected is determined based on the relative size relationship between the two, and further determines whether the object to be detected meets the factory requirements.

[0062] The above technical solution restores the appearance defects that are divided into different appearance images due to different shooting angles to obtain fused appearance defects. Based on the defect specifications of the fused appearance defects, it is determined whether the object to be inspected meets the factory requirements, which solves the problem that larger defects on the surface of the object to be inspected are divided into different local appearance images, resulting in a larger defect being mistakenly identified as several smaller defects, resulting in a high missed detection rate of appearance defects. The accuracy of appearance defect detection is improved and the missed detection rate of appearance defect detection is reduced.

[0063] Figure 3 is a flow chart of a second appearance defect detection method provided by an embodiment of the present application. This embodiment is further optimized on the basis of the above embodiment. Specifically, the embodiment of the present application provides a feasible solution for determining the geometric transformation description of the object to be detected. The method includes:

[0064] S310, acquiring multiple local appearance images of the template object; wherein a second overlapping region exists between two local appearance images with adjacent shooting angles; the multiple second overlapping regions together cover the entire surface of the template object; and there are multiple marks on the surface of the template object.

[0065] The template object meets the factory requirements and has no appearance defects. The template object and the object to be detected are the same product, the same model, and the corresponding factory requirements of the two are consistent. The template object is used to construct the geometric transformation description of the object to be detected.

[0066] In some embodiments, the multiple marks on the surface of the template object have different shapes and colors. The multiple marks on the surface of the template object are symbols of different shapes drawn on the surface of the template object using markers of different colors. Ensure that there are as many marks on the surface of the template object as possible, so that they are distributed on each curved surface of the template object.

[0067] In some embodiments, a profiling jig is used to fix the template object on a defect detection machine, and a customized lighting light source is controlled to illuminate the template object. The defect detection machine controls the template object to rotate at a set angle, and after the template object rotates at the set angle, the template object is photographed to obtain a partial appearance image of the template object.

[0068] S320: Determine the mark in the second overlapping area as a common mark, and determine an affine transformation matrix corresponding to the mark on the surface of the template object based on the position coordinates of the common mark in two local appearance images with adjacent shooting angles.

[0069] The common mark refers to a mark that appears in the second overlapping area and appears simultaneously in two local appearance images with adjacent shooting angles.

[0070] For the convenience of description, two local appearance images with adjacent shooting angles selected from a plurality of local appearance images of the template object are determined as the third appearance image and the fourth appearance image.

[0071] For the common markers shared by the third appearance image and the fourth appearance image, the position coordinates of the common markers in the third appearance image and the fourth appearance image are determined respectively.

[0072] Although the position coordinates of the common marker in the third appearance image and the fourth appearance image are different, they refer to the same marker in physical space. Therefore, a geometric transformation can be found to map the common marker between the third appearance image and the fourth appearance image to the same coordinate position.

[0073] The affine transformation matrix of the common marker is used to describe the position transformation of the common marker between two local appearance images with adjacent shooting angles.

[0074] There is a second overlapping area between two local appearance images with adjacent shooting angles, and several second overlapping areas together cover the entire surface of the template object. In other words, each mark on the surface of the template object will be determined as a common mark, but the corresponding local appearance images are different. Therefore, the affine transformation matrix corresponding to each mark on the surface of the template object can be determined.

[0075] S330 , determining a geometric transformation description of the object to be detected based on an affine transformation matrix corresponding to the mark on the surface of the template object.

[0076] The affine transformation matrix corresponding to the marks on the surface of the template object can describe the positional relationship of the marks on the surface of the template object during the geometric transformation process. Based on the affine transformation matrix corresponding to the marks on the surface of the template object, the positional relationship of each point on the surface of the template object during the geometric transformation process can be further determined, that is, the geometric transformation description of the template object.

[0077] The template object and the object to be detected are the same product and have the same model. Therefore, the geometric transformation description of the template object can be determined as the geometric transformation description of the object to be detected.

[0078] The technical solution of the present application obtains multiple local appearance images of the template object; wherein, there is a second overlapping area between two local appearance images with adjacent shooting angles; several second overlapping areas jointly cover the entire surface of the template object; and there are multiple marks on the surface of the template object. The marks in the second overlapping area are determined as common marks, and based on the position coordinates of the common marks in the two local appearance images with adjacent shooting angles, the affine transformation matrix corresponding to the marks on the surface of the template object is determined. Based on the affine transformation matrix corresponding to the marks on the surface of the template object, the geometric transformation description of the object to be detected is determined. A feasible affine transformation matrix determination scheme is provided, which can be used to determine the affine transformation matrix corresponding to the marks on the surface of the template object. Technical support is provided for the subsequent determination of the geometric transformation description of the object to be detected based on the affine transformation matrix corresponding to the marks on the surface of the template object.

[0079] In some embodiments, determining a geometric transformation description of the object to be detected based on an affine transformation matrix corresponding to a mark on the surface of the template object includes:

[0080] In the local appearance image of the template object, determining the target pixel;

[0081] If the target pixel does not belong to the mark, a weight coefficient is determined for an affine transformation matrix corresponding to the mark on the surface of the template object according to a relative distance between the mark on the surface of the template object and the target pixel;

[0082] Performing weighted processing on the affine transformation matrix corresponding to the mark on the surface of the template object based on the weight coefficient to obtain a weighted result;

[0083] Based on the weighted result, determine the affine transformation matrix corresponding to the target pixel; or,

[0084] If the target pixel belongs to a mark, the affine transformation matrix corresponding to the mark to which the target pixel belongs is determined as the affine transformation matrix corresponding to the target pixel;

[0085] Based on the affine transformation matrix corresponding to the target pixel, the geometric transformation description of the object to be detected is determined.

[0086] Among them, the target pixel belongs to the local appearance image of the template object. Although there are multiple marks distributed on the surface of the template object, there are blank spaces on the surface of the template object that are not covered by the marks. Therefore, the target pixel may belong to the mark on the surface of the template object or the blank space on the surface of the template object.

[0087] In some embodiments, whether the target pixel belongs to a mark on the surface of the template object is determined according to the grayscale of the target pixel.

[0088] If the target pixel does not belong to the mark on the surface of the template object, it means that the target object belongs to the blank space on the surface of the template object, and then the relative distance between the mark on the surface of the template object and the target pixel is determined.

[0089] Among them, the relative distance between the mark on the surface of the template object and the target pixel is used to determine the weight coefficient of the affine transformation matrix corresponding to the mark on the surface of the template object. Among them, the weight coefficient is used to determine the contribution of the affine transformation matrix corresponding to the mark on the surface of the template object to the affine transformation matrix corresponding to the target pixel. The relative distance between the mark on the surface of the template object and the target pixel is negatively correlated with the weight coefficient of the affine transformation matrix corresponding to the mark on the surface of the template object. The greater the relative distance, the smaller the contribution, and accordingly, the smaller the weight coefficient.

[0090] The affine transformation matrix corresponding to the mark on the surface of the template object is weighted based on the weight coefficient to obtain a weighted result, and the weighted result is used as the affine transformation matrix corresponding to the target pixel.

[0091] If the target pixel belongs to a mark on the surface of the template object, since all marks on the surface of the template object have corresponding affine transformation matrices, the affine transformation matrix corresponding to the mark to which the target pixel belongs can be determined as the affine transformation matrix corresponding to the target pixel.

[0092] Through the above operations, the affine transformation matrix corresponding to each point on the surface of the template object can be determined. The geometric transformation description of the object to be detected is also determined accordingly. The template object and the object to be detected are the same product and have the same model. Therefore, the geometric transformation description of the template object can be determined as the geometric transformation description of the object to be detected.

[0093] The above technical scheme provides a practical solution for determining the geometric transformation description of the object to be detected, and provides technical support for the subsequent appearance defect fusion based on the geometric transformation description of the object to be detected, which is conducive to improving the accuracy of appearance defect detection and reducing the missed detection rate of appearance defect detection.

[0094] Figure 4 : is a flow chart of a third appearance defect detection method provided in an embodiment of the present application. This embodiment is further optimized on the basis of the above embodiment. The method includes:

[0095] S410, acquiring a first appearance image and a second appearance image of an object to be detected; wherein a first overlapping area exists between the first appearance image and the second appearance image.

[0096] S420 , performing defect recognition on the first appearance image and the second appearance image respectively to obtain a first appearance defect in the first appearance image and a second appearance defect in the second appearance image.

[0097] S430 : Determine an affine transformation matrix corresponding to the first appearance defect based on the geometric transformation description of the object to be detected and the position coordinates of the first appearance defect in the first appearance image.

[0098] The geometric transformation description of the object to be detected is determined based on the affine transformation matrix of each point on the surface of the object to be detected. The affine transformation matrix of each point on the surface of the object to be detected is used to describe the positional relationship of each point on the surface of the object to be detected during the geometric transformation process.

[0099] The first appearance defect also belongs to a point on the surface of the object to be detected. If the position coordinates of the first appearance defect in the first appearance image are known, the affine transformation matrix corresponding to the first appearance defect can be determined based on the geometric transformation description of the object to be detected.

[0100] S440: Map the first appearance defect to the second appearance image based on an affine transformation matrix corresponding to the first appearance defect.

[0101] S450: Fusing the first appearance defect and the second appearance defect in the first overlapping area in the second appearance image to obtain a fused appearance defect.

[0102] Based on the affine transformation matrix corresponding to the first appearance defect, the first appearance defect in the first overlapping area is mapped to the second appearance image. In this way, the second appearance image includes both the first appearance defect and the second appearance defect.

[0103] The first appearance defect and the second appearance defect in the first overlapping area are merged in the second appearance image to obtain a merged appearance defect.

[0104] S460: Determine a defect detection result of the object to be detected based on the fused appearance defects.

[0105] The technical solution of the present application determines the affine transformation matrix corresponding to the first appearance defect based on the geometric transformation description of the object to be detected and the position coordinates of the first appearance defect in the first appearance image. Based on the affine transformation matrix corresponding to the first appearance defect, the first appearance defect is mapped to the second appearance image. In the second appearance image, the first appearance defect and the second appearance defect in the first overlapping area are fused to obtain a fused appearance defect. A feasible defect fusion solution is provided, which provides technical support for the subsequent use of fused appearance defects to determine the defect detection results of the object to be detected.

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

[0107] Acquire appearance attributes of the first appearance defect and the second appearance defect;

[0108] determining appearance attributes of the fused appearance defects;

[0109] The accuracy of defect fusion is determined based on the appearance attribute of the fused appearance defect, the appearance attributes of the first appearance defect, and the second appearance defect.

[0110] In some embodiments, the appearance attributes include position information, shape information, grayscale information, etc. In the process of performing defect recognition on the first appearance image and the second appearance image respectively, the appearance attributes of the first appearance defect and the second appearance defect are obtained.

[0111] The fused appearance defect is obtained by fusing the first appearance defect and the second appearance defect. After the first appearance defect and the second appearance defect are fused, defect recognition is performed again to obtain the appearance attribute of the fused appearance defect.

[0112] Then, the appearance attributes of the fused appearance defect are compared with the appearance attributes of the first appearance defect and the appearance attributes of the second appearance defect to determine the accuracy of the defect fusion. Optionally, the accuracy of the defect fusion is compared with an accuracy threshold to further determine the accuracy of the defect fusion.

[0113] The reason why the appearance attributes of the fused appearance defect are compared with the appearance attributes of the first appearance defect and the appearance attributes of the second appearance defect is that there is distortion in the geometric transformation process. Deviations may occur in the process of mapping the first appearance defect to the second appearance image, causing different appearance defects that are relatively close in the first appearance defect to be mapped into one appearance defect in the second appearance image, affecting the accuracy of defect fusion.

[0114] The above technical solution determines the appearance attributes of the fused appearance defect, the appearance attributes of the first appearance defect and the second appearance defect, compares the appearance attributes of the fused appearance defect with the appearance attributes of the first appearance defect and the second appearance defect, and determines the accuracy of defect fusion. This is conducive to improving the accuracy of defect fusion, and using the fused appearance defect to determine the defect detection result of the object to be detected is conducive to improving the accuracy of appearance defect detection and reducing the missed detection rate of appearance defect detection.

[0115] 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 clearly stated 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.

[0116] Based on the same inventive concept, the embodiment of the present application also provides an appearance 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 appearance defect detection device embodiments provided below can refer to the limitations of the appearance defect detection method above, and will not be repeated here.

[0117] like Figure 5 As shown, the embodiment of the present application provides an appearance defect detection device 500, comprising:

[0118] An acquisition module 510 is used to acquire a first appearance image and a second appearance image of the object to be detected; wherein there is a first overlapping area between the first appearance image and the second appearance image;

[0119] An identification module 520 is used to perform defect identification on the first appearance image and the second appearance image respectively to obtain a first appearance defect in the first appearance image and a second appearance defect in the second appearance image;

[0120] A fusion module 530 is used to fuse the first appearance defect and the second appearance defect in the first overlapping area based on the geometric transformation description of the object to be detected to obtain a fused appearance defect;

[0121] The determination module 540 is used to determine the defect detection result of the object to be detected based on the fused appearance defects.

[0122] In some embodiments, the appearance defect detection device 500 further includes:

[0123] An appearance image acquisition module is used to acquire multiple local appearance images of a template object; wherein a second overlapping region exists between two local appearance images with adjacent shooting angles; the plurality of second overlapping regions together cover the entire surface of the template object; and there are multiple marks on the surface of the template object;

[0124] A first affine transformation matrix determination module is used to determine the mark in the second overlapping area as a common mark, and determine the affine transformation matrix corresponding to the mark on the surface of the template object based on the position coordinates of the common mark in two local appearance images with adjacent shooting angles;

[0125] The geometric transformation description determination module is used to determine the geometric transformation description of the object to be detected based on the affine transformation matrix corresponding to the mark on the surface of the template object.

[0126] In some embodiments, in determining the geometric transformation description of the object to be detected based on the affine transformation matrix corresponding to the mark on the surface of the template object, the geometric transformation description determination module is specifically used to:

[0127] In the local appearance image of the template object, determining the target pixel;

[0128] If the target pixel does not belong to the mark, a weight coefficient is determined for an affine transformation matrix corresponding to the mark on the surface of the template object according to a relative distance between the mark on the surface of the template object and the target pixel;

[0129] Performing weighted processing on the affine transformation matrix corresponding to the mark on the surface of the template object based on the weight coefficient to obtain a weighted result;

[0130] Based on the weighted result, determine the affine transformation matrix corresponding to the target pixel; or,

[0131] If the target pixel belongs to a mark, the affine transformation matrix corresponding to the mark to which the target pixel belongs is determined as the affine transformation matrix corresponding to the target pixel;

[0132] Based on the affine transformation matrix corresponding to the target pixel, the geometric transformation description of the object to be detected is determined.

[0133] In some embodiments, in terms of fusing the first appearance defect and the second appearance defect in the first overlapping area based on the geometric transformation description of the object to be detected to obtain a fused appearance defect, the fusion module 530 is specifically used to:

[0134] Determine an affine transformation matrix corresponding to the first appearance defect based on a geometric transformation description of the object to be detected and position coordinates of the first appearance defect in the first appearance image;

[0135] Mapping the first appearance defect to a second appearance image based on an affine transformation matrix corresponding to the first appearance defect;

[0136] The first appearance defect and the second appearance defect in the first overlapping area are fused in the second appearance image to obtain a fused appearance defect.

[0137] In some embodiments, in determining the defect detection result of the object to be detected based on the fused appearance defects, the determination module 540 is specifically used to:

[0138] Determine a defect specification of the fused appearance defect, and determine a target defect level to which the fused appearance defect belongs based on the defect specification;

[0139] Determine the defect detection results of the object to be inspected based on the target defect level and factory level requirements.

[0140] In some embodiments, in acquiring the first appearance image and the second appearance image of the object to be detected, the acquisition module 510 is specifically used to:

[0141] Acquire multiple local appearance images of the object to be detected, and determine the shooting angle corresponding to each local appearance image;

[0142] Two partial appearance images with adjacent shooting angles are selected as the first appearance image and the second appearance image, so that there is an overlapping area between the first appearance image and the second appearance image.

[0143] In some embodiments, the appearance defect detection device 500 further includes:

[0144] A first attribute acquisition module, used to acquire the appearance attributes of the first appearance defect and the second appearance defect;

[0145] A second attribute acquisition module is used to determine the appearance attributes of the fused appearance defects;

[0146] The fusion accuracy determination module is used to determine the accuracy of defect fusion based on the appearance attributes of the fused appearance defect, the first appearance defect, and the second appearance defect.

[0147] Each module in the above-mentioned appearance defect detection device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in an electronic device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0148] In some embodiments, an electronic device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown. The electronic 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 electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data required for appearance defect detection. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in the above-mentioned appearance defect detection method are implemented.

[0149] In some embodiments, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The electronic 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 electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system 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 electronic device is used to exchange information between the processor and the external device. The communication interface of the electronic 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 appearance defect detection method are implemented. The display unit of the electronic 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 electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

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

[0151] In some embodiments, an electronic device is provided. The electronic 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.

[0152] like Figure 8 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.

[0153] 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.

[0154] 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.

[0155] 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 this 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.

[0156] 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.

[0157] 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 method for detecting appearance defects, characterized in that: include: Acquire a first appearance image and a second appearance image of the object to be detected; wherein there is a first overlapping area between the first appearance image and the second appearance image; Performing defect recognition on the first appearance image and the second appearance image respectively to obtain a first appearance defect in the first appearance image and a second appearance defect in the second appearance image; Based on the geometric transformation description of the object to be detected, the first appearance defect and the second appearance defect in the first overlapping area are fused to obtain a fused appearance defect; Determining a defect detection result of the object to be detected based on the fused appearance defect; The step of fusing the first appearance defect and the second appearance defect in the first overlapping area based on the geometric transformation description of the object to be detected to obtain a fused appearance defect includes: Determine an affine transformation matrix corresponding to the first appearance defect based on a geometric transformation description of the object to be detected and position coordinates of the first appearance defect in the first appearance image; Mapping the first appearance defect to the second appearance image based on an affine transformation matrix corresponding to the first appearance defect; The first appearance defect and the second appearance defect in the first overlapping area are fused in the second appearance image to obtain a fused appearance defect.

2. The method according to claim 1, characterized in that Before fusing the first appearance defect and the second appearance defect in the first overlapping area based on the geometric transformation description of the object to be detected to obtain the fused appearance defect, the method further includes: Acquire multiple local appearance images of the template object; wherein there is a second overlapping area between two local appearance images with adjacent shooting angles; a plurality of the second overlapping areas together cover the entire surface of the template object; and there are multiple marks on the surface of the template object; Determine the mark in the second overlapping area as a common mark, and determine the affine transformation matrix corresponding to the mark on the surface of the template object based on the position coordinates of the common mark in two local appearance images with adjacent shooting angles; Based on the affine transformation matrix corresponding to the mark on the surface of the template object, a geometric transformation description of the object to be detected is determined.

3. The method according to claim 2, characterized in that The step of determining the geometric transformation description of the object to be detected based on the affine transformation matrix corresponding to the mark on the surface of the template object comprises: In the local appearance image of the template object, determining a target pixel; If the target pixel does not belong to the mark, a weight coefficient is determined for an affine transformation matrix corresponding to the mark on the surface of the template object according to a relative distance between the mark on the surface of the template object and the target pixel; and a weighted processing is performed on the affine transformation matrix corresponding to the mark on the surface of the template object based on the weight coefficient to obtain a weighted result; Based on the weighted result, determining the affine transformation matrix corresponding to the target pixel; or, If the target pixel belongs to the tag, the affine transformation matrix corresponding to the tag to which the target pixel belongs is determined as the affine transformation matrix corresponding to the target pixel; Based on the affine transformation matrix corresponding to the target pixel, a geometric transformation description of the object to be detected is determined.

4. The method according to claim 1, characterized in that: The step of determining a defect detection result of the object to be detected based on the fused appearance defect includes: Determining a defect specification of the fused appearance defect, and determining a target defect level to which the fused appearance defect belongs based on the defect specification; Based on the target defect level and the factory level requirement, a defect detection result of the object to be detected is determined.

5. The method according to claim 1, characterized in that The step of acquiring a first appearance image and a second appearance image of the object to be detected includes: Acquire multiple local appearance images of the object to be detected, and determine the shooting angle corresponding to each local appearance image; Two partial appearance images with adjacent shooting angles are selected as the first appearance image and the second appearance image, so that there is an overlapping area between the first appearance image and the second appearance image.

6. The method according to claim 1, characterized in that The method further comprises: Acquire appearance attributes of the first appearance defect and the second appearance defect; Determining an appearance attribute of the fused appearance defect; The accuracy of defect fusion is determined based on the appearance attribute of the fused appearance defect, the appearance attributes of the first appearance defect, and the second appearance defect.

7. An appearance defect detection device, characterized in that: include: An acquisition module, used to acquire a first appearance image and a second appearance image of the object to be detected; wherein there is a first overlapping area between the first appearance image and the second appearance image; an identification module, configured to perform defect identification on the first appearance image and the second appearance image respectively, to obtain a first appearance defect in the first appearance image and a second appearance defect in the second appearance image; a fusion module, configured to fuse the first appearance defect and the second appearance defect in the first overlapping area based on a geometric transformation description of the object to be detected, so as to obtain a fused appearance defect; A determination module, used to determine a defect detection result of the object to be detected based on the fused appearance defect; Wherein, the fusion module is specifically used for: Determine an affine transformation matrix corresponding to the first appearance defect based on a geometric transformation description of the object to be detected and position coordinates of the first appearance defect in the first appearance image; Mapping the first appearance defect to the second appearance image based on an affine transformation matrix corresponding to the first appearance defect; The first appearance defect and the second appearance defect in the first overlapping area are fused in the second appearance image to obtain a fused appearance defect.

8. 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 6 are implemented.

9. An electronic 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 6 are implemented.

Citation Information

Patent Citations

  • Defect detection method, device and equipment based on feature fusion and storage medium

    CN114782756A