Fabric defect detection method based on interwoven frame vector feature extraction
Through the method based on the interlaced frame vector feature extraction, the existing fabric defect detection method has solved the problem that the equipment performance requirements are high and the detection results are affected by image rotation, and efficient and simple fabric defect detection is achieved, which is suitable for low-performance equipment.
Patent Information
- Application Number
- CN202411574917.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing fabric defect detection methods have high requirements for equipment performance, the detection results are affected by image rotation, and the operation efficiency is poor on low-performance equipment.
Using the method of feature extraction based on interleaved frame vectors, the grayscale image of the fabric is obtained through camera shooting, the region of interest is established and feature extraction is performed. Three frame filters are used to perform multiplication operations, the interleaved frame vectors are calculated and the point multiplication operations are performed to generate The texture feature image is thresholded to locate fabric image defects.
It realizes efficient fabric defect detection, simple method, not affected by image rotation, is suitable for low-performance equipment, and has high application value.
Smart Images

Figure CN119444724A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a computer vision image processing method, and in particular to a fabric defect detection method based on interlaced frame vector feature extraction. Background Art
[0002] Fabric defect detection is crucial in the textile industry, helping to diagnose problems in the production process and improve product quality. Traditionally, fabric defect detection relies on manual visual inspection, which can lead to inefficiencies and uncertainty in detection results due to human factors. Automated systems are used to improve the efficiency and accuracy of quality control. For the textile industry, achieving more efficient automated inspection is particularly important because it can reduce reliance on manual inspection and improve overall production efficiency.
[0003] There are two main types of computer vision applications in fabric defect detection:
[0004] 1) Defect detection methods based on deep learning. Although deep learning technology has been widely used in many fields due to its high accuracy and efficiency, in terms of fabric defect detection, such methods have high requirements on computing resources, so there are certain challenges in implementing them on low-performance devices.
[0005] 2) Defect detection methods based on traditional image algorithms. Such methods usually involve technologies such as gray-level co-occurrence matrix, auto-correlation function, wavelet transform, Gabor filter, etc. Although these technologies can achieve effective defect detection to a certain extent, they are easily affected by factors such as image rotation and have low operating efficiency on low-performance devices.
[0006] Existing methods for fabric defect detection have problems such as high requirements on equipment performance, detection results being affected by image rotation, and poor operating efficiency on low-performance devices. Therefore, new fabric defect detection methods are needed to overcome these challenges. Summary of the invention
[0007] In order to overcome the limitations of the prior art, the present invention provides a fabric defect detection method based on interlaced frame vector feature extraction.
[0008] The fabric defect detection method based on interlaced frame vector feature extraction of the present invention comprises the following steps:
[0009] 1) Use a camera to capture the fabric and obtain a grayscale image P(i, j) of the fabric.
[0010] 2) For each pixel point (i, j) in the grayscale image P(i, j), a region of interest is established and feature extraction is performed to obtain feature values and then assignment replacement is performed.
[0011] 3) Repeat the above step 2) to traverse each pixel point (i, j) in the grayscale image P (i, j) and finally form a texture feature image T (i, j).
[0012] 4) Performing threshold segmentation on the texture feature image T(i, j) to obtain a binary image G(i, j), and locating fabric image defects based on the binary image G(i, j).
[0013] The step 2) is specifically as follows:
[0014] 2.1) Establish a region of fixed size as the region of interest image ROI, and set the pixels outside the grayscale image P(i, j) in the region of interest image ROI to zero.
[0015] 2.2) Create three frame filters NearFilter(i,j), MiddleFilter(i,j), and FarFilter(i,j) that are the same size as the region of interest image ROI and have different internal pixel value distributions.
[0016] 2.3) The region of interest image ROI is multiplied by the three image frame filters to obtain frame filtered images N(i,j), M(i,j), and F(i,j).
[0017] 2.4) Calculate the interleaved frame vector V from the center pixel of the three frame filtered images N(i,j), M(i,j), and F(i,j) in step 2.3) to their respective image centroids N 、V M 、V F .
[0018] 2.5) Perform point multiplication operations on the three interlaced frame vectors in step 2.4) to obtain three eigenvalues, and then use the average of the three eigenvalues as the eigenvalue of the region of interest image ROI.
[0019] 2.6) The feature value obtained in step 2.5) is assigned as the pixel value of the center position of the region of interest image ROI.
[0020] The three frame filters in step 2.2) are respectively set as:
[0021] In the first frame filter NearFilter(i,j), the outermost pixel value of the 3×3 rectangular area centered on the image center is set to 1, and the remaining image pixel values are set to 0.
[0022] In the second frame filter MiddleFilter(i,j), the outermost pixel value of the 5×5 rectangular area centered on the image center is set to 1, and the remaining image pixel values are set to 0.
[0023] In the third frame filter FarFilter(i,j), the outermost pixel value of the 7×7 rectangular area centered on the image center is set to 1, and the remaining image pixel values are set to 0.
[0024] In step 2.3), the image multiplication formula is as follows:
[0025] C(i,j)=A(i,j)·B(i,j)
[0026] Where, · is the multiplication operator, (i, j) is the horizontal and vertical coordinates of the image pixel, C(i, j) represents the pixel value of the frame filtered image N(i, j) at (i, j), A(i, j) and B(i, j) represent the pixel values of the region of interest image ROI and the frame filter at (i, j), respectively.
[0027] In step 2.4), the interleaved frame vector V N 、V M 、V F All are processed in the same way, where the interleaved frame vector V N The calculation is as follows:
[0028] V N =(x c -x o ,y c -y o )
[0029]
[0030] In the formula, (x c ,y c ) is the centroid coordinate of the frame filtering image, (x o ,y o ) is the center pixel coordinate of the frame filtered image, (i, j) is the coordinate of the image pixel, p(i, j) is the pixel value of the image at (i, j), M and N represent the number of rows and columns of the image respectively.
[0031] In step 4), the threshold segmentation formula is as follows:
[0032]
[0033] Where p(i,j) is the pixel value at coordinate (i,j), g(i,j) is the pixel value after threshold segmentation at coordinate (i,j), and thresh is the segmentation threshold.
[0034] In the step 4), the fabric image defects are located according to the binary image G(i,j), specifically:
[0035] The white connected domain part is identified according to the binary image G(i,j), and the white connected domain part is taken as the fabric image defect.
[0036] The present invention has the following beneficial effects:
[0037] The present invention defines three frame filters, performs multiplication operation with the region of interest image of each pixel point, calculates the centroid of the filtered image and generates the corresponding interlaced frame vector, and uses the result of point multiplication of different interlaced frame vectors as image features to locate image defects. The method is simple to implement and is not affected by image rotation. It has high application value in fabric defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a flow chart of the method of the present invention.
[0039] Figure 2 It is the original image in Example 1 of the present invention.
[0040] Figure 3 is from Figure 2 A local image of size 7×7 is selected from .
[0041] Figure 4 is the NearFilter frame filter image.
[0042] Figure 5 is the MiddleFilter frame filter image.
[0043] Figure 6 is the FarFilter frame filter image.
[0044] Figure 7 yes Figure 3 and Figure 4 Image after multiplication.
[0045] Figure 8 yes Figure 3 and Figure 5 Image after multiplication.
[0046] Fig. 9 yes Figure 3 and Figure 6 Image after multiplication.
[0047] Fig.10 yes Figure 2 The corresponding feature image.
[0048] Fig.11 yes Figure 2 Defect detection result diagram.
[0049] Fig.12 is the fabric original image.
[0050] Fig.13 yes Fig.12 Defect detection result diagram.
[0051] Fig.14 is the fabric original image.
[0052] Fig.15 yes Fig.14 Defect detection result diagram. DETAILED DESCRIPTION
[0053] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0054] like Figure 1 As shown, the embodiments of the present invention and their implementation process are as follows:
[0055] 1) Use a camera to capture the fabric and obtain a grayscale image P(i, j) of the fabric; capture the fabric grayscale image, such as Figure 2 As shown, for the convenience of display, only the area surrounding the fabric defect is shown.
[0056] 2) For each pixel point (i, j) in the grayscale image P(i, j), a region of interest is established and feature extraction is performed to obtain feature values and then assignment replacement is performed.
[0057] Step 2) is specifically as follows:
[0058] 2.1) With pixel (i, j) as the center, establish a fixed-size region as the region of interest image ROI. The pixels outside the grayscale image P(i, j) in the region of interest image ROI are set to zero. Usually, the fixed size is at least larger than 7×7; Figure 3 As shown, from Figure 2 A local image with a size of 7×7 is selected as the region of interest image ROI.
[0059] 2.2) Create three frame filters NearFilter(i,j), MiddleFilter(i,j), and FarFilter(i,j) with the same size as the region of interest image ROI and different internal pixel value distribution, as shown below: Figure 4 , Figure 5 and Figure 6 shown.
[0060] In step 2.2), the three frame filters are set as follows:
[0061] In the first frame filter NearFilter(i,j), the outermost pixel value of the 3×3 rectangular area centered on the image center is set to 1, and the remaining image pixel values are set to 0.
[0062] In the second frame filter MiddleFilter(i,j), the outermost pixel value of the 5×5 rectangular area centered on the image center is set to 1, and the remaining image pixel values are set to 0.
[0063] In the third frame filter FarFilter(i,j), the outermost pixel value of the 7×7 rectangular area centered on the image center is set to 1, and the remaining image pixel values are set to 0.
[0064] 2.3) Multiply the region of interest image ROI with the three image frame filters to obtain the frame filter images N(i,j), M(i,j), and F(i,j), respectively. Figure 7 , Figure 8 and Fig. 9 shown.
[0065] In step 2.3), the image multiplication formula is as follows:
[0066] C(i,j)=A(i,j)·B(i,j)
[0067] Where, · is the multiplication operator, (i, j) is the horizontal and vertical coordinates of the image pixel, C(i, j) represents the pixel value of the frame filtered image N(i, j) at (i, j), A(i, j) and B(i, j) represent the pixel values of the region of interest image ROI and the frame filter at (i, j), respectively.
[0068] 2.4) Calculate the interleaved frame vector V from the center pixel of the three frame filtered images N(i,j), M(i,j), and F(i,j) in step 2.3) to their respective image centroids N 、V M 、V F .
[0069] In step 2.4), the interleaved frame vector V N 、V M 、V F All are processed in the same way, where the interleaved frame vector V N The calculation is as follows:
[0070] V N =(x c -x o ,y c -y o )
[0071]
[0072] In the formula, (x c ,y c ) is the centroid coordinate of the frame filtering image, (x o ,y o) is the center pixel coordinate of the frame filtered image, (i, j) is the coordinate of the image pixel, p(i, j) is the pixel value of the image at (i, j), M and N represent the number of rows and columns of the image respectively.
[0073] 2.5) Perform point multiplication operations on the three interlaced frame vectors in step 2.4) to obtain three eigenvalues, and then use the average of the three eigenvalues as the eigenvalue of the region of interest image ROI.
[0074] In step 2.5), the formula for calculating the dot product of the interleaved frame vector is as follows:
[0075] d fm =V F ·V M
[0076] d fn =V F ·V N
[0077] d mn =V N ·V M
[0078] V F ·V M =x f x m +y f y m
[0079] V F ·V N =x f x n +y f y n
[0080] V N ·V M =x n x m +y n y m
[0081] Where, d fm d fn d mn are the results of interleaved frame vector dot multiplication, (x f ,y f )、(x m ,y m )、(x n ,y n ) are interleaved frame vectors V F 、V M 、V N The coordinates of .
[0082] 2.6) The feature value obtained in step 2.5) is assigned as the pixel value of the center position of the region of interest image ROI, and the center position of the region of interest image ROI is the current pixel point (i, j).
[0083] 3) Repeat the above step 2) to traverse each pixel point (i, j) in the grayscale image P (i, j), and finally form a texture feature image T (i, j), such as Fig.10 shown.
[0084] 4) Perform threshold segmentation on the texture feature image T(i,j) to obtain a binary image G(i,j), and locate fabric image defects based on the binary image G(i,j).
[0085] In step 4), the threshold segmentation formula is as follows:
[0086]
[0087] Where p(i,j) is the pixel value at coordinate (i,j), g(i,j) is the pixel value after threshold segmentation at coordinate (i,j), and thresh is the segmentation threshold.
[0088] In step 4), the fabric image defects are located according to the binary image G(i,j), specifically:
[0089] According to the binary image G(i,j), the white connected domain part is identified and the white connected domain part is used as the fabric image defect to locate the fabric image defect, such as Fig.11 shown.
[0090] Example 2
[0091] Defective fabric images such as Fig.12 The results after treatment in the same manner as in Example 1 are shown in Fig.13 shown.
[0092] Example 3
[0093] Defective fabric images such as Fig.14 The results after treatment in the same manner as in Example 1 are shown in Fig.15 shown.
[0094] After multiple implementations of the present invention, the accuracy of the method of the present invention reached 93%.
[0095] By comparing the original images and the detection result images of the above embodiments, it can be seen that the present invention can accurately locate the surface defects of fabrics. In addition, the present invention takes into account the rotation invariance, that is, the features detected at different angles remain consistent. It has great application value for fabric defect detection.
[0096] The above specific implementation modes are used to explain the present invention rather than to limit the present invention. Any modification and change made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.
Claims
1. A fabric defect detection method based on interlaced frame vector feature extraction, characterized in that The method comprises the following steps: 1) Using a camera to obtain a grayscale image P(i, j) of the fabric; 2) For each pixel (i, j) in the grayscale image P(i, j), establish a region of interest and perform feature extraction to obtain feature values and then perform value replacement; 3) Repeat the above step 2) to traverse each pixel point (i, j) in the grayscale image P (i, j), and finally form a texture feature image T (i, j); 4) Performing threshold segmentation on the texture feature image T(i, j) to obtain a binary image G(i, j), and locating fabric image defects based on the binary image G(i, j).
2. The fabric defect detection method based on interlaced frame vector feature extraction according to claim 1 is characterized in that: The step 2) is specifically as follows: 2.1) Establish a fixed-size region as the region of interest image ROI; 2.2) Create three frame filters NearFilter(i,j), MiddleFilter(i,j), and FarFilter(i,j) with the same size as the region of interest image ROI and different internal pixel value distribution; 2.3) performing multiplication operations on the region of interest image ROI and the three image frame filters respectively to obtain frame filter images N(i,j), M(i,j), and F(i,j); 2.4) Calculate the interleaved frame vector V from the center pixel of the three frame filtered images N(i,j), M(i,j), and F(i,j) in step 2.3) to their respective image centroids N 、V M 、V F ; 2.5) performing point multiplication operations on the three interlaced frame vectors in step 2.4) to obtain three eigenvalues, and then taking the average of the three eigenvalues as the eigenvalue of the region of interest image ROI; 2.6) The feature value obtained in step 2.5) is assigned as the pixel value of the center position of the region of interest image ROI.
3. The fabric defect detection method based on interlaced frame vector feature extraction according to claim 2 is characterized in that: The three frame filters in step 2.2) are respectively set as: In the first frame filter NearFilter(i,j), the outermost pixel value of the 3×3 rectangular area centered on the image center is set to 1, and the remaining image pixel values are set to 0; In the second frame filter MiddleFilter(i,j), the outermost pixel value of the 5×5 rectangular area centered on the image center is set to 1, and the remaining image pixel values are set to 0; In the third frame filter FarFilter(i,j), the outermost pixel value of the 7×7 rectangular area centered on the image center is set to 1, and the remaining image pixel values are set to 0.
4. The fabric defect detection method based on interlaced frame vector feature extraction according to claim 2 is characterized in that: In step 2.3), the image multiplication formula is as follows: C(i,j)=A(i,j)·B(i,j) Where, · is the multiplication operator, (i, j) is the horizontal and vertical coordinates of the image pixel, C(i, j) represents the pixel value of the frame filtered image N(i, j) at (i, j), A(i, j) and B(i, j) represent the pixel values of the region of interest image ROI and the frame filter at (i, j), respectively.
5. The fabric defect detection method based on interlaced frame vector feature extraction according to claim 2, characterized in that: In step 2.4), the interleaved frame vector V N 、V M 、V F are obtained by the same processing method, wherein the interlaced frame vector V N The calculation is as follows: V N (x) c -x o ,and c -and o ) In the formula, (x c ,y c ) is the centroid coordinate of the frame filtering image, (x o ,y o ) is the center pixel coordinate of the frame filtered image, (i, j) is the coordinate of the image pixel, p(i, j) is the pixel value of the image at (i, j), M and N represent the number of rows and columns of the image respectively.
6. The fabric defect detection method based on interlaced frame vector feature extraction according to claim 1, characterized in that: In step 4), the threshold segmentation formula is as follows: Where p(i,j) is the pixel value at coordinate (i,j), g(i,j) is the pixel value after threshold segmentation at coordinate (i,j), and thresh is the segmentation threshold.
7. The fabric defect detection method based on interlaced frame vector feature extraction according to claim 1 is characterized in that: In the step 4), the fabric image defects are located according to the binary image G(i,j), specifically: The white connected domain part is identified according to the binary image G(i,j), and the white connected domain part is taken as the fabric image defect.
Citation Information
Patent Citations
Fabric defect detection method in warp knitting process
CN112365448A
PVC powder wet process flaw analysis device and method with automatic cleaning function
CN118794957A