A method for intelligent defect detection of household textiles

By analyzing the periodic regularity of the grayscale value change in the grayscale image of textiles, the significance value is corrected, and the problem of low accuracy of textile defect detection in the prior art is solved, thereby achieving higher accuracy of defect detection.

CN118644484BActive Publication Date: 2024-12-17XIAN ZHONGYANG ENERGY SAVING TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411111377.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-12-17
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

The accuracy of textile defect detection in the prior art is low, mainly due to insufficient contrast of local pixel points, resulting in low accuracy of significance values ​​of defective areas in textile images.

Method used

By obtaining the grayscale image of the textile, calculating the defect index of the pixel point, combining the regularity of the change period of the grayscale value in the row direction and column direction, correcting the significance value, and obtaining the corrected significance map, thereby improving the accuracy of defect detection. .

Benefits of technology

It improves the accuracy of textile defect detection, can more effectively identify defect areas, and reduces the rate of false detection and missed detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118644484B_ABST
    Figure CN118644484B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image data processing, and to an intelligent defect detection method for household textiles, comprising: obtaining a grayscale image of a textile; determining a defect index for any pixel point; correcting a significance value with the defect index as a weight to obtain a corrected significance value; obtaining a corrected significance map to determine whether the textile has a defect; the defect index is: determining the mean value e of the distance between adjacent extreme value points on a straight line in the row direction where the pixel point is located, calculating a reference value d, #imgabs0#, f is the mean value of the distance between adjacent extreme value points in a clustering area, wherein the extreme value points in the clustering area are gradually expanded according to the extreme value points adjacent to the pixel point, and the difference between the distances between adjacent extreme value points in the clustering area is small; taking the maximum value between the reference value and the reference value of the straight line in the column direction where the pixel point is located as the defect index of the pixel point. The present invention improves the accuracy of defect detection on textiles.
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 data processing. The present invention relates to an intelligent defect detection method for household textiles. Background Art

[0002] Defect detection of textiles can ensure the quality of textiles. Defect detection of textiles can also timely capture and correct problems in the production process, reduce scrap rate and reprocessing costs. The development and application of textile defect detection technology can promote the progress and innovation of production technology and bring higher production efficiency and quality level to the textile industry.

[0003] However, in the process of defect detection of textiles, there are still cases where manual detection is performed, which is not only inefficient but also has low accuracy. The image of the textile can be processed using a saliency algorithm in image processing technology to obtain a saliency map. If there are defects in the textile, the defective area in the saliency map may be more prominent. The saliency algorithm may be an LC (Local Contrast) algorithm, which is a conventional algorithm in the prior art. For example, the relevant prior art, such as the patent application document with application publication number CN116485698A, discloses an adaptive image fusion method and system based on saliency preservation, the method comprising: using the LC algorithm to obtain a saliency image of the image.

[0004] However, the LC algorithm only considers the contrast of local pixels, while the defect area of ​​the textile image may be large, and the accuracy of the pixel saliency value obtained by using the contrast of local pixels is low. Therefore, if the LC algorithm is used to directly process the textile image to obtain the saliency map, the accuracy of defect detection of textiles based on the saliency map is low. Summary of the invention

[0005] In order to solve the above-mentioned technical problem of low accuracy in defect detection of textiles, the present invention proposes an intelligent defect detection method for household textiles.

[0006] A method for intelligent defect detection of household textiles, comprising:

[0007] Obtaining a grayscale image of home textiles;

[0008] For a pixel point in the grayscale image, the saliency value of the pixel point obtained by the saliency algorithm is corrected with the defect index of the pixel point as the weight to obtain a corrected saliency value; according to the corrected saliency values ​​of each pixel point, a corrected saliency map is obtained; if , then the textile has defects, among which, is the area of ​​the defect region in the saliency map, is the area of ​​the saliency map, is the area ratio threshold; wherein the defect index of a pixel is:

[0009] The maximum value between the row direction reference value and the column direction reference value of the pixel point; the row direction reference value is the difference between the mean distance between the adjacent extreme value points on the row direction straight line where the pixel point is located and the mean distance between the adjacent extreme value points in the cluster area on the row direction straight line; the column direction reference value is the difference between the mean distance between the adjacent extreme value points on the column direction straight line where the pixel point is located and the mean distance between the adjacent extreme value points in the cluster area on the column direction straight line; the cluster area is formed by iteratively expanding to both sides with the extreme value points on both sides of the pixel point as the initial area, and determining the extreme value points on both sides of the area corresponding to the current iteration to be included in each iteration, until the difference between the distance between the extreme value point to be included and the adjacent extreme value point in the opposite direction of expansion and g is not less than , where g is the mean distance between adjacent extreme points in the region corresponding to the current iteration, and m is the preset threshold.

[0010] The larger the reference value, the worse the periodic regularity of the grayscale value change on the straight line. The present invention takes into account the periodic regularity of the grayscale value change of the pixel on the straight line in the row direction where the pixel is located, and also takes into account the periodic regularity of the grayscale value change of the pixel on the straight line in the column direction where the pixel is located, and determines the defect index of the pixel based on the worse periodic regularity of the two. Among them, the defect index reflects the possibility that the pixel is a defective pixel. Among them, the defective pixel is a pixel in the defective area in the image. The periodic regularity in multiple directions is taken into account, so that the obtained defect index can better characterize the possibility that the pixel is a defective pixel, and the corrected significance value is obtained according to the defect index, so that the obtained corrected significance value can better reflect whether the pixel is a defective pixel. If the pixel is a defective pixel, the corrected significance value of the pixel is larger, the pixel is more prominent in the corrected significance map, and the defective area in the corrected significance map is more prominent, thereby improving the accuracy of intelligent defect detection of textiles.

[0011] This scheme takes the extreme point adjacent to the pixel point as the starting point and gradually expands the extreme point to both sides, so that the mean distance between adjacent extreme points in the cluster area can better reflect the change characteristics of the gray value in the area where the pixel point is located, and thus the reference value can better reflect the periodic regularity of the gray value change on the straight line.

[0012] Optionally, the calculation formula of the modified significance value is:

[0013]

[0014] in, is the corrected significance value of the pixel in the i-th row and k-th column in the grayscale image, is the maximum and minimum normalized function of positive correlation, is the defect index of the pixel at the i-th row and the k-th column, is the significance value of the pixel at the i-th row and the k-th column obtained by the significance algorithm.

[0015] like The larger the value is, the more likely the pixel in the i-th row and k-th column is to be a defective pixel, and the more prominent the pixel in the i-th row and k-th column should be in the saliency map.

[0016] Optionally, the area of ​​the defect region is determined according to a threshold segmentation algorithm.

[0017] Since the defect region in the corrected saliency map is more obvious, the area of ​​the defect region can be obtained by a threshold segmentation algorithm.

[0018] Optionally, the threshold segmentation algorithm is Otsu's method.

[0019] Among them, the Otsu threshold segmentation algorithm obtains the area of ​​the defect region based on the principle of maximizing the inter-class variance.

[0020] Optionally, the process of obtaining the extreme value point corresponding to the row direction straight line includes:

[0021] A two-dimensional coordinate system is established, in which the vertical axis represents the pixel grayscale value and the horizontal axis represents the column number of the pixel point; the least squares method is used to fit a curve to the grayscale values ​​of the pixel points on the row direction straight line, and then the extreme points corresponding to the row direction straight line are obtained, wherein the extreme points corresponding to the row direction straight line are the horizontal coordinates of the points in the curve whose first-order derivative is zero and whose second-order derivative is not zero.

[0022] Optionally, the saliency algorithm includes a Local Contrast algorithm.

[0023] Optionally, the calculation formula of the modified significance value is:

[0024]

[0025] in, is the corrected significance value of the pixel in the i-th row and k-th column in the grayscale image, is the defect index of the pixel at the i-th row and the k-th column, is the saliency value of the pixel at the i-th row and k-th column obtained by the saliency algorithm, for function.

[0026] in, The role of is to normalize the data to positive correlation.

[0027] Optionally, the area ratio threshold is four percent

[0028] Beneficial effects of the present invention:

[0029] The present invention analyzes the texture features in the grayscale image of household textiles, calculates the defect index of each pixel point, wherein the defect index reflects the possibility that the corresponding pixel point is a pixel point in the defect area in the image, and uses the defect index to correct the significance value of each pixel point obtained based on the LC algorithm, and the corrected significance value can better reflect whether the pixel point is a defective pixel point. Then, a significance map is obtained based on the corrected significance value, and then defect detection is performed based on the corrected significance map, which can more accurately identify areas inconsistent with normal texture areas, help detect real defect areas, and improve the accuracy of defect detection.

[0030] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0032] Figure 1 is a flow chart schematically showing a method for intelligent defect detection of household textiles according to an embodiment of the present invention;

[0033] Figure 2 is a schematic diagram schematically showing a household textile product having a dirty yarn defect according to an embodiment of the present invention;

[0034] Figure 3 is a schematic diagram schematically illustrating a home textile having a spider web defect according to an embodiment of the present invention;

[0035] Figure 4 is a schematic diagram schematically showing a home textile having a weft-duplicate defect according to an embodiment of the present invention;

[0036] Figure 5 is a schematic diagram schematically showing a grayscale image of a home textile in a coordinate system according to an embodiment of the present invention;

[0037] Figure 6 is a first schematic diagram schematically illustrating a positional relationship between a reference extreme value point and two extreme value points adjacent to the reference extreme value point according to an embodiment of the present invention;

[0038] Figure 7 is a second schematic diagram schematically illustrating a positional relationship between a reference extreme value point and two extreme value points adjacent to the reference extreme value point according to an embodiment of the present invention;

[0039] Figure 8 Schematic diagram schematically showing the position corresponding to the target pixel point and the position of the extreme point according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In some of the processes described in the specification and claims of the present invention and the above-mentioned figures, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as S1, S2, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence, nor do they limit "first" and "second" to different types; in other words, the serial numbers themselves, such as "first", "second", etc., compiled for the components in this article are only used to distinguish the objects described, and do not have any order or technical meaning.

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0042] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0043] A schematic diagram of a household textile product with defects is shown below. Figure 2 , Figure 3 and Figure 4 shown.

[0044] The following is a brief introduction to the conventional methods for defect detection of household textiles.

[0045] At present, when performing defect detection on household textiles, there is still a situation where manual visual inspection is relied on. Although the method of manual defect detection on textiles is intuitive, it is inefficient and easily affected by personal experience and subjective judgment, which may lead to different test results when multiple people perform defect detection on the same textile separately, which further indicates that the accuracy of manual defect detection on textiles is low.

[0046] With the development of computer technology, automated detection methods are also widely used in textile defect detection. Among them, the saliency value of the pixel in the image can be obtained through the saliency detection algorithm, and then the saliency map of the home textile image can be obtained, and then the defects of the home textile can be detected based on the saliency image.

[0047] Among them, the LC (Local Contrast) algorithm is a conventional saliency detection algorithm in the prior art, so the above-mentioned saliency detection algorithm can be the LC algorithm. The saliency map obtained by processing the image using the LC algorithm is an infrared image. By using the LC algorithm, certain features in the original image can be made more prominent in the infrared image. Therefore, if the textile to be detected has defects, the defect area in the saliency map of the textile is more obvious, and the defects can be detected by manual visual inspection. The saliency map can also be analyzed and processed by the existing technology to obtain the defect detection result.

[0048] If the LC algorithm is directly used on the textile image, the local contrast between each pixel and its surrounding pixels will be obtained first, and then the significance value of each pixel will be evaluated by the local contrast. Figure 2 The difference between the grayscale values ​​of the pixels in the defective area is small, and it is difficult to identify the pixels in the defective area through the local contrast. In addition, the area of ​​the defective area may be large. Therefore, the accuracy of the significance value of the pixel points obtained by using the local contrast is low, which leads to a low accuracy rate in defect detection for household textiles.

[0049] Figure 1 FIG. 1 is a flow chart schematically showing a method for intelligent defect detection of household textiles according to an embodiment of the present invention. Figure 1 The specific instructions are as follows.

[0050] S1: Get a grayscale image of home textiles.

[0051] Irradiate the home textile with light, place the camera directly above the home textile, and make the camera take an image of the textile. Use a denoising algorithm to process the image, for example, the denoising algorithm can be a Gaussian filter algorithm. Grayscale the denoised image to obtain a grayscale image of the home textile.

[0052] In one embodiment, a camera may be arranged on a production line of home textiles to photograph the home textiles on the production line.

[0053] S2: Calculate the defect index of each pixel in the grayscale image.

[0054] The following first introduces the specific calculation process of the defect index of each pixel in the grayscale image, and then analyzes and explains it.

[0055] The following takes a pixel in a grayscale image as an example to calculate the defect index of the pixel.

[0056] The defect index of a pixel is: the maximum value of the row direction reference value and the column direction reference value of the pixel. The row direction reference value is the difference between the mean distance between the adjacent extreme value points on the row direction straight line where the pixel is located and the mean distance between the adjacent extreme value points in the cluster area on the row direction straight line, and the column direction reference value is the difference between the mean distance between the adjacent extreme value points on the column direction straight line where the pixel is located and the mean distance between the adjacent extreme value points in the cluster area on the column direction straight line; the cluster area is formed by iteratively expanding to both sides with the extreme value points on both sides of the pixel as the initial area, and each iteration determines the extreme value points on both sides of the area corresponding to the current iteration to be included, until the difference between the distance between the extreme value point to be included and the adjacent extreme value point in the opposite direction of expansion and g is not less than , where g is the mean distance between adjacent extreme points in the region corresponding to the current iteration, and m is the preset threshold. If the difference between the distance between the extreme point to be included and the adjacent extreme point in the opposite direction of expansion and g is not less than , then the extreme point to be included is included in the region corresponding to the next iteration of the current iteration.

[0057] The difference may be an absolute value of the difference.

[0058] The implementer may set a preset threshold value according to specific scenarios, and the preset threshold value may be 5% of the empirical value.

[0059] For ease of understanding, the following formula is used to describe the process of obtaining the defect index of the above pixel point.

[0060] For a pixel point in the grayscale image, the pixel grayscale value on the straight line where the pixel point is located is fitted, where the direction of the straight line is the row direction, and all extreme points and extreme values ​​are obtained. Among them, in the coordinate system, the extreme value is the grayscale value, and the extreme point is the horizontal coordinate corresponding to the extreme value. In the coordinate system, each grayscale value on the straight line corresponds to a horizontal coordinate. Calculate the mean e of the distance between all adjacent extreme points.

[0061] The process of obtaining the extreme value points in the target set corresponding to the straight line includes: initially, the extreme value points in the target set are two extreme value points adjacent to the pixel point. In each iteration cycle, if ,in, is the shortest distance between the ith extreme point and the extreme points in the target set, wherein the ith extreme point is an extreme point adjacent to all extreme points in the target set, wherein the number of extreme points adjacent to all extreme points in the target set is 2, i.e., i is 1, 2, g is the mean of the distances between adjacent extreme points in the target set, and m is the preset threshold, then the ith extreme point is added to the target set.

[0062] It should be noted that the extreme value points in the target set may change during the iteration process, and the extreme value points in the target set do not change after the iteration. After the iteration, the extreme value points in the target set are the same as the extreme value points in the cluster area corresponding to the straight line in the row direction of the pixel point.

[0063] Calculate the reference value d corresponding to the straight line, , where f is the mean distance between adjacent extreme points in the target set after the iteration.

[0064] At this point, the reference value corresponding to the row direction line where the pixel point is located is obtained, which is the row direction reference value of the pixel point. Similarly, the reference value corresponding to the column direction line where the pixel point is located can be obtained, which is the column direction reference value of the pixel point.

[0065] The maximum value of the reference value corresponding to the straight line in the row direction where the pixel point is located and the reference value corresponding to the straight line in the column direction where the pixel point is located is used as the defect index of the pixel point.

[0066] Traverse all remaining pixels in the image and obtain the defect index of each remaining pixel.

[0067] For better understanding, the process of obtaining pixel defect indicators is introduced below by giving an example.

[0068] Any pixel in the image is recorded as the target pixel. The defect index of the target pixel is calculated by taking the target pixel as an example. For the gray value of the pixel on the straight line where the target pixel is located, where the direction of the straight line is the row direction, a two-dimensional rectangular coordinate system is established, which is recorded as the extreme point coordinate system. The horizontal coordinate of the coordinate system is the serial number of the column where the pixel is located. For example, the serial numbers of the columns are 1, 2, and 3, etc., and the vertical coordinate of the coordinate system is the gray value of the pixel. In the coordinate system, the least squares method is used to fit the gray values ​​of the pixel on the straight line to obtain a curve, and then all extreme points and extreme values ​​are obtained, where the extreme point is the horizontal coordinate of the point in the curve where the first-order derivative is zero and the second-order derivative is not zero.

[0069] It should be noted that Figure 5 Schematic diagram schematically showing a grayscale image of a home textile in a coordinate system according to an embodiment of the present invention, Figure 5As shown, the direction of the x-axis is the row direction, the direction of the y-axis is the column direction, the units of the horizontal and vertical coordinates can be centimeters, 501 is the grayscale image, 502 is the direction of the first column, where the column number of the first column of pixels is 1, and 503 is the direction of the last column.

[0070] Calculate the distance between any two adjacent extreme points, traverse to obtain the distance between all two adjacent extreme points, and calculate the mean of all distances .

[0071] Determine two extreme value points adjacent to the target pixel point, record the two extreme value points as reference extreme value points, calculate the distance between the two reference extreme value points, and record it as the reference distance. For example, the reference distance is the absolute value of the difference between the two reference extreme value points.

[0072] Then, two extreme value points adjacent to the extreme value point corresponding to the reference distance are determined, that is, two extreme value points adjacent to the reference extreme value point.

[0073] Figure 6 is a first schematic diagram schematically illustrating the positional relationship between a reference extreme value point and two extreme value points adjacent to the reference extreme value point according to an embodiment of the present invention. Figure 6 As shown, in the above extreme value point coordinate system, 601 is the horizontal coordinate of the target pixel point, 602 and 603 are both reference extreme value points, and 604 and 605 are two extreme value points adjacent to the reference extreme value point.

[0074] For an extreme point adjacent to a reference extreme point, the closest distance between the extreme point and the reference extreme point is calculated, and the absolute value of the difference between the distance and the reference distance is calculated. If the ratio of the absolute value of the difference to the reference distance is less than a preset threshold, the extreme point is used as the reference extreme point. For example, for extreme point 604, the closest distance between the extreme point and the reference extreme point is the distance between 604 and 602. So far, it is possible to determine whether two extreme points adjacent to a reference extreme point are reference extreme points.

[0075] Then, the distance between any two adjacent reference extreme value points is calculated, and a traversal operation is performed to obtain the distance between all two adjacent reference extreme value points, and the average of all such distances is used as the updated reference distance.

[0076] Then, two extreme value points adjacent to the extreme value point corresponding to the updated reference distance are determined, that is, two extreme value points adjacent to all reference extreme value points are determined, and the above steps are repeated for iteration until all reference extreme value points corresponding to the target pixel point are determined and the iteration is stopped. At this point, all reference extreme value points corresponding to the target pixel point in the row direction are obtained.

[0077] It should be noted that the extreme point in the target set corresponding to the straight line in the row direction where the target pixel point is located is the reference extreme point corresponding to the straight line in the row direction where the target pixel point is located.

[0078] For example, Figure 7 is a second schematic diagram schematically illustrating the positional relationship between a reference extreme value point and two extreme value points adjacent to the reference extreme value point according to an embodiment of the present invention. Figure 7 As shown, in the above extreme point coordinate system, for example, 701, 702 and 703 are all reference extreme points, and 704 and 705 are two extreme points adjacent to the reference extreme point.

[0079] Calculate the distance between any two adjacent reference extreme points, perform a traversal operation to obtain the distance between all two adjacent reference extreme points, and calculate the mean of all such distances .

[0080] ,in, is the reference value corresponding to the row direction straight line of the target pixel. Similarly, the reference value corresponding to the column direction straight line of the target pixel can be obtained. The maximum value of these two reference values ​​is taken as the defect index of the target pixel.

[0081] The following explains.

[0082] The reference value represents the non-periodic regularity of the change of pixel gray value on the straight line.

[0083] The larger the defect index of the target pixel is, the worse the periodic regularity of the distribution of the pixel gray value on the straight line corresponding to the maximum value of the two reference values ​​of the target pixel is, and the greater the possibility that the target pixel is a defective pixel is.

[0084] In another embodiment, if the target pixel is a pixel corresponding to an extreme value point, the extreme value point corresponding to the target pixel is recorded as a reference extreme value point, and two extreme value points adjacent to the extreme value point corresponding to the target pixel are determined and recorded as reference extreme value points. The subsequent steps are the same as the above method steps and will not be repeated.

[0085] In one embodiment, if the target pixel is a pixel corresponding to an extreme value point, the extreme value point corresponding to the target pixel is recorded as a reference extreme value point, and the extreme value point closest to the extreme value point corresponding to the target pixel is determined and recorded as the reference extreme value point. The subsequent steps are the same as the above method steps and will not be repeated.

[0086] For example, Figure 8 Schematic diagram schematically showing the position of the target pixel point corresponding to the position of the extreme point according to an embodiment of the present invention, such as Figure 8As shown, 801, 802, 803, 804 and 805 are extreme value points, and 806 is the horizontal coordinate of the target pixel point in the extreme value point coordinate system. According to the above method, first determine the reference extreme value points: 803 and 804, and the distance between 803 and 804 is the reference distance; secondly, determine the two extreme value points adjacent to the reference extreme value point: 802 and 805, calculate the distance between 802 and 803, recorded as distance R1, calculate the distance between 805 and 804, recorded as distance R2, if the absolute value of the difference between distance R1 and the reference distance and the ratio of the reference distance are less than the preset threshold, then 802 is recorded as the reference extreme value point, if the difference between distance R2 and the reference distance and the ratio of the reference distance are greater than or equal to the preset threshold, then 805 is not the reference extreme value in this iteration cycle. point; secondly, calculate the average of the distance between 802 and 803 and the distance between 803 and 804, and record it as the updated reference distance; secondly, determine the two extreme points adjacent to the reference extreme point: 801 and 805, calculate the distance between 801 and 802, record it as distance R3, calculate the distance between 804 and 805 R2, if the difference between distance R3 and the reference distance and the ratio of the reference distance are greater than or equal to the threshold, then 801 is not a reference extreme point in this iteration cycle, if the difference between distance R2 and the reference distance and the ratio of the reference distance are greater than or equal to the threshold, then 805 is not a reference extreme point in this iteration cycle. So far, the iteration stops, and all reference extreme points are obtained, and the reference extreme points are 802, 803, and 804.

[0087] It should be noted that the distance described in this article may be the Euclidean distance.

[0088] In one embodiment, in order to facilitate understanding, an expression of the reference value corresponding to the straight line in the row direction where the target pixel point is located is given:

[0089]

[0090]

[0091]

[0092] Among them, N is the total number of reference extreme value points corresponding to the target pixel point in the row direction, is a function for calculating the Euclidean distance between two extreme points, is the zth reference extreme point, is the z+1th reference extreme point, and are two adjacent reference extreme points, is the absolute value symbol. m is the total number of all extreme value points corresponding to the target pixel in the row direction. is the i-th extreme point among all extreme points, It is the i+1th extreme point among all extreme points.

[0093] It reflects the distribution of the reference extreme value points corresponding to the straight line in the row direction where the target pixel point is located. It reflects the distribution of all extreme points corresponding to the straight line in the row direction where the target pixel is located.

[0094] The larger it is, the greater the difference between the distribution of the reference extreme value point and the distribution of all extreme value points corresponding to the straight line in the row direction of the target pixel point is, which means that the periodic regularity of the change of the grayscale value of the pixel point on the straight line in the row direction of the target pixel point is worse.

[0095] A detailed explanation is given below.

[0096] The following is a brief introduction to the defects of household textiles.

[0097] There are two main types of textile defects: one is the defects corresponding to certain areas with denser textures in the textile image. These defects are mainly caused by improper shrinkage or contamination during the textile process. These defects include dirty yarn and cobwebs (such as Figure 2 and 3 The other type is the defects corresponding to some areas with sparser texture in the textile image. This defect is mainly caused by missing threads, abnormal pressure or broken threads during the weaving process. Such defects include weft doubling (such as Figure 4 as shown).

[0098] Because the LC algorithm only uses the contrast of local pixels in the image to calculate the significance value of each pixel, this method may lead to false detection and missed detection in the subsequent defect detection. Specifically, due to problems in acquisition or factors such as the texture itself, the local contrast of the non-defective area may be high, which may lead to false detection in the subsequent defect detection; in the defect area (such as Figure 2 The difference between the grayscale values ​​of the pixels in the defective area is small, and the area of ​​the defective area may be large, so the local contrast of the pixels in the defective area may be small, which may lead to missed detection in subsequent defect detection. Therefore, the present invention calculates the defect index of each pixel based on the global information in the grayscale image, and adjusts the significance value using the defect index, based on which the accuracy of defect detection of textiles can be improved.

[0099] It can be understood that on a straight line in a certain direction, where the direction can be the row direction or the column direction, the change in the grayscale value of the pixel point in the grayscale image of a normal household textile has a certain periodic regularity. However, if there is a defect in the household textile, the area corresponding to the defect in the image will break the above periodic regularity, that is, the change in the grayscale value of the pixel point in the defective area does not have the above periodic regularity. Therefore, the present invention uses the periodic regularity of the change in the grayscale value of the pixel point on the straight line in a specific direction to calculate the defect index of the pixel point on the straight line, where the specific direction can be the row direction and the column direction of the image, and the defect index can be used to determine whether the textile has a defect.

[0100] The above-mentioned periodic regularity can be represented by the regularity of the distribution of the extreme value points of the pixel grayscale values ​​on the straight line. Because if the pixel grayscale values ​​on the straight line change periodically, the distribution of the extreme value points is regular, that is, the difference between the distances of adjacent extreme value points is small.

[0101] For example, Figure 4 As shown in the figure, the change of the pixel gray value on the straight line in the row direction where the pixel points in the weft defect area are located has a certain periodic regularity, and the change of the pixel gray value on the straight line in the column direction where the pixel points in the weft defect area are located has a lower periodic regularity. Therefore, the defect index of the pixel point can be calculated by the periodic regularity corresponding to the column direction, wherein the defect index can better reflect the possibility that the corresponding pixel point is a defective pixel point.

[0102] Another example, Figure 2 As shown, the difference between the grayscale values ​​of the pixels on the straight line in the column direction where the pixels in the dirty yarn defect area are located is small, and the periodic regularity of the change of the grayscale values ​​of the pixels on the straight line in the row direction where the pixels in the dirty yarn defect area are located can be calculated. This periodic regularity can better reflect whether the corresponding pixel is a defective pixel.

[0103] Therefore, for any pixel, when calculating the defect index of the pixel, the periodic regularity of the grayscale value of the pixel on the straight line in the row direction where the pixel is located is considered, and the periodic regularity of the grayscale value of the pixel on the straight line in the column direction where the pixel is located is also considered. Among them, the defect index of the pixel can be calculated based on the worse periodic regularity of the two.

[0104] It should be noted that, for a certain pixel point in the defect area of ​​the grayscale image, the pixel grayscale value on the row direction straight line of the pixel point may change regularly and periodically, but the pixel grayscale value on the column direction straight line of the pixel point may change irregularly and non-periodically.

[0105] S3: Based on the defect index, the significance value of the pixel point obtained by the significance algorithm is corrected to obtain a corrected significance value; and according to the corrected significance value of each pixel point, a corrected significance map is obtained. The description is as follows:

[0106] The following still takes the target pixel as an example to calculate the corrected significance value of the target pixel.

[0107] First, the saliency value of the target pixel is obtained by a saliency algorithm, wherein the saliency algorithm may be an LC algorithm. The LC algorithm is a prior art, and the process of obtaining the saliency value of the target pixel by the saliency algorithm is not described in detail.

[0108] The defect index of the target pixel is used as a weight to correct the significance value of the pixel obtained by the significance algorithm to obtain a corrected significance value.

[0109] In one embodiment, the calculation formula of the modified significance value is:

[0110]

[0111] in, is the corrected significance value of the pixel in the i-th row and k-th column in the grayscale image, is the maximum and minimum normalized function of positive correlation, is the defect index of the pixel at the i-th row and the k-th column, is the significance value of the pixel at the i-th row and the k-th column obtained by the significance algorithm.

[0112] Explanation of the positively correlated maximum and minimum normalized function: Calculate the product of the defect index of any pixel and the significance value of the pixel obtained by the significance algorithm, record it as the first product corresponding to the pixel, and perform a traversal operation to obtain the first product corresponding to each pixel in the grayscale image. The maximum value in the maximum and minimum normalized function is the maximum value of all first products, and the minimum value in the maximum and minimum normalized function is the minimum value of all first products. The maximum and minimum normalized function is a prior art and will not be described in detail.

[0113] At this point, the corrected saliency value of the target pixel is obtained, and the corrected saliency value of each pixel in the grayscale image can be obtained by performing a traversal operation.

[0114] Based on the LC algorithm and the corrected saliency value of each pixel, a corrected saliency map of the grayscale image can be obtained.

[0115] In the above description, any grayscale image is taken as an example to obtain the corrected saliency map of the grayscale image. The method for obtaining the corrected saliency map of other grayscale images is the same as the method for obtaining the corrected saliency map of the grayscale image.

[0116] The following explains.

[0117] The matrix of corrected significance values for:

[0118]

[0119] in, is the corrected saliency map of the pixel at the nth row and mth column in the grayscale image, is the saliency value of the pixel at the nth row and mth column obtained using the traditional LC algorithm, is the defect index of the pixel at the nth row and the mth column.

[0120] The larger the defect index of a pixel is, the more likely it is that the pixel is a defective pixel, and the larger the corrected saliency map of the pixel should be, so that the pixel is more prominent, thereby improving the accuracy of detecting defects in textiles.

[0121] S4: Determine whether the textile has defects based on the corrected saliency map.

[0122] After obtaining the corrected saliency map, a threshold segmentation algorithm can be used to identify defective areas in the corrected saliency map, wherein the threshold segmentation algorithm can be the Otsu method. The Otsu method is a prior art and will not be described in detail. If the ratio of the total area of ​​the identified defective area to the total area of ​​the corrected saliency map is greater than a preset area ratio threshold, it is considered that the household textile has defects. The implementer can set the area ratio threshold according to the specific scenario. The area ratio threshold can be an empirical value of 4%.

[0123] The area of ​​a region in an image can be represented by the total number of all pixels in the region.

[0124] In another embodiment, the ratio of the total area of ​​the identified defective region to the total area of ​​the corrected saliency map is calculated and recorded as the first ratio. If the first ratio is greater than a preset area ratio threshold, it is considered that the home textile has serious defects; if the first ratio is less than or equal to the preset area ratio threshold and greater than the first ratio threshold, it is considered that the home textile has slight defects; if the first ratio is less than or equal to the preset first ratio threshold, it is considered that the home textile has no defects. The implementer can set the first ratio threshold according to the specific scenario. The first ratio threshold can be 1%.

[0125] Some other embodiments of the present invention are described below.

[0126] In one embodiment, the peak point detection is performed on the pixel grayscale values ​​on the straight line in the row direction where the pixel point is located to obtain the peak point. The function of the peak point is the same as the function of the extreme value of the extreme point mentioned above, and the pixel point corresponding to the peak point has the same function as the extreme point mentioned above. Therefore, the pixel point of the peak point can replace the extreme point mentioned above to form a new embodiment. For example, calculating the distance between adjacent extreme points can be replaced by calculating the distance between the pixel points of adjacent peak points.

[0127] In another embodiment, if the textile has defects, the defective region of the modified saliency map is more prominent, and the defective region can be manually identified.

[0128] In one embodiment, the modified saliency map may be filtered, wherein the filtering algorithm is a Gaussian filtering algorithm.

[0129] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0130] As used herein, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or." Additionally, the articles "a" and "an" as used in this application and the appended claims are generally understood to mean "one or more" unless specified otherwise or clear from context to be directed to a singular form.

[0131] Where the terms "includes," "having," "having," "having," or variations thereof are used in the detailed description or claims, such terms are intended to be inclusive in a manner similar to the term "comprising."

[0132] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A method for intelligent defect detection of household textiles, characterized in that: include: Obtaining a grayscale image of home textiles; For a pixel point of the grayscale image, the significance value of the pixel point obtained by the significance algorithm is corrected by taking the defect index of the pixel point as a weight to obtain a corrected significance value; According to the corrected saliency value of each pixel, the corrected saliency map is obtained; if , then the textile has defects, among which, is the area of ​​the defect region in the saliency map, is the area of ​​the saliency map, is the area ratio threshold; wherein the defect index of a pixel is: The maximum value between the row direction reference value and the column direction reference value of the pixel point; the row direction reference value is the difference between the mean distance between the adjacent extreme value points on the row direction straight line where the pixel point is located and the mean distance between the adjacent extreme value points in the cluster area on the row direction straight line; the column direction reference value is the difference between the mean distance between the adjacent extreme value points on the column direction straight line where the pixel point is located and the mean distance between the adjacent extreme value points in the cluster area on the column direction straight line; the cluster area is formed by iteratively expanding to both sides with the extreme value points on both sides of the pixel point as the initial area, and each iteration includes the extreme value points on both sides until the difference between the distance between the extreme value point to be included and the adjacent extreme value point in the opposite direction of expansion and g is not less than , where g is the mean distance between adjacent extreme points in the area corresponding to the current iteration, and m is the preset threshold; the pixel grayscale values ​​on the straight line where each pixel point is located are fitted to obtain the extreme point.

2. The intelligent defect detection method for household textiles according to claim 1, characterized in that: The calculation formula of the corrected significance value is: ; in, is the corrected significance value of the pixel in the i-th row and k-th column in the grayscale image, is the maximum and minimum normalized function of positive correlation, is the defect index of the pixel at the i-th row and the k-th column, is the significance value of the pixel at the i-th row and the k-th column obtained by the significance algorithm.

3. The intelligent defect detection method for household textiles according to claim 1, characterized in that: The area of ​​the defect region is determined according to a threshold segmentation algorithm.

4. The intelligent defect detection method for household textiles according to claim 3, characterized in that: The threshold segmentation algorithm includes Otsu's method.

5. The intelligent defect detection method for household textiles according to claim 1, characterized in that: The process of obtaining the extreme value points corresponding to the row direction straight line includes: A two-dimensional coordinate system is established, in which the vertical axis represents the pixel grayscale value and the horizontal axis represents the column number of the pixel point; the least squares method is used to fit a curve to the grayscale values ​​of the pixel points on the row direction straight line, and then the extreme points corresponding to the row direction straight line are obtained, wherein the extreme points corresponding to the row direction straight line are the horizontal coordinates of the points in the curve whose first-order derivative is zero and whose second-order derivative is not zero.

6. A method for intelligent defect detection of household textiles according to claim 1 or 2, characterized in that: The saliency algorithm includes a Local Contrast algorithm.

7. The intelligent defect detection method for household textiles according to claim 1, characterized in that: The calculation formula of the corrected significance value is: ; in, is the corrected significance value of the pixel in the i-th row and k-th column in the grayscale image, is the defect index of the pixel at the i-th row and the k-th column, is the saliency value of the pixel at the i-th row and k-th column obtained by the saliency algorithm, for function.

8. The intelligent defect detection method for household textiles according to claim 1, characterized in that: The area ratio threshold is four percent.

Citation Information

Patent Citations

  • Adaptive image fusion method and system based on saliency preserving

    CN116485698A

  • Textile flaw detection method based on lattice patterns and lattice pattern area characteristics

    CN107248152A

  • Model data index deduction method based on time axis

    CN112559512A

  • Textile warp and weft defect detection method

    CN115311303A

  • Method for rapidly detecting surface quality of composite board

    CN117011292A