Texture defect detection method and adaptive adjustment defect detection method

By performing region segmentation and pixel threshold decomposition on the target image, the problem of over-miss detection caused by the lack of geometric features and wide pixel variation range in silicon wafer texture area detection is solved, and efficient and accurate defect detection is achieved.

CN119444820APending Publication Date: 2025-02-14AMIES TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310954492.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When detecting silicon wafer texture areas, the area cannot be effectively divided due to the lack of periodic or array distribution geometric features, and due to the wide range of pixel variations, adjusting the pixel threshold can easily lead to the risk of over-miss detection.

Method used

By acquiring the target image, dividing its pixel area into normal areas and texture areas, dividing the texture area into candidate areas according to different pixel thresholds, and filtering out defect areas according to the characteristics of the connection domain, and finally taking the defect areas of the normal areas and texture areas union to obtain complete defect detection results.

Benefits of technology

It effectively reduces the risk of over-checking of defect detection in texture area, shortens the detection time, and improves the accuracy and efficiency of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444820A_ABST
    Figure CN119444820A_ABST
Patent Text Reader

Abstract

The invention provides a texture defect detection method and an adaptive adjustment defect detection method, and the method comprises the steps: obtaining a target image, and dividing a pixel region of the target image into a normal region and a texture region according to a pre-obtained texture region image; acquiring a defect area in the normal area; segmenting the texture region into different candidate regions according to different pixel thresholds, and screening according to connected domain features of the different candidate regions to obtain defect regions in the texture region; and obtaining a union set of the defect area of the normal area and the defect area of the texture area to obtain all defect detection results of the target image. Through the texture defect detection method and the self-adaptive adjustment defect detection method, the problem of high risk of over-detection and missing detection during detection of texture area defects is solved. In addition, the texture area image is prepared in advance before the detection stage, so that the detection time can be greatly shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a texture defect detection method and an adaptive adjustment defect detection method. Background Art

[0002] In the prior art, defects of products with certain periodic textures are detected by using a detection method based on machine vision. For the images to be detected with periodic or array distribution, the regions can be divided according to the geometric features in each period, and different detection parameters can be assigned to different regions. However, when detecting the texture region of silicon wafers, since the texture region of silicon wafers is not distributed in a periodic or array manner, there are no specific geometric features in the texture region, and therefore it is impossible to divide the region according to the geometric features in each period. In addition, in the prior art, when detecting the texture region of silicon wafers, there is a method of changing the pixel threshold parameter to determine the actual defects in the outliers. However, since the pixel variation range of the texture region image is relatively wide, changing the threshold will result in a higher risk of over-detection and missed detection in the texture region. Summary of the invention

[0003] The object of the present invention is to provide a texture defect detection method and an adaptively adjusted texture defect detection method to solve one or more problems existing in the prior art.

[0004] In order to solve the above technical problems, the present invention provides a texture defect detection method, comprising:

[0005] Acquire a target image, and divide a pixel area of ​​the target image into a normal area and a texture area according to a texture area image acquired in advance;

[0006] Acquire a defective area in the normal area;

[0007] Segmenting the texture region into different candidate regions according to different pixel thresholds, and then screening to obtain defect regions in the texture region according to connected domain features of different candidate regions; and

[0008] The defect area in the normal area and the defect area in the texture area are taken as a union to obtain all defect detection results of the target image.

[0009] Optionally, in the texture defect detection method, the texture region image is acquired in the prescription stage; and the method for acquiring the texture region image includes:

[0010] Acquire defect areas of multiple reference images;

[0011] Taking a union of defect areas of all the reference images to form a defect union image containing all defects;

[0012] Calculating the density of the defect spatial distribution on the defect union map, and selecting a threshold value according to texture features to segment a candidate texture region image;

[0013] The texture region image is selected according to the size of the connected domain size feature of the candidate texture region image.

[0014] Optionally, in the texture defect detection method, the method of acquiring the texture area image further includes:

[0015] Calculating the standard deviation of each pixel position of the reference image to obtain a standard deviation map;

[0016] Selecting a standard deviation threshold according to texture features, performing threshold segmentation on the standard deviation map to obtain an area with a larger standard deviation on the standard deviation map, and,

[0017] The region with a larger standard deviation is intersected with the texture region image to update the texture region image.

[0018] Optionally, in the texture defect detection method, the method of obtaining defect areas of multiple reference images includes:

[0019] A detection algorithm based on grayscale comparison between a test image and an adjacent image is used for each of the reference images, and preset parameters are used to calculate the defect area of ​​each of the reference images.

[0020] Optionally, in the texture defect detection method, a method for calculating the density of the defect spatial distribution on the defect union map includes: traversal or mean filtering.

[0021] Optionally, in the texture defect detection method, a method for obtaining the defect area of ​​the normal area includes:

[0022] The normal area is subjected to a detection algorithm based on grayscale comparison between the test image and the template image or grayscale comparison between the test image and the adjacent image to obtain a defective area of ​​the normal area.

[0023] Optionally, in the texture defect detection method, the method of obtaining different pixel thresholds includes:

[0024] Calculate the eigenvalue of each pixel position of the reference image to obtain an eigenvalue map;

[0025] Obtaining a grayscale histogram of the texture area; and,

[0026] Comparing the eigenvalue map with the grayscale histogram to determine a maximum grayscale threshold and a minimum grayscale threshold;

[0027] The characteristic values ​​include: mean and / or median.

[0028] Optionally, in the texture defect detection method, segmenting the texture region image into different candidate regions according to different pixel thresholds includes performing at least one of the following segmentations:

[0029] Segmenting the texture region image according to the minimum grayscale threshold to obtain a grayscale minimum region in the texture region;

[0030] Segmenting the texture region image according to the maximum grayscale threshold to obtain the maximum grayscale region in the texture region;

[0031] The area between the maximum grayscale and the minimum grayscale is segmented according to the minimum grayscale threshold and the maximum grayscale threshold, and then each adhered area in the area between the maximum grayscale and the minimum grayscale is disconnected by an opening operation.

[0032] Optionally, in the texture defect detection method, after segmenting the area between the maximum grayscale and the minimum grayscale according to the minimum grayscale threshold and the maximum grayscale threshold, the area whose size does not meet the conditions is removed according to the feature size of the connected domain.

[0033] Optionally, in the texture defect detection method, after disconnecting each connected area in the area between the grayscale maximum and the grayscale minimum by an opening operation, a sharpening filter is also performed on each disconnected area.

[0034] Optionally, in the texture defect detection method, the sharpening filtering method includes:

[0035] Using a sharpening operator to perform the sharpening filter; or,

[0036] The image is obtained by subtracting the smoothing filter with kernels of various sizes from the original image.

[0037] Optionally, in the texture defect detection method, the method of obtaining the defective area in the texture area by screening according to the connected domain features of different candidate areas includes:

[0038] For the grayscale minimum region, a black small defect region is obtained by screening according to the size characteristics of the connected domain of the grayscale minimum region;

[0039] For the grayscale maximum region, a white large defect region is obtained by screening according to the size characteristics of the connected domain of the grayscale maximum region;

[0040] For the region between the maximum grayscale and the minimum grayscale, the gray large defect region is obtained by screening according to the texture roughness of the connected domain of each disconnected region.

[0041] Optionally, in the texture defect detection method, at least one of the detection of the small black defects, the large white defects and the gray defects is selectively performed according to the detection requirements. If the types of detected defects include two or more, after obtaining the areas with different defects, the union is taken as the defect area of ​​the texture area.

[0042] The present invention provides an adaptive adjustment defect detection method, comprising:

[0043] S1, input a target image and preliminarily determine the defect type of the target image;

[0044] S2, based on the result of the preliminary judgment, determine whether to input the texture area image, if so, output the defect area according to the texture defect detection method as described in any of the previous items; if not, determine whether the defect type obtained in step S1 is caused by a texture problem, if it is caused by a texture problem, obtain the texture area image, and output the defect area according to the texture defect detection method as described in any of the previous items.

[0045] In summary, the texture defect detection method provided by the present invention includes: acquiring a target image, dividing the pixel area of ​​the target image into a normal area and a texture area according to a pre-acquired texture area image; acquiring a defect area in the normal area; dividing the texture area into different candidate areas according to different pixel thresholds, and then obtaining the defect area in the texture area by screening according to the connected domain features of different candidate areas; and taking the union of the defect area of ​​the normal area and the defect area of ​​the texture area to obtain all defect detection results of the target image. The texture defect detection method solves the problem that when the pixel variation range of the texture area image is wide, the use of the existing technology will lead to a high risk of over-detection of texture area defects. In addition, when executing the texture defect detection method, since the texture area image has been prepared in advance before the detection stage, the detection time can be greatly shortened.

[0046] In addition, the adaptive defect detection method provided by the present invention includes: S1, inputting a target image, and preliminarily judging the defect type of the target image; S2, judging whether to input a texture area image according to the result of the preliminary judgment, and if so, outputting the defect area according to the texture defect detection method provided by the present invention; if not, judging whether the defect type obtained by step S1 is caused by a texture problem, and if so, obtaining a texture area image, and outputting the defect area according to the texture defect detection method provided by the present invention. By performing partition detection after conventional detection in the detection stage or by controlling whether to perform partition detection, the problem of false detection caused by material and process textures can be eliminated. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flowchart of a texture defect detection method provided by an embodiment of the present invention;

[0048] Figure 2 6 are defect binary images of reference images used as examples in the embodiments of the present invention;

[0049] Figure 3 It is a defect union diagram exemplified in an embodiment of the present invention;

[0050] Figure 4 is a defect density map exemplified in an embodiment of the present invention;

[0051] Figure 5 is a candidate texture region image exemplified in an embodiment of the present invention;

[0052] Figure 6 A specific flow chart of the detection phase of the texture defect detection method provided by an embodiment of the present invention;

[0053] Figure 7 illustrative diagram of three defects in an embodiment of the present invention;

[0054] Figure 8 A flow chart of a method for adaptively adjusting defect detection provided by an embodiment of the present invention;

[0055] In the attached figure:

[0056] 100-small black defect; 200-large white defect; 300-grey defect. DETAILED DESCRIPTION

[0057] In order to make the purpose, advantages and features of the present invention clearer, the present invention is described in detail in conjunction with the accompanying drawings and specific embodiments. It should be noted that the drawings are all in a very simplified form and are not drawn to scale, and are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In addition, the structure shown in the drawings is often a part of the actual structure. In particular, the emphasis of each drawing is different, and sometimes different proportions are used. It should also be understood that, unless otherwise specified or indicated, the terms "first", "second", "third", etc. in the specification are only used to distinguish the various components, elements, steps, etc. in the specification, and are not used to represent the logical relationship or sequential relationship between the various components, elements, steps, etc.

[0058] like Figure 1 As shown, an embodiment of the present invention provides a texture defect detection method, comprising the following steps:

[0059] S11, acquiring a target image, and dividing a pixel area of ​​the target image into a normal area and a texture area according to a pre-acquired texture area image;

[0060] S12, obtaining a defective area in the normal area;

[0061] S13, dividing the texture area into different candidate areas according to different pixel thresholds, and then screening to obtain defect areas of the texture area according to connected domain features of different candidate areas; and

[0062] S14, taking a union of the defect area in the normal area and the defect area in the texture area to obtain all defect detection results of the target image.

[0063] The texture defect detection method provided by the embodiment of the present invention divides the texture into different candidate areas by pixel thresholds, and then determines the defective area in the texture area according to the connected domain features of the different candidate areas, thereby avoiding the problem of high risk of over-detection and missed detection of texture area defects caused by the existing detection method due to the wide pixel variation range of the texture area image. In addition, when executing the texture defect detection method, since the texture area image is prepared in advance before the detection stage, the detection time can be greatly shortened.

[0064] Optionally, the texture defect detection method provided by the embodiment of the present invention further includes the step: S10, acquiring a texture area image.

[0065] The above steps S10 to S14 are described in further detail below.

[0066] (1) Prescription stage

[0067] Step S10 is performed in the prescription stage, that is, before the texture defect detection begins, the texture area image is first obtained. Since, when the texture defect detection method provided by this embodiment is executed, the texture area image is ready in the prescription stage before the detection stage, the detection time can be greatly shortened.

[0068] Optionally, in step S10, the method for obtaining the texture area image includes the following steps: S101, obtaining defect areas of multiple reference images; S102, taking the union of the defect areas of all the reference images to form a defect union map containing all defects; S103, calculating the density of the spatial distribution of defects on the defect union map, and selecting a threshold value according to texture features to segment candidate texture area images; S104, screening out the texture area image according to the size of the connected domain size feature of the candidate texture area image.

[0069] In step S101, the defect area of ​​each reference image can be calculated using preset parameters by using a detection algorithm based on grayscale comparison between the test image and the adjacent image for each reference image. In this embodiment, there is no limit on the number of reference images. For example, the number of reference images can be 6, 8, etc. The number of reference images can be adjusted according to the actual distribution of the actual defects. In step S103, the density of the spatial distribution of defects on the defect union image can be calculated by traversal or mean filtering.

[0070] In this embodiment, the texture region image may be a binary image, and accordingly, each reference image and each region image are binary images. Figure 2 As shown in the figure, the defect binary images of 6 reference images are obtained. Since there are no obvious defects in the image, the defects are mainly concentrated in the texture area, and there are some edge alignment problems. It can be seen from the image that in the results of image defect detection with texture problems, the defects appear in large numbers in the texture area, but the location of the defects in the texture area of ​​each image is random and does not cover the entire area.

[0071] Then, the texture area is calculated based on the obtained defects. The defects of the above 6 reference images are combined to obtain the following Figure 3 The defect union map shown (defective areas are 1, other areas are 0).

[0072] After obtaining the defect union map, the defect union map is subjected to mean filtering using a 21×21 structural element, and the following is obtained: Figure 4 The defect density map (density value range 0 to 1) is shown, and then a value (such as 0.55) between 0 and 1 is selected as the threshold of defect density to perform region segmentation according to the texture feature, and the following is segmented: Figure 5 The candidate texture region image is shown.

[0073] from Figure 5 It can be seen that the texture area obtained by density division basically has no fragmented area, and the residues of over-detection caused by edge misalignment are filtered out, but the edge of the image is not smooth, and there are even adhesions and holes. In view of this, preferably, in step S10, the method for obtaining the texture area image also includes the following steps: S104, calculating the standard deviation of each pixel position for the reference image (any reference image can be selected) to obtain a standard deviation map; S105, selecting a standard deviation threshold according to texture characteristics, performing threshold segmentation on the standard deviation map to obtain an area with a larger standard deviation on the standard deviation map, and, S106, taking the intersection of the area with a larger standard deviation and the texture area image to update the texture area image. The updated texture area image has smooth edges and no longer has adhesions and holes.

[0074] (2) Detection phase

[0075] See also Figure 6 In the detection stage, firstly, step S11 is executed to obtain the target image, and the pixel area of ​​the target image is divided into a normal area and a texture area according to the texture area image. Then, step S12 is executed to obtain the defect area in the normal area, and step S13 is executed to obtain the defect area in the texture area. Among them, for the normal area, defects are easier to obtain. Therefore, in step S12, a detection algorithm based on grayscale comparison between the test image and the template image or grayscale comparison with the adjacent image can be used to obtain the defect area of ​​the normal area; for the texture area, defects are not easy to distinguish from textures. Therefore, in step S13, the texture area is divided into different candidate areas according to different pixel thresholds, and then defects are screened in different candidate areas.

[0076] In step S13, different pixel thresholds can be obtained by establishing a grayscale model, specifically including: calculating the eigenvalue of each pixel position of the reference image to obtain an eigenvalue map; obtaining the grayscale histogram of the texture area; and comparing the eigenvalue map with the grayscale histogram to determine the maximum grayscale threshold and the minimum grayscale threshold; wherein the eigenvalues ​​include: mean and / or median, etc.

[0077] On this basis, see Figure 7 , the possible defect types in the texture area are divided into three types:

[0078] (a) A small black defect 100, whose grayscale is extremely small and whose size is larger than the area with extremely small grayscale in the texture;

[0079] (b) A large white defect 200, whose grayscale is extremely large and whose size is much larger than the area with extremely large grayscale in the texture;

[0080] (c) Gray defect 300, whose grayscale and texture areas overlap each other, but usually appear in a whole piece, and the overall grayscale changes are smoother.

[0081] Therefore, further, in step S13, segmenting the texture region image into different candidate regions according to different pixel thresholds includes performing at least one of the following segmentations:

[0082] Segmenting the texture region image according to the minimum grayscale threshold to obtain a grayscale minimum region in the texture region;

[0083] Segmenting the texture region image according to the maximum grayscale threshold to obtain the maximum grayscale region in the texture region;

[0084] The area between the maximum grayscale and the minimum grayscale is segmented according to the minimum grayscale threshold and the maximum grayscale threshold, and then each adhered area in the area between the maximum grayscale and the minimum grayscale is disconnected by an opening operation.

[0085] Preferably, after the area between the grayscale maximum and the grayscale minimum is segmented according to the minimum grayscale threshold and the maximum grayscale threshold, the area whose size does not meet the condition is removed according to the connected domain feature size. In addition, preferably, after each area in the area between the grayscale maximum and the grayscale minimum is disconnected by an opening operation, a sharpening filter is performed on each disconnected area. Optionally, the sharpening filter method includes: performing the sharpening filter using a sharpening operator; or, using the original image to subtract the image after smoothing filtering of kernels of multiple sizes; wherein the sharpening operator includes Sobel operator, Roberts operator, etc., and the smoothing filter includes mean filtering, median filtering or Gaussian filtering, etc.

[0086] Furthermore, the method for obtaining the defective region in the texture region by screening the connected domain features of different candidate regions includes:

[0087] For the grayscale minimum region, a black small defect region is obtained by screening according to the size characteristics of the connected domain of the grayscale minimum region;

[0088] For the area between the maximum grayscale and the minimum grayscale, a gray large defect area is obtained by screening according to the texture roughness characteristics of the connected domain of each disconnected area;

[0089] For the region between the maximum grayscale and the minimum grayscale, a gray large defect region is obtained by screening according to the characteristics of the texture roughness of the connected domain of each disconnected region.

[0090] Optionally, the texture roughness characteristics include: standard deviation, smoothness (R), uniformity or entropy of four-connected domains or eight-connected domains. In addition, optionally, in each step of this implementation, the connected domain size characteristics may include the size of the characteristics such as the area, length or width of the four-connected domains or eight-connected domains.

[0091] In actual application, at least one of the detection of the small black defects, the large white defects and the gray defects can be selectively performed according to the detection requirements. If the types of detected defects include two or more, after obtaining the areas of different defects, the union is taken as the defect area of ​​the texture area.

[0092] Finally, step S14 is performed to take the union of the defect area in the normal area and the defect area in the texture area to obtain all defect detection results of the target image. In this way, the detection of texture defects of the target image is completed.

[0093] Also, see Figure 8 The embodiment of the present invention also provides an adaptive adjustment defect detection method, comprising the following steps:

[0094] S1, input a target image and preliminarily determine the defect type of the target image;

[0095] S2. According to the result of the preliminary judgment, determine whether to input a texture area image. If so, output the defect area according to the texture defect detection method provided in this embodiment; if not, determine whether the defect type obtained in step S1 is caused by a texture problem. If it is caused by a texture problem, obtain a texture area image and output the defect area according to the texture defect detection method provided in this embodiment.

[0096] In addition to reducing the risk of over-detection and missed detection compared to the prior art when performing texture defect detection, the adaptive adjustment defect detection method provided in this embodiment can also eliminate the problem of false detection caused by material and process texture by performing partition detection after conventional detection in the detection stage or by controlling the selection of whether to perform partition detection.

[0097] In summary, the texture defect detection method and the adaptive adjustment defect detection method provided by the embodiment of the present invention include: obtaining a target image, dividing the pixel area of ​​the target image into a normal area and a texture area according to a pre-acquired texture area image; obtaining a defect area in the normal area; dividing the texture area into different candidate areas according to different pixel thresholds, and then screening the defect area in the texture area according to the connected domain features of different candidate areas; and taking the defect area of ​​the normal area and the defect area of ​​the texture area as a union to obtain all defect detection results of the target image. The texture defect detection method and the adaptive adjustment defect detection method solve the problem that when the pixel variation range of the texture area image is wide, the use of the existing technology will lead to a high risk of over-detection of texture area defects. In addition, since the texture area image is prepared in advance before the detection stage, the detection time can be greatly shortened. In addition, the adaptive adjustment defect detection method and the adaptive adjustment defect detection method can also eliminate the problem of false detection caused by material and process texture by performing partition detection after conventional detection in the detection stage or by controlling whether to perform partition detection.

[0098] It should be noted that, in the above-mentioned partial description, although only the texture area image is used as the texture area binary image, and correspondingly, each reference image and each area image is a binary image to further describe the technical solution of the present application in detail, it should be understood that the texture defect detection method of the present application is not limited to the form of a binary image when implemented, and any form of image that can distinguish between defective areas, texture areas, and normal areas is within the protection scope of the present application.

[0099] In addition, it should be recognized that although the present invention has been disclosed as a preferred embodiment, the above embodiment is not intended to limit the present invention. For any technician familiar with the art, without departing from the scope of the technical solution of the present invention, the technical content disclosed above can be used to make many possible changes and modifications to the technical solution of the present invention, or modified into equivalent embodiments of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still belongs to the scope of protection of the technical solution of the present invention.

Claims

1. A texture defect detection method, characterized in that: include: Acquire a target image, and divide a pixel area of ​​the target image into a normal area and a texture area according to a texture area image acquired in advance; Acquire a defective area in the normal area; Segmenting the texture region into different candidate regions according to different pixel thresholds, and then screening to obtain defect regions in the texture region according to connected domain features of different candidate regions; as well as, The defect area in the normal area and the defect area in the texture area are taken as a union to obtain all defect detection results of the target image.

2. The texture defect detection method according to claim 1, characterized in that: The texture area image is obtained in the prescription stage; the method for obtaining the texture area image includes: Acquire defect areas of multiple reference images; Taking a union of defect areas of all the reference images to form a defect union image containing all defects; Calculating the density of the defect spatial distribution on the defect union map, and selecting a threshold value according to texture features to segment a candidate texture region image; The texture region image is selected according to the size of the connected domain size feature of the candidate texture region image.

3. The texture defect detection method according to claim 2, characterized in that: The method for obtaining the texture area image also includes: Calculating the standard deviation of each pixel position of the reference image to obtain a standard deviation map; Selecting a standard deviation threshold according to texture features, performing threshold segmentation on the standard deviation map to obtain an area with a larger standard deviation on the standard deviation map, and, The region with a larger standard deviation is intersected with the texture region image to update the texture region image.

4. The texture defect detection method according to claim 2, characterized in that: The method for obtaining defect areas of multiple reference images includes: A detection algorithm based on grayscale comparison between a test image and an adjacent image is used for each of the reference images, and a defect area of ​​each of the reference images is calculated using preset parameters.

5. The texture defect detection method according to claim 2, characterized in that: The method of calculating the density of the defect spatial distribution on the defect union graph includes: traversal or mean filtering.

6. The texture defect detection method according to claim 1, characterized in that: The method for obtaining the defective area of ​​the normal area includes: The normal area is subjected to a detection algorithm based on grayscale comparison between the test image and the template image or grayscale comparison between the test image and the adjacent image to obtain a defective area of ​​the normal area.

7. The texture defect detection method according to claim 1, characterized in that: The method of obtaining different pixel thresholds includes: Calculate the eigenvalue of each pixel position of the reference image to obtain an eigenvalue map; Obtaining a grayscale histogram of the texture area; and, Comparing the eigenvalue map with the grayscale histogram to determine a maximum grayscale threshold and a minimum grayscale threshold; The characteristic values ​​include: mean and / or median.

8. The texture defect detection method according to claim 7, characterized in that: The segmenting of the texture region image into different candidate regions according to different pixel thresholds comprises performing at least one of the following segmentations: Segmenting the texture region image according to the minimum grayscale threshold to obtain a grayscale minimum region in the texture region; Segmenting the texture region image according to the maximum grayscale threshold to obtain the maximum grayscale region in the texture region; The area between the maximum grayscale and the minimum grayscale is segmented according to the minimum grayscale threshold and the maximum grayscale threshold, and then each adhered area in the area between the maximum grayscale and the minimum grayscale is disconnected by an opening operation.

9. The texture defect detection method according to claim 8, characterized in that: After the area between the grayscale maximum and the grayscale minimum is segmented according to the minimum grayscale threshold and the maximum grayscale threshold, the area whose size does not meet the condition is removed according to the connected domain feature size.

10. The texture defect detection method according to claim 8, characterized in that: After disconnecting each connected region in the region between the grayscale maximum and the grayscale minimum through an opening operation, a sharpening filter is performed on each disconnected region.

11. The texture defect detection method according to claim 10, characterized in that: The sharpening filtering method comprises: Using a sharpening operator to perform the sharpening filter; or, The image is obtained by subtracting the smoothing filter with kernels of various sizes from the original image.

12. The texture defect detection method according to any one of claims 8 to 11, characterized in that: The method for obtaining the defective area in the texture area by screening according to the connected domain features of different candidate areas comprises: For the grayscale minimum region, a black small defect region is obtained by screening according to the size characteristics of the connected domain of the grayscale minimum region; For the grayscale maximum region, a white large defect region is obtained by screening according to the size characteristics of the connected domain of the grayscale maximum region; For the region between the maximum grayscale and the minimum grayscale, the gray large defect region is obtained by screening according to the texture roughness of the connected domain of each disconnected region.

13. The texture defect detection method according to claim 12, characterized in that: According to the detection requirements, at least one of the detection of the small black defects, the large white defects and the gray defects is selectively performed. If the types of detected defects include two or more, after obtaining the areas of different defects, the union is taken as the defect area of ​​the texture area.

14. An adaptive defect detection method, characterized in that: include: S1, input a target image and preliminarily determine the defect type of the target image; S2, based on the result of the preliminary judgment, determine whether to input a texture area image, if so, output the defect area according to the texture defect detection method as claimed in any one of claims 1 to 13; if not, determine whether the defect type obtained by step S1 is caused by a texture problem, if it is caused by a texture problem, generate a texture area image, and output the defect area according to the texture defect detection method as claimed in any one of claims 1 to 13.