Textile fabric texture density detection method and detection equipment

Through computer vision and deep learning technology, combined with waveform processing and diffusion models, the problem of low accuracy and low efficiency in textile texture density detection is solved, achieving fast and accurate detection of textile texture density, and improving quality inspection efficiency in industrial production. .

CN118537283APending Publication Date: 2024-08-23GUANGXI BEST TEXTILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410149187.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-12-11
Filing Date
2024-02-02
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing textile texture density detection methods have problems of low accuracy and low efficiency. In particular, manual detection is easily affected by subjective factors. Although machine vision detection is objective and accurate, it is highly complex and difficult to apply quickly in industrial production.

Method used

Using computer vision technology combined with waveform processing and deep learning, preprocessing is performed by obtaining textile images, extracting color value sequences as signal sequences, using smoothing windows and diffusion models to repair waveforms, setting peak thresholds to identify the number and position of peaks, and calculating losses Function to optimize parameters to achieve fast and accurate detection of textile texture density.

Benefits of technology

It achieves rapid and accurate detection of textile texture density, improves quality inspection efficiency, reduces the use of human resources, and cleans data through the mode and standard deviation methods to eliminate errors and obtain high-precision detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537283A
    Figure CN118537283A
Patent Text Reader

Abstract

The invention discloses a textile texture density detection method and detection equipment. The detection method comprises the following steps: acquiring textile image preprocessing; respectively taking the color value sequences of the partial rows as signal sequences, and carrying out smoothing processing and oscillogram drawing by using a smoothing window; training a diffusion model to repair the oscillogram into a regular oscillogram; setting peak width and height thresholds, and identifying the number and positions of peaks in the regular oscillogram; calculating a loss value according to the number and position of the identified and manually counted wave crests, and repeating the steps to obtain an optimal smooth window size, wave crest width and height threshold, and obtain a finally trained diffusion model; according to the optimal smooth window size, wave crest width and height threshold values and the same method, the number and the positions of wave crests of the oscillogram obtained by processing the to-be-detected textile fabric are obtained, and the warp density value of the to-be-detected textile fabric is calculated; similarly, obtaining a weft density value. According to the invention, the quality of the textile fabric can be rapidly and accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image data processing and recognition, and in particular relates to a textile texture density detection method and detection equipment. Background Art

[0002] Textile texture density detection is a very important quality control indicator in the textile industry, which is related to the feel, comfort, durability and appearance of textiles. At present, there are two main methods for textile texture density detection: manual detection and machine vision detection.

[0003] The manual detection method refers to judging the texture density of textiles by visual observation and touching them. This method is simple and easy to use and does not require expensive equipment, but it is easily affected by subjective factors, has low accuracy and efficiency, and is not suitable for the needs of modern industrial production.

[0004] Machine vision detection method refers to the automated detection of textile texture density through cameras, image processing algorithms and computer software. This method is objective, accurate and efficient, and has gradually become the mainstream detection method in modern textile industry production. Machine vision detection methods mainly include the following aspects: Texture feature extraction: The textile image is captured by a camera, and then the texture features such as grayscale, color, and grain are extracted using image processing algorithms. Texture classification and recognition: According to the extracted texture features, the texture is classified and identified using machine learning, pattern recognition and other algorithms to determine the type and texture density of the textile. Density calculation: According to the results of classification and recognition, the texture density of the textile is calculated through a specific formula or algorithm to obtain a specific numerical indicator. Data analysis and display: The test results are analyzed and charts or reports are generated to facilitate users to intuitively understand the quality status of the textile. Summary of the invention

[0005] The present invention provides a method and device for detecting the texture density of textiles. The texture density of textiles is calculated by performing image processing through computer vision combined with waveform processing and deep learning. The method can be used in industry to quickly and accurately detect the quality of textiles, saving human resources while improving quality inspection efficiency.

[0006] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:

[0007] A method for detecting texture density of textile fabrics, comprising:

[0008] S1, obtaining several images of textiles and performing preprocessing;

[0009] S2, for each preprocessed textile image, selecting the color value sequences of some rows therein as signal sequences;

[0010] S3, using a smoothing window to smooth the signal sequence, and drawing the smoothed signal sequence of each window as a waveform diagram;

[0011] S4, training a diffusion model, and using the diffusion model to repair each waveform graph into a regular waveform graph;

[0012] S5, setting a peak width threshold and a peak height threshold, and identifying the number and positions of peaks in the regular waveform graph according to the set peak width threshold and peak height threshold;

[0013] S6, calculating the loss function value according to the number and position of the identified peaks and the number and position of the manually counted peaks, and repeating steps S3-S6 based on the loss function value to obtain the optimal smoothing window size, peak width threshold and peak height threshold, and obtain the final trained diffusion model;

[0014] S7, when it is necessary to detect the warp density of the textile, set the smoothing window, the peak width threshold and the peak height threshold according to the optimal smoothing window size, the peak width threshold and the peak height threshold, and obtain the number and position of the peaks of the waveform graph processed at several different areas of the textile to be detected in the same way as steps S1-S5;

[0015] Finally, based on the number and position of wave peaks of the waveform graph processed at different regions of the textile to be detected, the warp density value of the textile to be detected is calculated.

[0016] Furthermore, the selection of rows in step S2 is replaced by selection of columns, and the weft density value of the textile to be tested is calculated in the same manner as steps S2-S7.

[0017] Furthermore, the preprocessing in step S1 includes: (1) modifying the image to a preset resolution and size; (2) according to the original features of the image, if the independent color blocks of the image are white, inverting the image to ensure that the independent color blocks therein are black; (3) converting the image processed in the previous step into a grayscale image; (4) converting the image processed in the previous step into a binary image through an adaptive threshold.

[0018] Furthermore, in step S3, the numpy.convolve() function in Python is called to smooth the signal sequence.

[0019] Further, in step S5, the scipy.signal.find_peaks() function in Python is called to identify the number and positions of peaks in the regular waveform graph.

[0020] Furthermore, when training the diffusion model in step S4, Gaussian noise is continuously and uniformly added to the drawn waveform until the waveform becomes a preset regular waveform. At this time, the difference between the regular waveform and the original drawn waveform is the trained diffusion model.

[0021] Furthermore, the loss function value is calculated as:

[0022]

[0023] In the formula, Loss is the calculated loss function value, n is the number of peaks counted manually, and l i is the position of the manually counted i-th peak, is the number of peaks identified in step S5, Step S5 identifies the position of the i-th peak.

[0024] Furthermore, in step S7, the method for calculating the warp density value of the textile to be tested is:

[0025] (1) Select rows in different regions of the image, record the number of peaks in each row as N, and the positions are {L1,…,L i ,…,L j ,…,L N};

[0026] (2) Select two peaks i and j and calculate the average peak pixel density dis between the two peaks in each row pixel,r :

[0027]

[0028] (3) According to the pixel width w of the image, that is, the number of horizontal pixels of the image, calculate the number of peaks num in each row peak,r :

[0029]

[0030] (4) Combined with prior knowledge, that is, the number of warp yarns r between every two wave peaks, calculate the number of warp yarns num in each row r :

[0031]

[0032] (5) Calculate the warp density D of each row based on the actual width b of the image r :

[0033]

[0034] (6) Calculate the mode of the warp density based on the warp density of all rows rWith standard deviation std r , calculate the average value of the warp density values ​​that meet the following conditions:

[0035] mode r -std r ≤D r ≤mode r +std r

[0036] (7) The average value obtained is taken as the final warp yarn density value of the textile to be tested.

[0037] Furthermore, in step S7, the method for calculating the weft density value of the textile to be tested is:

[0038] (1) Select columns in different regions of the image, and record the number of peaks in each column as M, and the positions are {L1,…,L i ,…,L j ,…,L M};

[0039] (2) Select two peaks i and j and calculate the average peak pixel density dis between the two peaks in each column pixel,c :

[0040]

[0041] (3) According to the pixel height h of the image, that is, the number of vertical pixels of the image, calculate the number of peaks in each column num peak,c :

[0042]

[0043] (4) Combined with prior knowledge, that is, the number of weft yarns c between every two wave peaks, calculate the number of weft yarns num in each column c :

[0044]

[0045] (5) Calculate the weft density D of each column based on the actual height a of the image r :

[0046]

[0047] (6) Calculate the mode of the weft density by calculating the weft density of all columns c With standard deviation std c , calculate the average value of the weft yarn density values ​​that meet the following conditions:

[0048] mode c -std c ≤Dc ≤mode c +std c

[0049] (7) The average value obtained is taken as the final weft yarn density value of the textile to be tested.

[0050] A detection device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements any one of the above-mentioned textile texture density detection methods.

[0051] Beneficial Effects

[0052] The present invention first converts the image information into a waveform diagram, which has the advantage of visually observing the peak, that is, the color blocks on the image can be intuitively and quantitatively observed. Secondly, the present invention uses a machine learning method to find the most suitable peak parameters as the parameters of the final pre-training model, which can achieve more accurate and rapid detection and recognition effects in industry. Finally, the mode and standard deviation are used to clean out the valid data, and the interference of excessive error data is further eliminated to obtain the final high-precision detection and recognition results. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is an overall framework diagram of the textile texture density detection method according to an embodiment of the present application. DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without making any creative work shall fall within the scope of protection of the present invention.

[0055] Figure 1 The figure shows the overall framework diagram of the textile texture density detection method of the present invention, which includes S1: image preprocessing; S3: waveform conversion; S4, S5, S6: deep learning training; S7: calculation of statistical results.

[0056] The textile texture density detection method provided in this embodiment comprises the following steps:

[0057] S0: Use a camera to take a photo of the textile at a suitable position. The actual size of the textile in the shooting range is about 10 cm × 10 cm. This size is recorded as a × b.

[0058] S1: Perform image preprocessing on the photo to obtain a binary image. The specific process is as follows: a) adjust the size of the photo to w×h pixels; b) according to the original features of the image, if the independent color blocks of the image are white, invert the image to ensure that the independent color blocks are black; c) convert the image processed in the previous step into a grayscale image; d) convert the image processed in the previous step into a binary image through an adaptive threshold.

[0059] S2: Using the color value sequence as the signal sequence: For each preprocessed textile image, select some rows, and use the color value sequence of each selected row as the signal sequence. The sequence consists of 0 or 255, and the length is the number of pixels in a row, that is, w.

[0060] S3: Smoothing signals and drawing waveforms: Apply a smoothing window to each row of color value signal sequence and call numpy.convolve() method for smoothing to obtain a smoothed signal sequence, where each value in the smoothed sequence is an integer between 0 and 255. Then draw the smoothed signal sequence as a waveform.

[0061] S4: Train a diffusion model, and use the diffusion model to repair each waveform graph into a regular waveform graph.

[0062] S5: Identify the number and position of peaks in the regular waveform: set the peak width threshold and peak height threshold, and call the scipy.signal.find_peaks() function in Python to identify the number and position of peaks in the regular waveform according to the set peak width threshold and peak height threshold.

[0063] S6: Optimize the smoothing window size, peak width threshold and peak height threshold, and train the diffusion model.

[0064] According to the number and position of the identified peaks and the number and position of the manually counted peaks, the loss function value is calculated, and steps S3-S6 are repeated based on the loss function value to obtain the optimal smoothing window size, peak width threshold and peak height threshold, and the final trained diffusion model.

[0065] In each iteration of steps S3-S6, the smoothing window size, peak width threshold and peak height threshold are set, and the corresponding smoothing and peak number and position identification process is performed, and a diffusion model is trained accordingly to repair the waveform graph. Then, the loss function value is calculated based on the identified peak number and position and the manually counted peak number and position:

[0066]

[0067] In the formula, Loss is the calculated loss function value, n is the number of peaks counted manually, and l i is the position of the manually counted i-th peak, is the number of peaks identified in step S5, Step S5 identifies the position of the i-th peak.

[0068] The process of step S6 is the process of minimizing the loss function. When the loss function Loss < 10, the training ends. The number of peaks has a greater impact on the final calculated density, while the slight difference in the peak position has a relatively small impact on the final calculation result, so different loss coefficients are set for them.

[0069] The training of the diffusion model is to evenly add Gaussian distribution to the original waveform to blur the waveform. The result obtained by the diffusion model training is a corrected waveform. The training result is superimposed on the blurred waveform for refinement. In this way, the irregular waveform before blurring can be repaired into a more regular waveform. After being repaired into a more regular waveform, it is easier to obtain more accurate recognition results when applying the scipy.signal.find_peaks() method to identify peaks.

[0070] S7: Calculation of the warp density of the textile to be tested.

[0071] When the warp density of the textile needs to be detected, the smoothing window, the peak width threshold and the peak height threshold are set according to the optimal smoothing window size, the peak width threshold and the peak height threshold, and the number and position of the peaks of the waveform graph processed at several different areas of the textile to be detected are obtained by the same method as steps S1-S5. When step S4 is executed on the textile to be detected, the diffusion model finally trained is directly used to modify the waveform graph, and the diffusion model is no longer trained.

[0072] Finally, the number N and position {L1, L2, ..., L i ,…,L j ,…,L N}, as the basis for density identification, combined with prior knowledge of textile technology, the warp density value of the textile to be tested is calculated. Specifically including:

[0073] (1) Select rows in different regions of the image, record the number of peaks in each row as N, and the positions are {L1,…,L i ,…,L j ,…,L N};

[0074] (2) Select two peaks i and j and calculate the average peak pixel density dis between the two peaks in each row pixel,r :

[0075]

[0076] Usually the waveform at the edge of the image is unstable. In order to reduce the impact, the data on both sides are not calculated, and i=3, j=N-2 is selected;

[0077] (3) According to the pixel width w of the image, that is, the number of horizontal pixels of the image, calculate the number of peaks num in each row peak,r :

[0078]

[0079] (4) Combined with prior knowledge, that is, the number of warp yarns r between every two wave peaks, calculate the number of warp yarns num in each row r :

[0080]

[0081] (5) Calculate the warp density D of each row based on the actual width b of the image r :

[0082]

[0083] (6) Calculate the mode of the warp density based on the warp density of all rows r With standard deviation std r , calculate the average value of the warp density values ​​that meet the following conditions:

[0084] mode r -std r ≤D r ≤mode r +std r

[0085] (7) The average value obtained is taken as the final warp yarn density value of the textile to be tested.

[0086] S8: Calculation of the weft density of the textile to be tested. The selection of each row in step S2 is replaced by selection of each column, and the weft density value of the textile to be tested is further calculated in the same manner as steps S2-S7.

[0087] The method for calculating the weft density value of the textile to be tested is:

[0088] (1) Select columns in different regions of the image, and record the number of peaks in each column as M, and the positions are {L1,…,L i ,…,L j,…,L M};

[0089] (2) Select two peaks i and j and calculate the average peak pixel density dis between the two peaks in each column pixel,c :

[0090]

[0091] (3) According to the pixel height h of the image, that is, the number of vertical pixels of the image, calculate the number of peaks in each column num peak,c :

[0092]

[0093] (4) Combined with prior knowledge, that is, the number of weft yarns c between every two wave peaks, calculate the number of weft yarns num in each column c :

[0094]

[0095] (5) Calculate the weft density D of each column based on the actual height a of the image r :

[0096]

[0097] (6) Calculate the mode of the weft density by calculating the weft density of all columns c With standard deviation std c , calculate the average value of the weft yarn density values ​​that meet the following conditions:

[0098] mode c -std c ≤D c ≤mode c +std c

[0099] (7) The average value obtained is taken as the final weft yarn density value of the textile to be tested.

[0100] The above embodiments are preferred embodiments of the present application. Ordinary technicians in this field can also make various changes or improvements on this basis. Without departing from the overall concept of the present application, these changes or improvements should fall within the scope of protection required by the present application.

Claims

1. A method for detecting texture density of textiles, It is characterized in that include: S1, obtaining several images of textiles and performing preprocessing; S2, for each preprocessed textile image, selecting the color value sequences of some rows therein as signal sequences; S3, using a smoothing window to smooth the signal sequence, and drawing the smoothed signal sequence of each window as a waveform diagram; S4, training a diffusion model, and using the diffusion model to repair each waveform graph into a regular waveform graph; S5, setting a peak width threshold and a peak height threshold, and identifying the number and positions of peaks in the regular waveform graph according to the set peak width threshold and peak height threshold; S6, calculating the loss function value according to the number and position of the identified peaks and the number and position of the manually counted peaks, and repeating steps S3-S6 based on the loss function value to obtain the optimal smoothing window size, peak width threshold and peak height threshold, and obtain the final trained diffusion model; S7, when it is necessary to detect the warp density of the textile, set the smoothing window, the peak width threshold and the peak height threshold according to the optimal smoothing window size, the peak width threshold and the peak height threshold, and obtain the number and position of the peaks of the waveform graph processed at several different areas of the textile to be detected in the same way as steps S1-S5; Finally, based on the number and position of wave peaks of the waveform graph processed at different regions of the textile to be detected, the warp density value of the textile to be detected is calculated.

2. The method for detecting the texture density of textiles according to claim 1, It is characterized in that The selection of each row in step S2 is replaced by the selection of each column, and the weft density value of the textile to be tested is further calculated in the same manner as steps S2-S7.

3. The method for detecting textile texture density according to claim 1, It is characterized in that The preprocessing in step S1 includes: (1) modifying the image to a preset resolution and size; (2) according to the original features of the image, if the independent color blocks of the image are white, then inverting the image to ensure that the independent color blocks therein are black; (3) converting the image processed in the previous step into a grayscale image; (4) converting the image processed in the previous step into a binary image through an adaptive threshold.

4. The method for detecting the texture density of textiles according to claim 1, It is characterized in that In step S3, the numpy.convolve() function in Python is called to smooth the signal sequence.

5. The method for detecting textile texture density according to claim 1, It is characterized in that In step S5, the scipy.signal.find_peaks() function in Python is called to identify the number and positions of peaks in the regular waveform graph.

6. The method for detecting the texture density of textiles according to claim 1, It is characterized in that When training the diffusion model in step S4, Gaussian noise is continuously and uniformly added to the drawn waveform until the waveform becomes a preset regular waveform. At this time, the difference between the regular waveform and the original drawn waveform is the diffusion model obtained by training.

7. The method for detecting the texture density of textiles according to claim 1, It is characterized in that The calculation formula of the loss function value is: In the formula, Loss is the calculated loss function value, n is the number of peaks counted manually, and l i is the position of the manually counted i-th peak, is the number of peaks identified in step S5, Step S5 identifies the position of the i-th peak.

8. The method for detecting textile texture density according to claim 1, It is characterized in that In step S7, the method for calculating the warp density value of the textile to be tested is: (1) Select rows in different regions of the image, and record the number of peaks in each row as N, and the positions are {L 1 ,…,L i ,…,L j ,…,L N }; (2) Select two peaks i and j and calculate the average peak pixel density dis between the two peaks in each row pixel,r : (3) According to the pixel width w of the image, that is, the number of horizontal pixels of the image, calculate the number of peaks num in each row peak,r : (4) Combined with prior knowledge, that is, the number of warp yarns r between every two wave peaks, calculate the number of warp yarns num in each row r : (5) Calculate the warp density D of each row based on the actual width b of the image r : (6) Calculate the mode of the warp density based on the warp density of all rows r With standard deviation std r , calculate the average value of the warp density values ​​that meet the following conditions: mode r -std r ≤D r ≤mode r +std r (7) The average value obtained is taken as the final warp yarn density value of the textile to be tested.

9. The method for detecting the texture density of textiles according to claim 2, It is characterized in that In step S7, the method for calculating the weft density value of the textile to be tested is: (1) Select columns in different regions of the image, and record the number of peaks in each column as M, and the positions are {L 1 ,…,L i ,…,L j ,…,L M }; (2) Select two peaks i and j and calculate the average peak pixel density dis between the two peaks in each column pixel,c : (3) According to the pixel height h of the image, that is, the number of vertical pixels of the image, calculate the number of peaks in each column num peak,c : (4) Combined with prior knowledge, that is, the number of weft yarns c between every two wave peaks, calculate the number of weft yarns num in each column c : (5) Calculate the weft density D of each column based on the actual height a of the image r : (6) Calculate the mode of the weft density by calculating the weft density of all columns c With standard deviation std c , calculate the average value of the weft yarn density values ​​that meet the following conditions: mode c -std c ≤D c ≤mode c +std c (7) The average value obtained is taken as the final weft yarn density value of the textile to be tested.

10. A detection device, comprising a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the computer program is executed by the processor, the processor is caused to implement the method according to any one of claims 1 to 9.