A method for detecting defects in a jacquard knit
By combining regional diffusion and an improved LBP algorithm with a region growth segmentation algorithm, the problem of poor anti-interference ability in the defect detection of jacquard knitted fabrics is solved, and more accurate defect detection is achieved.
Patent Information
- Application Number
- CN202211672632.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-12-26
AI Technical Summary
Existing methods for detecting fabric defects have poor resistance to interference on jacquard knitted fabrics, resulting in low accuracy of detection results.
By acquiring fabric images and dividing them into texture regions and defect regions, calculating the gradient threshold of each region for region-specific diffusion, constructing an improved LBP algorithm and local entropy feature map, using a region growing segmentation algorithm for defect segmentation, and finally performing binarization output.
It improves the anti-interference ability and accuracy of defect detection in jacquard knitted fabrics, and avoids the limitations and complexity of neural network multi-layer convolution algorithms.
Smart Images

Figure CN115937173B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of image detection, and particularly relates to a jacquard knitted fabric defect detection method. BACKGROUND
[0002] The fabric defect detection link is a key link in the fabric production process and is an important means of fabric quality control. There are many existing defect detection algorithms. The defect detection algorithm based on the transform domain is based on the transformed coefficient matrix in the transform domain for texture analysis. For simple defect fabrics, it has good detection effect, but the loop arrangement of the jacquard knitted fabric is more loose than that of the ordinary fabric, and the loop spacing and loop height are larger, which will cause a certain interval between adjacent loops, and the pattern and loop edge features are obvious on the fabric image. Another learning-based method is to automatically learn and mine the essence features of the fabric through multi-layer neural network layer-by-layer convolution abstraction, but the network architecture is complex, and a large number of samples and training are required, and the detection result accuracy is low due to the limitation of the algorithm. Therefore, the existing detection method has poor anti-interference ability and low detection result accuracy when detecting the defects of the jacquard knitted fabric with multiple complex problems. SUMMARY
[0003] The purpose of the embodiment of the application is to provide a jacquard knitted fabric defect detection method, which can solve the technical problems of poor anti-interference ability and low detection result accuracy of the existing fabric defect detection method in the defect detection process of the jacquard knitted fabric with complex structure.
[0004] In order to solve the above technical problems, the application is implemented as follows:
[0005] The embodiment of the application provides a jacquard knitted fabric defect detection method, which comprises the following steps:
[0006] S101: Obtain a fabric image, and divide the fabric image into a texture region and a defect region according to a preset gradient value;
[0007] S102: Extract a gray-scale gradient matrix of the fabric image, calculate a first gradient threshold value of the texture region by a probability subset method, and calculate a second gradient threshold value of the defect region by a correlation criterion method;
[0008] S103: According to the first gradient threshold value, the second gradient threshold value and the preset gradient value, construct a diffusion coefficient function, perform regional diffusion on the texture region and the defect region, and obtain a diffusion fabric image;
[0009] S104: Divide the diffusion fabric image into a plurality of image blocks, calculate the mean value of the characteristic values of each image block, and select the maximum mean value and the minimum mean value;
[0010] S105: Set an automatic threshold according to the second gradient threshold, the maximum mean value and the minimum mean value, construct an improved LBP algorithm, extract the LBP gray feature value of the diffused fabric image, and obtain an LBP gray feature map;
[0011] S106: Calculate the local entropy value of each pixel point in the diffused fabric image to obtain a local entropy feature map, and calculate the correlation value of each pixel point in the diffused fabric image to obtain a correlation feature map;
[0012] S107: The LBP gray feature value, the local entropy value and the correlation value are calculated by using the non-neighborhood reduction mean value method to obtain the corresponding target LBP gray feature value, the target local entropy value and the target correlation value;
[0013] S108: The target LBP gray feature value, the target local entropy value and the target correlation value are normalized to a preset interval to obtain a normalized target LBP gray feature value, a normalized target local entropy value and a normalized target correlation value;
[0014] S109: According to the normalized target LBP gray feature value, the peak value region feature value and the non-peak value region feature value in the LBP gray feature map, the weight corresponding to the LBP gray feature map is calculated, and the weight corresponding to the local entropy feature map and the weight corresponding to the correlation feature map are calculated in the same way;
[0015] S110: According to the weight corresponding to each feature map, the fusion coefficient corresponding to each feature map is calculated, and each feature map and the corresponding fusion coefficient are multiplied to obtain a reconstructed feature map;
[0016] S111: The image block where the defect region in the reconstructed feature map is located is positioned, the region growing segmentation algorithm is used to extract the defect edge and the overall morphology to obtain a defect segmentation region, and the defect segmentation region is binarized and output.
[0017] In the embodiment of the present application, the obtained fabric image is divided into a texture region and a defect region, and the corresponding diffusion gradient values of each region are calculated for regional diffusion, thereby increasing the difference between the texture region and the defect region and highlighting the defect region. The improved LBP algorithm is constructed, the fabric image is divided into multiple image blocks to extract the gray feature, which can effectively avoid the strong interference caused by the extraction of the gray feature of the pixel point. After the extracted multi-feature image is further highlighted by using the non-neighborhood reduction mean value method, the normalization processing is performed, and then the weighted fusion is performed to obtain a reconstructed feature map. Through continuous highlighting of the difference between the defect region and the texture region, the defect segmentation region obtained by using the region growing segmentation algorithm is binarized and output to obtain a defect region image with obvious and highlighted defects. While avoiding the limitations and complexity of the neural network multi-layer convolution algorithm, the anti-interference ability of the defect detection process is improved, and the detection result is more accurate. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating a method for detecting defects in jacquard knitted fabrics provided in an embodiment of the present invention.
[0019] Figure 2 This is a comparison image of a jacquard knitted fabric and a diffused fabric provided in an embodiment of the present invention.
[0020] Figure 3 This is a schematic diagram illustrating the process of locating and segmenting defects in an image of a jacquard knitted fabric, as provided in an embodiment of the present invention.
[0021] The realization of the objective, functional characteristics and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0023] The method for detecting defects in jacquard knitted fabrics provided by the present invention will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0024] Reference Figure 1 The diagram shows a flowchart of a method for detecting defects in jacquard knitted fabrics provided by an embodiment of the present invention.
[0025] This invention provides a method for detecting defects in jacquard knitted fabrics, comprising:
[0026] S101: Acquire a fabric image and divide the fabric image into texture areas and defect areas according to a preset gradient value.
[0027] The gradient is an element that constitutes the edge contour of the fabric image. The main information of the fabric image is provided by the edge contour of the image. Dividing the fabric image into different regions according to the preset gradient value can better process the image and more effectively reflect the differences between texture areas and defect areas in the fabric image.
[0028] It can be understood that the person skilled in the art can select the size of the preset gradient value according to the actual situation, and it can be understood that the selected preset gradient value is not the larger the better, because the gradient value set of the texture region accounts for a large proportion in the gradient matrix of the fabric image and has similar distribution, the gradient value set of the defect region accounts for a small proportion and has a large gradient value, which can be regarded as a gradient value of mutation in the gradient matrix of the fabric image, and the purpose of selecting the preset gradient value is to select an appropriate range to separate the gradient values with similar distribution and the gradient values of mutation.
[0029] S102: Extract the gray level gradient matrix of the fabric image, calculate the first gradient threshold of the texture region by the probability subset method, and calculate the second gradient threshold of the defect region by the correlation criterion method.
[0030] The probability subset method is to find a non-0 gradient value set with a larger occurrence probability, and then calculate the mean value to determine the gradient threshold, so that the first gradient threshold is located at the center of the gradient value set of the texture region, and the difference between the defect region and the texture region is highlighted. The correlation criterion method is to calculate the correlation quantity to describe the gradient value difference between the defect region and the texture region.
[0031] In a possible implementation, S102 specifically includes:
[0032] S1021: For a preset defect image gradient value set G L ={0, 1, 2, …, L-1}, the gray level gradient matrix is an M*N fabric image, the occurrence probability P i of each gradient value in the gradient value set that is not 0 is calculated.
[0033]
[0034] Wherein, n i represents the number of gradient values i;
[0035] S1022: Select the maximum occurrence probability p of the gradient value from the gradient value occurrence probability:
[0036] p = max{p1, p2, …, p L-1} Formula 2;
[0037] S1023: Introduce a control factor, and determine the probability range △p by combining the maximum occurrence probability of the gradient value:
[0038]
[0039] S1024: Take the mean value of the gradient values in the probability range to calculate the first gradient threshold K1:
[0040]
[0041] S1025: According to the gradient value occurrence probability, the correlation amount P{s} between the specified gradient level and other gradient levels is calculated:
[0042]
[0043] Wherein, S∈G L Indicates the specified gradient level.
[0044] S1026: The total correlation amount TC between the specified gradient level and other gradient levels is calculated (s) :
[0045]
[0046] It can be understood that the size of the total correlation amount between the specified gradient level and other gradient levels reflects the correlation degree between the specified gradient level and other gradient levels, and the total gradient level is divided by the correlation degree to obtain regions with different gradient level correlation degrees.
[0047] S1027: In the case that the total correlation amount is the maximum value, the second gradient threshold K2 of the defect region and the texture region is calculated:
[0048]
[0049] It can be understood that when the total correlation amount takes the maximum value, a region with the maximum correlation degree in the fabric image is divided from other regions as a whole region.
[0050] Referring to Figure 2 , a comparison chart of the jacquard knitted fabric image and the diffusion fabric image provided by the embodiment of the present application is shown.
[0051] From Figure 2 , it can be seen that the diffusion fabric image obtained by the region diffusion weakens the texture features of the texture region and enhances the highlighting effect of the defect region.
[0052] S103: According to the first gradient threshold, the second gradient threshold and the preset gradient value, a diffusion coefficient function is constructed to perform region diffusion on the texture region and the defect region, and a diffusion fabric image is obtained.
[0053] The diffusion coefficient function is a diffusion coefficient function constructed based on the first gradient threshold, the second gradient threshold and the preset gradient value, which can maximize the purpose of the calculated threshold, that is, to maximize the smoothing diffusion of the texture region, and to weaken the diffusion of the region with larger gradient value in order to protect the feature information of the defect region.
[0054] Further, the diffusion fabric image obtained by the sub-region diffusion can clearly distinguish the features of the texture region and the defect region, the obtained diffusion fabric image has smaller gray scale fluctuation amplitude, the texture region is more concentrated, the defect information is retained to the greatest extent, the difference between the texture region and the defect is increased, and subsequent feature extraction is facilitated.
[0055] In a possible implementation, S103 specifically includes:
[0056] S1031: taking the second gradient threshold value as the optimal decomposition threshold value of the texture region and the defect region;
[0057] The optimal decomposition threshold value is the optimal gradient threshold value for decomposing the fabric image, the texture region and the defect region obtained by decomposition according to the optimal decomposition threshold value have obvious demarcation points, and the feature information of the defect region is protected.
[0058] S1032: constructing a diffusion coefficient function of the texture region and the defect region according to the preset threshold value and the optimal decomposition threshold value:
[0059]
[0060] S104: dividing the diffusion fabric image into a plurality of image blocks, calculating the mean value of the feature values of each image block, and selecting the maximum mean value and the minimum mean value.
[0061] S105: setting an automatic threshold value according to the second gradient threshold value, the maximum mean value and the minimum mean value, constructing an improved LBP algorithm, extracting LBP gray scale feature values of the diffusion fabric image, and obtaining an LBP gray scale feature map.
[0062] It should be noted that the jacquard knitted fabric is nested by loops, and small intervals exist between patterns and yarns. If a traditional pixel point mode is used, the small intervals will strongly interfere with the extraction result of the LBP. The improved LBP algorithm can effectively describe the regularity of the fabric texture distribution according to the local neighborhood of the fabric image. Therefore, the image is divided into a plurality of image blocks of m x m size, and the mean value of each block is used to compare with the neighborhood block.
[0063] In a possible implementation, S105 specifically includes:
[0064] S1051: calculating an automatic threshold value T:
[0065] T = min{K2-min(μ n ), max (μ n )-K2} Formula 9
[0066] μ n represents a vector composed of the mean values of the total image blocks n.
[0067] S1052: calculating the improved LBP algorithm according to the automatic threshold
[0068]
[0069]
[0070] wherein p represents the number of neighborhood, s represents the variable parameter, R represents the parameter radius, μ p , μ c respectively represent the mean value of the center block and the mean value of the neighborhood block, is the uniform pattern of LBP, and riu2 represents the rotation invariant uniform pattern.
[0071] It can be understood that the improved LBP algorithm is limited by the set automatic threshold, which can effectively combine the information of the center region and the local neighborhood of each image block, and reduce the LBP feature value of the texture region.
[0072] S106: calculating the local entropy value of each pixel point in the diffusion fabric image to obtain a local entropy feature map, and calculating the correlation value of each pixel point in the diffusion fabric image to obtain a correlation feature map.
[0073] wherein the local entropy is the degree of chaos of the system, and the larger the local entropy value is, the more chaotic the fabric picture is. The image entropy is a statistical form of the fabric image feature, and reflects the average information amount in the fabric image, which can reflect the distribution complexity of each pixel point in the fabric image. The larger the local entropy value is, the clearer the image is.
[0074] In one possible implementation, S106 specifically includes:
[0075] S1061: for a gray-scale image matrix of a gray-scale feature map with a size of MxN, the calculation method of the local entropy value S is:
[0076]
[0077] wherein p ij represents the frequency of the gray-scale feature value at the pixel point (i, j).
[0078] S1062: calculating the correlation value C:
[0079]
[0080] wherein f(i, j) represents the gray-scale feature value at the pixel point (i, j), μ x , μ y respectively represent the mean value in the row direction and the column direction of the fabric image, σ x , σ yThese represent the standard deviations in the row and column directions of the fabric image, respectively.
[0081] Among them, the texture gray levels of fabric images are similar in rows or columns, but the correlation values of the rows or columns where defects are located will change abruptly. Selecting local correlation to calculate the correlation feature value can measure this difference.
[0082] S107: Calculate the corresponding target LBP gray-level feature value, target local entropy value, and target correlation value by using the neighborhood subtraction row mean method, respectively, based on the LBP gray-level feature value, local entropy value, and correlation value.
[0083] It should be noted that, based on the distribution characteristics of the texture region and various feature maps in the fabric image, it was found that the feature values within the same row or column do not differ significantly, but the feature values of defects differ considerably from those of the texture. Therefore, during normalization, the mean of each feature value in its row or column is subtracted first to effectively highlight the feature value intensity of the defect region. This also prevents the image from being divided into excessively small blocks, which could weaken the features of the defect region during subsequent processing.
[0084] In one possible implementation, S107 specifically includes:
[0085] S1071: Calculate the row mean h of each image block;
[0086] S1072: The calculation methods for the target LBP grayscale feature value, the target local entropy value, and the target correlation value are as follows:
[0087]
[0088] Among them, S ij The LBP grayscale feature value, the local entropy feature value, and the correlation feature value represent the characteristics, μ. iT To remove S ij The row mean of a neighborhood of size h, F ij These correspond to the target LBP grayscale feature value, the target local entropy value, and the target correlation value.
[0089] S108: Normalize the target LBP grayscale feature value, target local entropy value, and target correlation value to a preset interval to obtain normalized target LBP grayscale feature value, normalized target local entropy value, and normalized target correlation value.
[0090] Optionally, the preset interval is [0, 255].
[0091] It can be understood that the target LBP gray feature value, the target local entropy value and the target correlation value are normalized to a preset interval, so that the preprocessed data is limited in a certain range, thereby eliminating the adverse effects caused by singular sample data. After data normalization processing, the speed of gradient descent to find the optimal solution can be accelerated, and the processing accuracy of the fabric image can be improved to reduce the influence of size, feature, distribution difference on fabric image analysis.
[0092] S109: According to the normalized target LBP gray feature value, the peak value region feature value and the non-peak value region feature value in the LBP gray feature map, the weight corresponding to the LBP gray feature map is calculated, and the weight corresponding to the local entropy feature map and the weight corresponding to the correlation feature map are calculated in the same way.
[0093] Among them, according to the feature values, the peak value region and the non-peak value region of the LBP gray feature map, the local entropy feature map and the correlation feature map which can represent the characteristics of the respective feature maps, the weights of the LBP gray feature map, the local entropy feature map and the correlation feature map are calculated respectively, to prepare for subsequent data processing.
[0094] In a possible implementation, S109 specifically includes:
[0095] S1091: The ratio of the sum of the peak value region feature value and the non-peak value region feature value of the LBP gray feature map is taken as the weight of the corresponding respective feature map, and the weight corresponding to the local entropy feature map and the weight corresponding to the correlation feature map are calculated in the same way. k :
[0096]
[0097] Among them, N p is the number of peak value region feature values, respectively represent the feature value of point (i, j) in the kth feature map and the dth feature value of the peak value region.
[0098] S110: According to the weight corresponding to each feature map, the fusion coefficient corresponding to each feature map is calculated, each feature map and the corresponding fusion coefficient are multiplied to obtain a reconstructed feature map.
[0099] It can be understood that the LBP gray feature map, the local entropy feature map and the correlation feature map after the neighborhood reduction mean method and the normalization processing are obvious and prominent, and then the reconstructed feature map obtained by calculating and fusing according to the respective weights can maximize the exclusion of irrelevant factors interference and display the defects more clearly.
[0100] In a possible implementation, S110 specifically includes:
[0101] S1101: Calculate a fusion coefficient W corresponding to each feature map according to the weight of each feature map k :
[0102]
[0103] S1102: Multiply each feature map and the corresponding fusion coefficient to obtain a reconstructed feature map:
[0104] F = W k F k Formula 17.
[0105] Referring to Figure 3 , a schematic diagram of a defect positioning and segmentation process of a jacquard knitted fabric image provided by an embodiment of the present application is shown.
[0106] S111: Locate the image block where the defect region in the reconstructed feature map is located, extract the defect edge and overall morphology using a region growing segmentation algorithm to obtain a defect segmentation region, and binarize and output the defect segmentation region.
[0107] The binarization output of the fabric image is to set the gray value of the pixel points on the fabric image to 0 or 255, that is, to present a clear visual effect of only black and white for the entire image, and then output.
[0108] It can be understood that after multi-feature fusion, the defect region in the reconstructed feature map is obviously distinguished from the background region, and the block where the defect region is located can be located. However, due to the block processing of the fabric image, the defect edge and overall morphology information are lost, so the region growing segmentation method is selected for defect segmentation in this paper to extract the defect edge and overall morphology to obtain a defect segmentation region that can represent the defect region, and then binarize and output.
[0109] In one possible implementation, S111 specifically includes:
[0110] S1111: Find the defect region from the reconstructed feature map, and locate the image block where the defect region is located;
[0111] S1112: Take the center pixel point of the image block as a growing seed;
[0112] S1113: Set a growth threshold for the growing seed, and take the growth threshold as a growth criterion;
[0113] S1114: Calculate the difference between the neighborhood pixel points and the growing pixel points, and in the case where the difference is less than the growth threshold, merge the growing pixel points and the neighborhood pixel points to obtain a defect region;
[0114] S1115: binarize the acquired defect region and output if the growth does not meet the growth criterion.
[0115] In the embodiment of the present application, by dividing the acquired fabric image into texture regions and defect regions, and calculating the diffusion gradient values corresponding to each region for regional diffusion, the difference between the texture regions and the defect regions is increased, and the defect regions are highlighted. By constructing the improved LBP algorithm, the fabric image is divided into multiple image blocks to extract the gray scale features, which can effectively avoid the strong interference caused by extracting the gray scale features from the pixel points. After the extracted multi-feature image is further highlighted by the neighborhood reduction mean value method, it is normalized, and then weighted fusion is performed to obtain the reconstructed feature map. Through continuous highlighting of the difference between the defect regions and the texture regions, finally the defect segmentation region obtained by the region growing segmentation algorithm is binarized and output to obtain the defect region image with obvious and prominent defects. While avoiding the limitations and complexity of the neural network multi-layer convolution algorithm, the anti-interference ability of the defect detection process is improved, and the detection result is more accurate.
[0116] The above only describes the embodiments of the present application and is not intended to limit the present application. Those skilled in the art can make various changes and modifications to the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of the claims of the present application.
Claims
1. A method of detecting a patterned knit defect, the method comprising: The method comprises the steps of: S101: acquiring a fabric image, and dividing the fabric image into a texture region and a defect region according to a preset gradient value; S102: extracting a gray gradient matrix of the fabric image, calculating a first gradient threshold value of the texture region by a probability subset method, and calculating a second gradient threshold value of the defect region by a correlation criterion method; S103: constructing a diffusion coefficient function according to the first gradient threshold value, the second gradient threshold value and the preset gradient value, performing regional diffusion on the texture region and the defect region, and obtaining a diffusion fabric image; S104: dividing the diffusion fabric image into a plurality of image blocks, calculating the mean value of the characteristic values of each image block, and selecting the maximum mean value and the minimum mean value; S105: setting an automatic threshold value according to the second gradient threshold value, the maximum mean value and the minimum mean value, constructing an improved LBP algorithm, extracting LBP gray characteristic values of the diffusion fabric image, and obtaining an LBP gray feature map; S106: calculating the local entropy value of each pixel point in the diffusion fabric image to obtain a local entropy feature map, and calculating the correlation value of each pixel point in the diffusion fabric image to obtain a correlation feature map; S107: calculating the corresponding target LBP gray characteristic value, target local entropy value and target correlation value by using the non-neighborhood reduction mean value method respectively for the LBP gray characteristic value, the local entropy value and the correlation value; S108: normalizing the target LBP gray characteristic value, the target local entropy value and the target correlation value to a preset interval to obtain normalized target LBP gray characteristic values, normalized target local entropy values and normalized target correlation values; S109: calculating the weight corresponding to the LBP gray feature map according to the normalized target LBP gray characteristic value, the peak region characteristic value and the non-peak region characteristic value in the LBP gray feature map, and similarly, calculating the weight corresponding to the local entropy feature map and the weight corresponding to the correlation feature map; S110: calculating the fusion coefficient corresponding to each feature map according to the weight corresponding to each feature map, multiplying each feature map and the corresponding fusion coefficient to obtain a reconstructed feature map; S111: positioning the image block where the defect region in the reconstructed feature map is located, extracting the defect edge and the overall morphology by using a region growing segmentation algorithm to obtain a defect segmentation region, and performing binaryzation on the defect segmentation region to output.
2. The method of claim 1, wherein the step of detecting the patterned knit defect is performed by a computer vision system. The S102 specifically comprises: S1021: For a preset defect image gradient value set G L ={0, 1, 2, …, L-1}, the gray gradient matrix is the fabric image of MxN, the occurrence probability P of each gradient value in the gradient value set which is not 0 is calculated i : wherein n i represents the number of gradient values of i; S1022: selecting a maximum gradient value probability p from the gradient value probability; p = max{pi, p2, ···, p L-1} Equation 2; S1023: introducing a control factor, and determining a probability range △p in combination with the maximum gradient value probability; S1024: taking the mean value of the gradient values in the probability range to calculate the first gradient threshold value K1: S1025: calculating the correlation quantity P{s} between a specified gradient level and other gradient levels according to the gradient value probability; where S G L denotes the specified gradient level; S1026: Calculate the total correlation amount TC between the specified gradient level and other gradient levels (s) : S1027: in the case that the total correlation quantity is the maximum value, calculating the second gradient threshold value K2 of the defect region and the texture region:
3. The method of claim 2, wherein the step of detecting the pattern of the knit fabric defect is performed by using a pattern matching algorithm. The S103 specifically comprises: S1031: taking the second gradient threshold value as the optimal decomposition threshold value of the defect region and the texture region; S1032: constructing a diffusion coefficient function of the texture region and the defect region according to the preset threshold value and the optimal decomposition threshold value:
4. The method of claim 3, wherein the step of detecting the pattern of the knit fabric defect is performed by using a pattern matching algorithm. The S105 specifically includes: S1051: calculating an automatic threshold value T: T = min{K2 - min(μ n ), max(μ n )-K2} Equation 9 where μ n denotes the vector of the mean composition of the total image patches n; S1052: Compute improved LBP algorithm according to the automation threshold where p denotes the number of neighborhoods, s denotes a variable parameter, R denotes a parameter radius, μ p , μ c denote the center block mean and the neighborhood block mean, respectively, L denotes the uniform pattern of LBP, and riu2 denotes the rotation invariant uniform pattern.
5. The method of claim 4, wherein the step of detecting the pattern of the knit fabric defect is performed by using a pattern matching algorithm. The S106 specifically includes: S1061: for a gray image matrix of an MxN size gray feature map, the calculation method of the local entropy value S is: where p ij represents the frequency of the gray feature value at the pixel point (i, j).
6. The method of claim 5, wherein the step of detecting the pattern of the knit fabric defect is performed by using a pattern matching algorithm. The S106 further includes: S1062: calculating a correlation value C: wherein f(i, j) represents the gray scale feature value at pixel point (i, j), μ x , μ y respectively represent the mean value in the row direction and the column direction of the fabric image, σ x , σ y respectively represent the standard deviation in the row direction and the column direction of the fabric image.
7. The method of detecting a patterned knit defect according to claim 6, wherein, The S107 specifically includes: S1071: calculating the row mean value h of each image block; S1072: the calculation method of the target LBP gray feature value, the target local entropy value and the target correlation value is: wherein S ij denotes the LBP gray scale feature value, the local entropy feature value and the correlation feature value, μ iT is removed S ij the row mean after the neighborhood size h, F ij are the corresponding target LBP gray scale feature value, target local entropy value and the target correlation value.
8. The method of detecting a patterned knit defect according to claim 7, wherein, The S109 specifically includes: S1091: take the ratio of the peak region feature value and the sum of the non-peak region feature value of the LBP gray scale feature map as the weight of the corresponding individual feature map, and so on, calculate the weight corresponding to the local entropy feature map and the weight corresponding to the correlation feature map G k : wherein N p is the number of peak region feature values, respectively represent the feature value at point (i, j) in the kth feature map and the dth feature value of the peak region.
9. The method of detecting a patterned knit defect according to claim 8, wherein, The S110 specifically includes: S1101: Calculate the fusion coefficient W corresponding to each feature map according to the weight of each feature map k : S1102: multiplying each feature map and the corresponding fusion coefficient to obtain the reconstructed feature map: F = W k F k Equation 17.
10. The method of detecting a patterned knit defect according to claim 1, wherein, The S111 specifically includes: S1111: finding a defect region from the reconstructed feature map, and positioning the image block where the defect region is located; S1112: taking the center pixel point of the image block as a growth seed; S1113: setting a growth threshold value of the growth seed, and taking the growth threshold value as a growth criterion; S1114: calculating the difference between the neighborhood pixel point and the growth pixel point, and merging the growth pixel point and the neighborhood pixel point to obtain a defect region under the condition that the difference is less than the growth threshold value; S1105: in the case of not meeting the growth criterion, binarizing and outputting the obtained defect region.
Citation Information
Patent Citations
Fabric defect detection method based on local statistical characteristics and overall significance analysis
CN103729842A
Integral graph algorithm-based fabric flaw detection method
CN107240086A