Defect detection method and device and computer storage medium

By extracting the independent bright and dark area feature information of products such as glass cover plates for defect detection, the problem of high efficiency and low cost in existing technologies is solved, and efficient and low-cost defect detection is achieved.

CN120685677APending Publication Date: 2025-09-23LENS TECHNOLOGY CO LTD

Patent Information

Application Number
CN202410319888.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-20
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In existing technologies, defect detection for products such as glass cover plates and touch screens is inefficient and costly, deep learning detection is time-consuming and complex, and the cost of building three-dimensional models is high.

Method used

By acquiring a complete image of the surface to be inspected, extracting the grayscale value of each pixel, separating independent bright and dark areas from the image based on the grayscale value, and utilizing the characteristic information of the bright and dark areas for defect detection, the performance requirements for the image processor are reduced.

Benefits of technology

It improves detection efficiency, reduces costs, eliminates the need for high-performance image processors, and simplifies the detection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120685677A_ABST
    Figure CN120685677A_ABST
Patent Text Reader

Abstract

The invention discloses a defect detection method and device and a computer storage medium, and belongs to the technical field of product detection. The method comprises the following steps: acquiring a complete image of a to-be-detected plane, and extracting a gray value of each pixel point in the complete image; independent bright areas and independent dark areas are extracted from the complete image based on the gray values, and the average gray value of the independent bright areas is larger than the average gray value of the independent dark areas; and performing defect detection on the complete image according to the feature information of the independent bright area and the independent dark area. Through the plane defect detection method and device, the technical problems of low detection efficiency and high cost of a plane defect detection mode in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of product detection technology, and in particular to a defect detection method, device, and computer storage medium. Background Art

[0002] Currently, the manufacturing process of products such as glass cover plates and touch screens includes multiple steps, each of which will produce various appearance defects.

[0003] Related technologies primarily target defect detection through deep learning and 3D modeling. Deep learning, however, requires a long time to maintain and train models, resulting in low efficiency. 3D models are complex, require a large memory footprint, and are expensive. Consequently, these technologies for flat surface defect detection suffer from low efficiency and high costs.

[0004] Currently, no effective solutions have been found for the above-mentioned problems existing in the related technologies. Summary of the Invention

[0005] The present application provides a defect detection method, device and computer storage medium to solve the above-mentioned technical problems existing in the related art.

[0006] According to one embodiment of the present application, a defect detection method is provided, including: obtaining a complete image of a plane to be inspected, and extracting the grayscale value of each pixel in the complete image; extracting independent bright areas and independent dark areas from the complete image based on the grayscale values, wherein the average grayscale value of the independent bright areas is greater than the average grayscale value of the independent dark areas; and performing defect detection on the complete image based on feature information of the independent bright areas and the independent dark areas.

[0007] According to another embodiment of the present application, a defect detection device is provided, including: an acquisition module for acquiring a complete image of a plane to be detected and extracting the grayscale value of each pixel in the complete image; an extraction module for extracting independent bright areas and independent dark areas from the complete image based on the grayscale values, wherein the average grayscale value of the independent bright areas is greater than the average grayscale value of the independent dark areas; and a detection module for performing defect detection on the complete image based on feature information of the independent bright areas and the independent dark areas.

[0008] According to another embodiment of the present application, a computer storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned device embodiments when running.

[0009] According to another embodiment of the present application, a computer program product comprising instructions is provided. When the computer program product is run on a computer, the computer is caused to execute the steps in the above method.

[0010] Through the embodiments of the present application, a complete image of the plane to be inspected is obtained, and the grayscale value of each pixel in the complete image is extracted. Based on the grayscale value, independent bright areas and independent dark areas are extracted from the complete image, wherein the average grayscale value of the independent bright areas is greater than the average grayscale value of the independent dark areas. Based on the feature information of the independent bright areas and the independent dark areas, defect detection is performed on the complete image. Based on the different imaging effects of different defects in the complete imaging, defect detection is achieved through the feature expression of the bright and dark areas of the defects. Compared with deep learning detection, it does not require a large number of samples for training, which improves detection efficiency. Compared with three-dimensional modeling, it does not require a high-performance image processor, and only an ordinary image processor is needed to complete the detection task, which reduces costs. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0012] Figure 1 This is a hardware structure block diagram of a computer according to an embodiment of the present application;

[0013] Figure 2 is a flow chart of a defect detection method according to an embodiment of the present application;

[0014] Figure 3 Schematic diagram of the optical principle of concave-convex defects in the embodiment of the present application;

[0015] Figure 4 Schematic diagram of the imaging effect of concave-convex defects in the embodiment of the present application;

[0016] Figure 5 is a schematic diagram of the coordinate reference system in the embodiment of the present application;

[0017] Figure 6 Schematic diagram of the merging process of pit defects in an embodiment of the present application;

[0018] Figure 7 2. This is a schematic diagram comparing the imaging effects of pit defects and dust in the embodiment of the present application;

[0019] Figure 8 This is a structural block diagram of a defect detection device according to an embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of this application. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] Example 1

[0023] The method embodiment provided in the first embodiment of the present application can be executed on a computer, tablet or similar computing device. Taking running on a computer as an example, Figure 1 This is a hardware structure diagram of a computer according to an embodiment of the present application. Figure 1 As shown, the computer may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. Optionally, the above computer may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0024] Memory 104 can be used to store computer programs, such as software programs and modules for application software, such as a computer program corresponding to a defect detection method in an embodiment of the present application. Processor 102 executes the computer program stored in memory 104 to perform various functional applications and data processing, thereby implementing the aforementioned method. Memory 104 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory remotely located from processor 102, which can be connected to the computer via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0025] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by a computer's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0026] In this embodiment, a defect detection method is provided. Figure 2 is a flow chart of a defect detection method according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:

[0027] Step S10, obtaining a complete image of the plane to be inspected, and extracting the grayscale value of each pixel in the complete image (the grayscale value refers to the brightness or grayscale degree of each pixel in the image);

[0028] Step S20, extracting independent bright areas and independent dark areas from the complete image based on the grayscale values, wherein the average grayscale value of the independent bright areas is greater than the average grayscale value of the independent dark areas;

[0029] Step S30 : performing defect detection on the complete image according to the feature information of the independent bright area and the independent dark area.

[0030] In this embodiment, the plane to be inspected includes the plane of the product to be inspected for defects, including but not limited to glass cover plates, ceramic cover plates, gemstone cover plates, metal sheets, plastic plates, and other flat products.

[0031] In this embodiment, the complete image of the plane to be detected is obtained by optically imaging the plane to be detected through an image collector, where the image collector can be a camera, a video capture device, a scanner, etc.

[0032] According to optical principles, due to the morphological differences between various defects, different defects reflect and project light differently. Consequently, different light rays entering the image collector through different defects also appear differently in the complete image. These differences in imaging manifest as different brightness distributions. Therefore, this embodiment extracts the grayscale value of each pixel in the complete image. Based on this grayscale value, independent bright and dark regions are extracted from the complete image. Defect detection is then performed on the complete image based on the characteristic information of these independent bright and dark regions.

[0033] Through the embodiments of the present application, a complete image of the plane to be inspected is obtained, and the grayscale value of each pixel in the complete image is extracted. Independent bright areas and independent dark areas are extracted from the complete image based on the grayscale values, wherein the average grayscale value of the independent bright areas is greater than the average grayscale value of the independent dark areas. According to the feature information of the independent bright areas and the independent dark areas, defect detection is performed on the complete image. Based on the different imaging effects of different defects in the imaging of the image collector, defect detection is achieved through the feature expression of the bright and dark areas of the defects. Compared with deep learning detection, a large number of samples are not required for training, thereby improving detection efficiency. Compared with three-dimensional stereo modeling, a high-performance image processor is not required, and only an ordinary image processor is needed to complete the detection task, thereby reducing costs.

[0034] In one implementation of this embodiment, the characteristic information includes a relative positional relationship between the independent bright area and the independent dark area, and performing defect detection on the complete image based on the characteristic information of the independent bright area and the independent dark area includes:

[0035] A31, calculating the actual relative distance between the independent bright area and the independent dark area;

[0036] A32, merging the independent bright area and the independent dark area according to the actual relative distance to obtain a target defect;

[0037] A33: Determine the type of the target defect based on the relative positional relationship between the independent bright area and the independent dark area.

[0038] During the process of pressurization and ink curing, impurities in the ink will produce concave and convex phenomena. This embodiment is used to detect concave and convex defects in the plane to be detected, where concave and convex defects include sunken defects and convex defects. In terms of morphology, concave and convex are two different phenomena. Taking the front of the flat product as the reference plane, the phenomenon of being concave relative to the reference plane is called a sunken defect; the phenomenon of being convex relative to the reference plane is called a convex defect.

[0039] Reference Figure 3 , adjust the position and angle of the light source and image collector so that the image collector can capture the complete image of the plane to be inspected, and the imaging effects of the bright field background, concave defects and convex defects are different. The imaging effect is referenced Figure 4 , for example Figure 4 Imaging of a concave defect (i.e., a pit): The light emitted by the light source illuminates the upper half of the concave defect, and after diffuse reflection, the light is captured by the image collector, so the upper half is imaged as a bright feature, while the light emitted by the light source illuminates the lower half of the concave defect, and after diffuse reflection, the light cannot be captured by the image collector, so the lower half is imaged as a dark feature. Figure 4 The imaging of raised defects (i.e., bumps) is the opposite: light from the light source illuminates the upper half of the raised defect, undergoes diffuse reflection, and is not captured by the image collector, resulting in a dark image of the upper half. On the other hand, light from the light source illuminates the lower half of the raised defect, undergoes diffuse reflection, and is captured by the image collector, resulting in a bright image of the lower half. Regarding the bright field background area, which is a flat surface, the light from the light source reflects off this flat surface as specular reflection. Compared to diffuse reflection from a concave-convex defect, specular reflection allows less light to enter the image collector. Therefore, the pixel grayscale value (brightness) is between the pixel grayscale values ​​of a concave defect and a convex defect.

[0040] based on Figure 3 and Figure 4 According to the optical principle shown, both the concave defect and the convex defect are composed of two independent areas, one dark and one bright. Therefore, in this embodiment, the actual relative distance between the independent bright area and the independent dark area is calculated, and the independent bright area and the independent dark area are merged according to the actual relative distance to obtain the target defect. The target defect may be a concave defect or a convex defect. For the target defect, the type of the target defect is further determined based on the relative positional relationship between the independent bright area and the independent dark area in the target defect.

[0041] This embodiment can detect and distinguish concave-convex defects based on the optical position characteristics of the concave-convex defects.

[0042] Optionally, in this embodiment, calculating the actual relative distance between the independent bright area and the independent dark area includes:

[0043] a311, taking the center of the minimum circumscribed rectangle of the independent bright area as the first center coordinate of the independent bright area, and taking the center of the minimum circumscribed rectangle of the independent dark area as the second center coordinate of the independent dark area;

[0044] a312: Calculate the actual relative distance between the independent bright area and the independent dark area based on the first center coordinate and the second center coordinate.

[0045] refer to Figure 6 , take the center of the minimum circumscribed rectangle of independent bright area 1 and independent dark area 2 as the center coordinates (xBright, yBright) and (xDark, yDark), respectively, and calculate the actual relative distance D1 between the independent bright area and the independent dark area based on the center coordinates. Among them, (xBright, yBright) is the first center coordinate, and (xDark, yDark) is the second center coordinate.

[0046] Merging independent bright and dark areas based on the actual relative distance to obtain the target defect involves: obtaining a preset distance parameter D2, adjusting the value of D2 based on the actual situation so that D1 ≤ D2, then merging the bright and dark areas into a single defect, meaning that the defect consists of independent bright and dark areas. Merging independent bright and dark areas whose actual relative distance is less than or equal to the preset distance parameter to obtain the target defect. If two independent bright and dark defects are obtained during actual use, the value of D2 can be increased, but the upper limit of D2 needs to be adjusted based on the specific situation.

[0047] Optionally, in this embodiment, determining the type of the target defect based on the relative positional relationship between the independent bright area and the independent dark area includes:

[0048] a331, establishing a coordinate system with the scan line segment of the image collector as the abscissa, either end of the scan line segment as the origin, and the reverse trajectory of the movement trajectory of the plane to be inspected on the working line as the ordinate, wherein the plane to be inspected moves toward the scan line segment;

[0049] a332, calculating the ordinate of the independent bright area and the ordinate of the independent dark area in the coordinate system;

[0050] a333: Determine the type of the target defect according to the relative positional relationship between the ordinates of the independent bright area and the independent dark area.

[0051] This embodiment can be applied to scenarios where the surface to be inspected is moving on a production line. In such scenarios, a line scan camera can be used as the image collector. In scenarios where the surface to be inspected is stationary, an area scan camera can be used. A line scan camera captures images using a wafer structure with electronic detectors pre-arranged in a planetary pattern. Its characteristic is its ability to capture objects moving along a specific axis. This typically requires the object to maintain a straight, uniform velocity to avoid image stretching or distortion.

[0052] Reference Figure 5 A coordinate system is established, with the position of the image collector's scan line as the x-axis, the left endpoint of the scan line segment as the coordinate origin, and the y-axis opposite the product flow direction. When the product triggers the sensor, causing the image collector to receive a trigger signal, the light source turns on, and the image collector performs optical imaging. Therefore, the starting position of the imaging is always the scan line position. As the product flows through the scan line, a complete image of the product is obtained. Using the scan line position as the reference position, the y-coordinates of the independent bright and dark areas can be calculated: yBright and yDark.

[0053] Compared with the existing technology, which can only conduct single-machine inspection for special defects such as concave and convex defects and has a high investment cost, this embodiment realizes the equipment layout structure of the assembly line on the one hand, with higher production capacity, and on the other hand, it can be integrated with other defect (scratches, black and white spots, discoloration, edge collapse, etc.) detection stations to shorten the single-chip inspection time and achieve a single-chip inspection time of less than 1.6s.

[0054] In this embodiment, determining the type of the target defect based on the relative positional relationship between the ordinate of the independent bright area and the ordinate of the independent dark area includes: calculating the difference between the ordinate of the independent bright area and the ordinate of the independent dark area; determining whether the difference is less than 0; if the difference is less than 0, determining that the type of the target defect is a concave defect; if the difference is greater than 0, determining that the type of the target defect is a convex defect.

[0055] according to Figure 3 and Figure 4According to the optical principle and imaging effect, the vertical coordinate yBright of the independent bright area in the concave defect is smaller than the vertical coordinate yDark of the independent dark area, and the vertical coordinate yBright of the independent bright area in the convex defect is larger than the vertical coordinate yDark of the independent dark area. Therefore, the concave defects and convex defects can be distinguished according to the different positions of the bright and dark areas. The difference yBright-yDark, which is the vertical coordinate of the independent bright area minus the vertical coordinate of the independent dark area, is calculated. When yBright-yDark<0, the target defect type is classified as a concave defect; when yBright-yDark>0, the target defect type is classified as a convex defect. It should be noted that if the position of the image collector and the light source is swapped while the product flow direction remains unchanged, the position distribution of the bright and dark areas of the concave defects and convex defects will be opposite, and the judgment conditions must also change accordingly.

[0056] In another implementation of this embodiment, the characteristic information includes the grayscale value of each pixel in the independent bright area and the independent dark area, and performing defect detection on the complete image based on the characteristic information of the independent bright area and the independent dark area includes:

[0057] Calculating an actual relative distance between the independent bright area and the independent dark area;

[0058] Merging the independent bright area and the independent dark area according to the actual relative distance to obtain a target defect;

[0059] Calculating the grayscale variance of the target defect according to the grayscale value of each pixel in the independent bright area and the independent dark area;

[0060] Obtaining a preset threshold, and comparing the grayscale variance with the preset threshold;

[0061] If the grayscale variance is greater than the preset threshold, the type of the target defect is determined to be a concave defect or a convex defect; if the grayscale variance is less than the preset threshold, the type of the target defect is determined to be other defects except the concave defect and the convex defect.

[0062] This embodiment considers that the distinction between concave and convex defects may be affected by other factors, such as dust. The shape of dust may have concave and convex features. Therefore, the imaging effect of dust may be similar to that of concave and convex defects, which may cause misjudgment of concave and convex defects. In response to this situation, this embodiment takes into account that the thickness of dust points is relatively thin and the reflection of light is different from that of concave and convex defects. Therefore, the imaging of dust is lighter than that of concave and convex defects, that is, the grayscale value is lower. Figure 7 As shown in the figure, the grayscale variance feature can be used to distinguish between concave-convex defects and dust.

[0063] In one example, to improve the detection rate of concave and convex defects and meet product quality requirements, multiple (e.g., 100 or more) dust spot images were collected and the average grayscale variance of the dust spots was calculated (approximately 30). A preset threshold of 30 was then set. If the grayscale variance of the target defect was greater than 30, it was identified as a concave or convex spot; if the grayscale variance was less than 30, it was identified as a dust spot. Grayscale variance is the ratio of the sum of the squares of the differences between the pixel grayscale value and its average grayscale value to the total number of pixels. It is a statistic used in digital image processing to describe the uniformity of an image's grayscale distribution. The smaller the grayscale variance, the more concentrated the image's grayscale distribution and the more uniform the grayscale variations.

[0064] This embodiment uses grayscale variance features to distinguish between concave and convex points and dust points, thereby reducing misjudgment of concave and convex points and dust points.

[0065] In another implementation of this embodiment, extracting the independent bright area and the independent dark area from the complete image based on the grayscale value includes:

[0066] Obtain a preset first grayscale range and a second grayscale range, wherein the minimum value of the first grayscale range is greater than the maximum value of the second grayscale range; extract an independent area formed by pixels in the complete image whose grayscale values ​​are within the first grayscale range, and determine it as an independent bright area; extract an independent area formed by pixels in the complete image whose grayscale values ​​are within the second grayscale range, and determine an independent dark area; optionally, by adopting a threshold segmentation method, set the grayscale range so that the grayscale of the bright area or the grayscale of the dark area is extracted and processed within the range.

[0067] The complete image is segmented into multiple parts according to its grayscale by threshold segmentation, and the pixels are determined to belong to independent dark areas, independent bright areas or background areas by a preset first grayscale range and a second grayscale range.

[0068] This embodiment achieves different imaging effects for concave and convex points through the optical design of the image collector and light source. The classification of concave and convex points is then achieved based on the different distributions of light and dark areas in the concave and convex points. The results are shown in Table 1 below. Table 1 compares the number of misjudgments in human judgment before and after distinguishing concave and convex points. This misjudgment rate is the ratio of the number of misjudgments to the total number of good products.

[0069] The detection method in the related art cannot distinguish between concave defects and convex defects. Therefore, it is necessary to detect concave and convex defects as much as possible. The machine judgment standard is set to an area greater than 0.01 mm2. The result is as shown in the machine judgment result 1 in Table 1, and the total misjudgment rate is 15 / 19 = 78.9%. This embodiment distinguishes concave and convex defects. The standard for concave defects is set to an area greater than 0.03 mm2, and the standard for convex defects is set to an area greater than 0.01 mm2. The result is as shown in the machine judgment result 2 in Table 1. The total misjudgment rate is 9 / 19 = 47.4%, which is a 31.5% reduction in misjudgment.

[0070]

[0071] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0072] Example 2

[0073] This embodiment also provides a defect detection device for implementing the above-mentioned embodiments and preferred implementations. Details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0074] Figure 8 is a structural block diagram of a defect detection device according to an embodiment of the present application, such as Figure 8 As shown, the device includes:

[0075] An acquisition module 80 is used to acquire a complete image of the plane to be detected and extract the grayscale value of each pixel in the complete image;

[0076] an extraction module 81 for extracting independent bright areas and independent dark areas from the complete image based on the grayscale values, wherein an average grayscale value of the independent bright areas is greater than an average grayscale value of the independent dark areas;

[0077] The detection module 82 is configured to perform defect detection on the complete image based on feature information of the independent bright area and the independent dark area.

[0078] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0079] Example 3

[0080] An embodiment of the present application further provides a computer storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above method embodiments when running.

[0081] Optionally, in this embodiment, the computer storage medium may be configured to store a computer program for performing the following steps:

[0082] S1, obtaining a complete image of the plane to be detected, and extracting the grayscale value of each pixel in the complete image;

[0083] S2, extracting independent bright areas and independent dark areas from the complete image based on the grayscale values, wherein an average grayscale value of the independent bright areas is greater than an average grayscale value of the independent dark areas;

[0084] S3, performing defect detection on the complete image according to feature information of the independent bright area and the independent dark area.

[0085] Optionally, in this embodiment, the above-mentioned computer storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

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

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

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

[0089] S1, obtaining a complete image of the plane to be detected, and extracting the grayscale value of each pixel in the complete image;

[0090] S2, extracting independent bright areas and independent dark areas from the complete image based on the grayscale values, wherein an average grayscale value of the independent bright areas is greater than an average grayscale value of the independent dark areas;

[0091] S3, performing defect detection on the complete image according to feature information of the independent bright area and the independent dark area.

[0092] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0093] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0094] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0095] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0096] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0097] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0098] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a computer storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned computer storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0099] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A defect detection method, characterized in that: The method comprises: Acquire a complete image of the plane to be detected, and extract the grayscale value of each pixel in the complete image; extracting independent bright areas and independent dark areas from the complete image based on the grayscale values, wherein an average grayscale value of the independent bright areas is greater than an average grayscale value of the independent dark areas; Defect detection is performed on the complete image according to feature information of the independent bright area and the independent dark area.

2. The method according to claim 1, characterized in that The characteristic information includes a relative positional relationship between the independent bright area and the independent dark area. Performing defect detection on the complete image according to the characteristic information of the independent bright area and the independent dark area includes: Calculating an actual relative distance between the independent bright area and the independent dark area; Merging the independent bright area and the independent dark area according to the actual relative distance to obtain a target defect; The type of the target defect is determined based on the relative positional relationship between the independent bright area and the independent dark area.

3. The method according to claim 2, characterized in that Determining the type of the target defect based on the relative positional relationship between the independent bright area and the independent dark area includes: Establishing a coordinate system with a scanning line segment of the image collector as the horizontal coordinate, either end of the scanning line segment as the origin, and a reverse trajectory of the movement trajectory of the plane to be inspected on the working line as the vertical coordinate, wherein the plane to be inspected moves toward the scanning line segment; In the coordinate system, calculating the ordinate of the independent bright area and the ordinate of the independent dark area; The type of the target defect is determined according to the relative positional relationship between the ordinate of the independent bright area and the ordinate of the independent dark area.

4. The method according to claim 3, characterized in that Determining the type of the target defect according to the relative positional relationship between the ordinate of the independent bright area and the ordinate of the independent dark area includes: Calculating a difference between the ordinate of the independent bright area and the ordinate of the independent dark area; Determine whether the difference is less than 0; If the difference is less than 0, the type of the target defect is determined to be a concave defect; if the difference is greater than 0, the type of the target defect is determined to be a convex defect.

5. The method according to claim 2, characterized in that Calculating the actual relative distance between the independent bright area and the independent dark area includes: The center of the minimum circumscribed rectangle of the independent bright area is used as the first center coordinate of the independent bright area, and the center of the minimum circumscribed rectangle of the independent dark area is used as the second center coordinate of the independent dark area; Based on the first center coordinate and the second center coordinate, the actual relative distance between the independent bright area and the independent dark area is calculated using the following formula: Wherein, D1 is the actual relative distance, (xBright, yBright) is the first center coordinate, and (xDark, yDark) is the second center coordinate.

6. The method according to claim 2, characterized in that According to the actual relative distance, the independent bright area and the independent dark area are merged to obtain the target defect including: Get the preset distance parameters; Comparing the actual relative distance with the preset distance parameter; If the actual relative distance is less than or equal to the preset distance parameter, the independent bright area and the independent dark area are merged to obtain a target defect.

7. The method according to claim 2, characterized in that The characteristic information includes the grayscale value of each pixel in the independent bright area and the independent dark area. Performing defect detection on the complete image according to the characteristic information of the independent bright area and the independent dark area includes: Calculating an actual relative distance between the independent bright area and the independent dark area; Merging the independent bright area and the independent dark area according to the actual relative distance to obtain a target defect; Calculating the grayscale variance of the target defect according to the grayscale value of each pixel in the independent bright area and the independent dark area; Obtaining a preset threshold, and comparing the grayscale variance with the preset threshold; If the grayscale variance is greater than the preset threshold, the type of the target defect is determined to be a concave defect or a convex defect; if the grayscale variance is less than the preset threshold, the type of the target defect is determined to be other defects except the concave defect and the convex defect.

8. The method according to claim 1, characterized in that Extracting independent bright areas and independent dark areas from the complete image based on the grayscale values ​​includes: Obtaining a preset first grayscale range and a second grayscale range, wherein a minimum value of the first grayscale range is greater than a maximum value of the second grayscale range; Extracting an independent area formed by pixels in the complete image whose grayscale values ​​are within the first grayscale range and determining it as an independent bright area; extracting an independent area formed by pixels in the complete image whose grayscale values ​​are within the second grayscale range and determining it as an independent dark area.

9. A defect detection device, characterized in that: include: An acquisition module is used to acquire a complete image of the plane to be detected and extract the grayscale value of each pixel in the complete image; an extraction module, configured to extract independent bright areas and independent dark areas from the complete image based on the grayscale values, wherein an average grayscale value of the independent bright areas is greater than an average grayscale value of the independent dark areas; A detection module is used to perform defect detection on the complete image based on feature information of the independent bright area and the independent dark area.

10. A computer storage medium, characterized in that The computer storage medium includes a stored program, wherein the defect detection method according to any one of claims 1 to 8 is executed when the program is executed.

Citation Information

Patent Citations

  • System and method for detecting defects on reflection surface through visual system

    CN106959293A

  • Wafer detection system, wafer detection method, electronic equipment and storage medium

    CN115266758A

  • Garment steamer panel production quality detection method based on computer vision

    CN115994904A

  • Machine vision identification method and device for silicon wafer surface defects and medium

    CN116721079A

  • Visual examination device

    JP2004361085A

Cited By

  • Different-color detection method, different-color detection device and different-color detection system

    CN121414703A