Textile surface wrinkle detection method and system based on machine vision

By performing grayscale equalization and variance calculation on the surface images of textiles, combined with threshold segmentation method and histogram analysis, high-precision detection of textile surface folds is achieved, and the problems of low detection accuracy and false texture influence in the prior art are solved.

CN120013918AInactive Publication Date: 2025-05-16GUANGDONG YITONG NEW MATERIAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510133454.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-05-16
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art has low detection accuracy in textile surface wrinkles detection and is easily affected by texture patterns. The threshold setting relies on human subjective observation, which has differences, affecting the accuracy of the detection results.

Method used

Using machine vision-based detection method, the grayscale equalization of textile surface images is enhanced to enhance edge features and obtain clear grayscale images. Then, through the variance calculation and threshold segmentation method, suspected fold pixel points are filtered out, and the probability of each pixel point is calculated based on the connection domain and histogram, the impact of the false texture is reduced, and the degree of fold is finally calculated.

Benefits of technology

It improves the accuracy of textile surface wrinkle detection, reduces the influence of false textures, is suitable for cloth types with different texture patterns, and improves the timeliness and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013918A_ABST
    Figure CN120013918A_ABST
Patent Text Reader

Abstract

The invention discloses a textile surface wrinkle detection method and system based on machine vision, and relates to the technical field of textile industry, and the method comprises the following steps: S1, collecting a textile surface image, and carrying out graying processing and gray level equalization processing on the collected textile surface image to obtain a first gray level image; s2, performing variance calculation on gray values of each pixel point in the first gray image and all pixel points in a gray detection window which takes the pixel point as a center and has a size of # imgabs0 #, and marking the pixel points of which the variances are greater than a preset variance threshold value as suspected wrinkle pixel points; s3, processing the first grayscale image through a threshold segmentation method; according to the method, the gray level equalization processing is carried out on the gray level image on the surface of the textile, the edge features are enhanced, the influence of false textures is eliminated, the detection precision of the wrinkles on the surface of the textile is improved, the time for calculating the wrinkle degree is shortened, suspected wrinkle pixel points needing to be detected are reduced, and the timeliness of wrinkle detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of textile industry, and more specifically, to a method and system for detecting textile surface wrinkles based on machine vision. Background Art

[0002] In the field of textile industry, cloth often has uneven wrinkles due to various factors in the production process, which will seriously affect the quality of the product. Therefore, wrinkle detection on the surface of textiles and timely sorting and processing of semi-finished products with wrinkles are an important part of textile production. The detection of textile wrinkle texture currently mainly relies on traditional image processing technology, which is detected by setting a specific threshold.

[0003] For example, using the grayscale threshold method, a threshold is set, and the pixels whose grayscale values ​​meet the threshold are extracted from the textile image to determine whether there are wrinkles. According to the high and low grayscale differences usually present in the wrinkle area, the wrinkle pixels are extracted; then the histogram method is used to perform statistical analysis on the extracted pixels, and the high and low grayscale histograms of the wrinkle texture part are filtered; then the filtered pixels are compared with the pixels of the normal part of the fabric to obtain the distribution of wrinkles.

[0004] The Laplace operator is used to enhance the wrinkle effect on the fabric surface, and the median filter is used to filter out noise to improve the accuracy of wrinkle detection results. The enhanced image is segmented by threshold to obtain a binary image, the minimum bounding rectangle of the wrinkle area is obtained according to the binary image, and the wrinkle area is calculated according to the minimum bounding rectangle; the mean grayscale value of the wrinkle area is compared with the mean grayscale value of the normal area of ​​the fabric to obtain the degree of wrinkles.

[0005] However, due to the influence of texture patterns, some false textures will be mixed into the detection results of cloth wrinkles, resulting in low detection accuracy. At the same time, the grayscale threshold cannot be uniformly applied to cloth types with different texture patterns. The setting of the threshold depends on human subjective observation, which has a large difference and affects the accuracy of the detection results. In view of this, we propose a textile surface wrinkle detection method and system based on machine vision. Summary of the invention

[0006] The purpose of the present invention is to provide a method and system for detecting wrinkles on the surface of textiles based on machine vision. The technical problem to be solved is to improve the detection accuracy of wrinkles on the surface of textiles by eliminating the influence of false textures, and to provide a wrinkle detection method suitable for cloth types with different texture patterns.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for detecting wrinkles on the surface of textiles based on machine vision, comprising the following steps: S1: collecting a textile surface image, performing grayscale processing and grayscale equalization processing on the collected textile surface image, and obtaining a first grayscale image; S2: For each pixel in the first grayscale image and the pixel as the center and the size The grayscale values ​​of all pixels in the grayscale detection window are calculated for variance, and the pixels whose variance is greater than a preset variance threshold are recorded as suspected wrinkle pixels; S3: Processing the first grayscale image by threshold segmentation method to obtain all connected domains; S4: Obtain the number of suspected wrinkle pixels in each connected domain, and obtain a class histogram of each connected domain; S5: according to the class histogram of each connected domain, obtaining the probability that each suspected wrinkle pixel is a wrinkle pixel, and obtaining a plurality of first probabilities; S6: Obtain the minimum circumscribed rectangle of all suspected wrinkle pixel points in the first grayscale image, calculate the distance from the suspected wrinkle pixel point to the minimum circumscribed rectangle, and obtain the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle; S7: Obtaining the farthest pixel point of the minimum circumscribed rectangle of the suspected wrinkle pixel point in the textile surface image according to the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle; S8: calculating the fit of the suspected wrinkle pixel point according to the vertical distance from the suspected wrinkle pixel point to the minimum circumscribed rectangle, the distance from the farthest pixel point to the suspected wrinkle pixel point, the number of suspected wrinkle pixels in the first grayscale image, and the probability that each suspected wrinkle pixel point is a wrinkle pixel point, and obtaining a plurality of fits; S9: Obtain candidate wrinkle pixel points according to the fitting degree of each suspected wrinkle pixel point; S10: calculating the wrinkle degree of the textile surface according to the suspected wrinkle pixels and the candidate wrinkle pixels; S11: Determine the wrinkle condition of the textile surface according to whether the wrinkle degree is greater than a wrinkle threshold.

[0008] The present invention performs grayscale equalization processing on the grayscale image of the textile surface and obtains a clear first grayscale image that is independent of illumination by enhancing edge features, so that the grayscale value difference of pixels in different areas in the first grayscale image is greater, and wrinkle pixels are easier to distinguish in the first grayscale image, which is convenient for subsequent calculation of the degree of wrinkles and improves the accuracy of wrinkle detection. The probability of each suspected wrinkle pixel being a wrinkle pixel is calculated according to the connected domain and class histogram corresponding to each suspected wrinkle pixel, and suspected wrinkle pixels with a larger first probability are screened out, which reduces the time for calculating the degree of wrinkles, reduces the number of suspected wrinkle pixels that need to be detected, and improves the timeliness of wrinkle detection.

[0009] Preferably, in step S2, the variance of the grayscale value from the pixel to each pixel in the grayscale detection window and the grayscale value of all pixels in the grayscale detection window is: ; In the formula, It represents the variance between the grayscale value of each pixel in the grayscale detection window and the grayscale value of all pixels in the grayscale detection window. Indicates that the coordinates in the first grayscale image are The gray value of the pixel, Represents the number of pixels in the grayscale detection window. Indicates that the coordinates in the first grayscale image are The gray value of the pixel.

[0010] Preferably, the formula for obtaining the suspected wrinkle pixel points in step S2 is: ; In the formula, Indicates suspected wrinkle pixels. Indicates that the coordinates in the standard grayscale image are The gray value of the pixel, Indicates that the coordinates in the standard grayscale image are The gray value of the pixel, Represents the variance threshold.

[0011] Preferably, the probability of obtaining each suspected wrinkle pixel point as a wrinkle pixel point in step S5 is Calculated by the following formula , where For the The probability that a suspected wrinkle pixel is a wrinkle pixel, represents the number of all suspected wrinkle pixels in the first grayscale image, Indicates The number of wrinkle pixels in a connected domain. Indicates The number of suspected wrinkle pixels in the connected domain. Indicates the number of pixels corresponding to the gray value.

[0012] Preferably, the vertical distance from the suspected wrinkle pixel to the minimum circumscribed rectangle in step S6 is Calculated by the following formula: ; In the formula, Indicates the vertical distance between the suspected wrinkle pixel and the minimum circumscribed rectangle. Indicates The horizontal coordinate of the suspected wrinkle pixel, Indicates The vertical coordinate of the suspected wrinkle pixel, , They represent the minimum and maximum values ​​of the horizontal coordinates of the minimum bounding rectangle, respectively. , They respectively represent the minimum and maximum values ​​of the vertical coordinates of the minimum enclosing rectangle.

[0013] Preferably, the distance from the farthest pixel point of the minimum circumscribed rectangle to the suspected wrinkle pixel point in step S8 is Calculated by the following formula: ; Get the fitting degree of each suspected wrinkle pixel By formula Calculate, where For the The fitting degree of the suspected wrinkle pixels, Represents an exponential function with a natural constant as its base.

[0014] Preferably, in step S9, candidate wrinkle pixel points are obtained, and the formula for obtaining candidate wrinkle pixel points is: ; In the formula, For the There are suspected wrinkle pixels. For the The probability that a suspected wrinkle pixel is a wrinkle pixel, is the maximum value of the probability that all suspected wrinkle pixels are wrinkle pixels, For the The fitting degree of the suspected wrinkle pixels, Represents the average fitting degree of all suspected wrinkle pixels.

[0015] Preferably, the wrinkle degree of the textile surface in step S10 is The calculation is done by the formula Carry out, where is the degree of wrinkles on the textile surface. represents the number of suspected wrinkle pixels in the first grayscale image, Represents the number of candidate wrinkle pixels in the first grayscale image.

[0016] Preferably, in step S11, the wrinkle condition of the textile surface By formula To determine, Indicates the wrinkle condition of the textile surface. Indicates the wrinkle threshold, the wrinkle threshold value ; when When , the textile surface wrinkles are determined; when When the textile surface is not wrinkled, it is judged that the textile surface is not wrinkled.

[0017] A textile surface wrinkle detection system based on machine vision includes an image acquisition module, a suspected wrinkle pixel point extraction module, a connected domain extraction module, a first probability acquisition module, a vertical distance acquisition module, a farthest distance pixel point acquisition module, a fitting degree acquisition module, a candidate wrinkle pixel point acquisition module, a wrinkle degree calculation module, and a wrinkle detection module: An image acquisition module is used to acquire a textile surface image, perform grayscale processing on the acquired textile surface image to obtain a textile surface grayscale image, and perform grayscale equalization processing on the textile surface grayscale image to obtain a first grayscale image; The suspected wrinkle pixel extraction module is used to extract each pixel in the first grayscale image and the pixel with the size of The grayscale values ​​of all pixels in the grayscale detection window are calculated for variance, and the pixels whose variance is greater than a preset variance threshold are recorded as suspected wrinkle pixels; A connected domain extraction module, used for processing the first grayscale image by a threshold segmentation method to obtain all connected domains; A class histogram calculation module is used to obtain the number of suspected wrinkle pixels in each connected domain and obtain a class histogram of each connected domain; A first probability acquisition module is used to obtain the probability that each suspected wrinkle pixel is a wrinkle pixel according to the class histogram of each connected domain, and obtain a plurality of first probabilities; A vertical distance acquisition module is used to obtain the minimum circumscribed rectangle of all suspected wrinkle pixels in the first grayscale image, calculate the distance from the suspected wrinkle pixel to the minimum circumscribed rectangle, and obtain the vertical distance between the suspected wrinkle pixel and the minimum circumscribed rectangle; A farthest distance pixel point acquisition module is used to acquire the farthest distance pixel point of the minimum circumscribed rectangle of the suspected wrinkle pixel point in the textile surface image according to the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle; A fitting degree acquisition module is used to calculate the fitting degree of the suspected wrinkle pixel point according to the vertical distance from the suspected wrinkle pixel point to the minimum circumscribed rectangle, the distance from the farthest distance pixel point to the suspected wrinkle pixel point, the number of suspected wrinkle pixels in the first grayscale image, and the probability that each suspected wrinkle pixel point is a wrinkle pixel point, and obtain a number of fitting degrees; A candidate wrinkle pixel point acquisition module is used to acquire candidate wrinkle pixel points according to the fit degree of each suspected wrinkle pixel point; A wrinkle degree calculation module is used to calculate the wrinkle degree of the textile surface based on the suspected wrinkle pixel points and the candidate wrinkle pixel points; The wrinkle detection module is used to determine the wrinkle condition of the textile surface according to whether the wrinkle degree is greater than the wrinkle threshold.

[0018] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention performs grayscale equalization processing on the grayscale image of the textile surface and obtains a clear first grayscale image that is independent of illumination by enhancing edge features, so that the grayscale value difference of pixels in different areas in the first grayscale image is greater, and wrinkle pixels are easier to distinguish in the first grayscale image, which is convenient for subsequent calculation of the degree of wrinkles and improves the accuracy of wrinkle detection. The probability of each suspected wrinkle pixel being a wrinkle pixel is calculated according to the connected domain and class histogram corresponding to each suspected wrinkle pixel, and suspected wrinkle pixels with a larger first probability are screened out, which reduces the time for calculating the degree of wrinkles, reduces the number of suspected wrinkle pixels that need to be detected, and improves the timeliness of wrinkle detection.

[0019] 2. The present invention also obtains the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle, obtains the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle based on the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle and the vertical distances between other suspected wrinkle pixels and the minimum circumscribed rectangle, and judges the wrinkle texture by the degree of fitting, that is, the wrinkle texture formed by the suspected wrinkle pixel point sinking toward the center of the textile surface image. The degree of sinking can be judged by the vertical distance, so that wrinkle detection is more accurate. Under the influence of the distance between the farthest distance pixel point and the suspected wrinkle pixel point and the distance between the suspected wrinkle pixel point and the center point in the minimum circumscribed rectangle, the judgment of the farthest distance pixel point is more accurate.

[0020] 3. The present invention also obtains the degree of fit corresponding to the suspected wrinkle pixel point by comprehensively considering the distance between the suspected wrinkle pixel point and the center point in the minimum circumscribed rectangle, the distance between the farthest distance pixel point and the suspected wrinkle pixel point, and the first probability according to the vertical distance between the suspected wrinkle pixel point in the minimum circumscribed rectangle and the minimum circumscribed rectangle. The smaller the degree of fit, the more likely the suspected wrinkle pixel point is to be a wrinkle pixel point. The degree of wrinkle is calculated based on the degree of fit. The degree of wrinkle is used to judge the severity of the wrinkle texture of the textile surface image, which is convenient for subsequent detection of wrinkles on the textile surface image. There is no need to train a machine learning classification model, and the calculation process is simple, which further improves the detection timeliness and detection accuracy of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic block diagram of the system of the present invention. DETAILED DESCRIPTION

[0022] Embodiment 1: The present invention relates to a method for detecting wrinkles on a textile surface based on machine vision, comprising the following steps: S1: collecting a textile surface image, performing grayscale processing on the collected textile surface image to obtain a textile surface grayscale image, performing grayscale equalization processing on the textile surface grayscale image to obtain a first grayscale image; In an embodiment of the present invention, a grayscale image of a blank plate is collected and recorded as a standard grayscale image, and the grayscale value of the first grayscale image is normalized to a grayscale range corresponding to the standard grayscale image to obtain a first grayscale image; S2: For each pixel in the first grayscale image and the pixel as the center and the size The grayscale values ​​of all pixels in the grayscale detection window are calculated for variance, and the pixels whose variance is greater than a preset variance threshold are recorded as suspected wrinkle pixels; In an embodiment of the present invention, the variance of the grayscale value from a pixel to each pixel in the grayscale detection window and the grayscale value of all pixels in the grayscale detection window is: ; In the formula, It represents the variance between the grayscale value of each pixel in the grayscale detection window and the grayscale value of all pixels in the grayscale detection window. Indicates that the coordinates in the first grayscale image are The gray value of the pixel, represents the number of pixels in the grayscale detection window, and , Indicates that the coordinates in the first grayscale image are The gray value of the pixel; In an embodiment of the present invention, a suspected wrinkle pixel point is obtained, and the formula for obtaining the suspected wrinkle pixel point is: ; In the formula, Indicates suspected wrinkle pixels. Indicates that the coordinates in the standard grayscale image are The gray value of the pixel, Indicates that the coordinates in the standard grayscale image are The gray value of the pixel, represents the variance threshold, and the variance threshold value is 0.01; S3: Processing the first grayscale image by threshold segmentation method to obtain all connected domains; S4: Obtain the number of suspected wrinkle pixels in each connected domain, and obtain a class histogram of each connected domain; In an embodiment of the present invention, the number of suspected wrinkle pixels in each connected domain is obtained, and a class histogram of each connected domain is obtained, where the abscissa of the class histogram is the grayscale value and the ordinate is the number of pixels; S5: according to the class histogram of each connected domain, obtaining the probability that each suspected wrinkle pixel is a wrinkle pixel, and obtaining a plurality of first probabilities; In an embodiment of the present invention, obtaining the The probability that a suspected wrinkle pixel is a wrinkle pixel : , where For the The probability that a suspected wrinkle pixel is a wrinkle pixel, , represents the number of all suspected wrinkle pixels in the first grayscale image, Indicates The number of wrinkle pixels in a connected domain. Indicates The number of suspected wrinkle pixels in the connected domain. Indicates the number of pixels corresponding to the grayscale value; The present invention performs grayscale equalization processing on the grayscale image of the textile surface and obtains a clear first grayscale image that is independent of illumination by enhancing edge features, so that the grayscale value difference of pixels in different areas in the first grayscale image is greater, and wrinkle pixels are easier to distinguish in the first grayscale image, which is convenient for subsequent calculation of the degree of wrinkles and improves the accuracy of wrinkle detection. The probability of each suspected wrinkle pixel being a wrinkle pixel is calculated according to the connected domain and class histogram corresponding to each suspected wrinkle pixel, and suspected wrinkle pixels with a larger first probability are screened out, which reduces the time for calculating the degree of wrinkles, reduces the number of suspected wrinkle pixels that need to be detected, and improves the timeliness of wrinkle detection.

[0023] S6: Obtain the minimum circumscribed rectangle of all suspected wrinkle pixel points in the first grayscale image, calculate the distance from the suspected wrinkle pixel point to the minimum circumscribed rectangle, and obtain the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle; In the embodiment of the present invention, all the suspected wrinkle pixels in the first grayscale image form a minimum circumscribed rectangle, and the vertical distance of the suspected wrinkle pixels is calculated. : , where Indicates the vertical distance between the suspected wrinkle pixel and the minimum circumscribed rectangle. Indicates The horizontal coordinate of the suspected wrinkle pixel, Indicates The vertical coordinate of the suspected wrinkle pixel, , They represent the minimum and maximum values ​​of the horizontal coordinates of the minimum bounding rectangle, respectively. , Respectively represent the minimum and maximum values ​​of the ordinate of the minimum circumscribed rectangle; S7: Obtaining the farthest pixel point of the minimum circumscribed rectangle of the suspected wrinkle pixel point in the textile surface image according to the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle; In an embodiment of the present invention, the farthest pixel point of the minimum circumscribed rectangle corresponding to each suspected wrinkle pixel point is obtained, and the farthest pixel point is the pixel point with the largest distance from the suspected wrinkle pixel point to the minimum circumscribed rectangle; The present invention also obtains the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle, obtains the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle based on the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle and the vertical distances between other suspected wrinkle pixel points and the minimum circumscribed rectangle, and judges the wrinkle texture by the degree of fitting, that is, the wrinkle texture formed by the suspected wrinkle pixel point being sunken toward the center of the textile surface image. The degree of sunkenness can be judged by the vertical distance, thereby making wrinkle detection more accurate. Under the influence of the distance between the farthest distance pixel point and the suspected wrinkle pixel point and the distance between the suspected wrinkle pixel point and the center point in the minimum circumscribed rectangle, the judgment of the farthest distance pixel point is made more accurate.

[0024] S8: calculating the fit of the suspected wrinkle pixel point according to the vertical distance from the suspected wrinkle pixel point to the minimum circumscribed rectangle, the distance from the farthest pixel point to the suspected wrinkle pixel point, the number of suspected wrinkle pixels in the first grayscale image, and the probability that each suspected wrinkle pixel point is a wrinkle pixel point, and obtaining a plurality of fits; In an embodiment of the present invention, the number of suspected wrinkle pixels in the first grayscale image is obtained, and the distance from the farthest pixel of the minimum circumscribed rectangle to the suspected wrinkle pixel is calculated. : ; In the formula, Indicates the distance from the farthest pixel of the minimum bounding rectangle to the suspected wrinkle pixel. Indicates the minimum value of the ordinate of the minimum enclosing rectangle. Indicates the maximum value of the ordinate of the minimum enclosing rectangle. Indicates the minimum value of the horizontal coordinate of the minimum enclosing rectangle. Indicates the maximum value of the horizontal coordinate of the minimum bounding rectangle; In an embodiment of the present invention, the fitting degree of each suspected wrinkle pixel is obtained. : , where For the The fitting degree of the suspected wrinkle pixels, represents the number of all suspected wrinkle pixels in the first grayscale image, Indicates The number of wrinkle pixels in a connected domain. Indicates The number of suspected wrinkle pixels in the connected domain. Indicates the number of pixels corresponding to the gray value. Indicates the distance from the farthest pixel of the minimum bounding rectangle to the suspected wrinkle pixel. Indicates the vertical distance between the suspected wrinkle pixel and the minimum circumscribed rectangle. For the The probability that a suspected wrinkle pixel is a wrinkle pixel, represents an exponential function with a natural constant as base; S9: Obtain candidate wrinkle pixel points according to the fitting degree of each suspected wrinkle pixel point; In an embodiment of the present invention, candidate wrinkle pixel points are obtained, and the formula for obtaining the candidate wrinkle pixel points is: ; In the formula, For the There are suspected wrinkle pixels. For the The probability that a suspected wrinkle pixel is a wrinkle pixel, is the maximum value of the probability that all suspected wrinkle pixels are wrinkle pixels, For the The fitting degree of the suspected wrinkle pixels, It represents the average fitting degree of all suspected wrinkle pixels; S10: calculating the wrinkle degree of the textile surface according to the suspected wrinkle pixels and the candidate wrinkle pixels; In an embodiment of the present invention, the wrinkle degree of the textile surface is calculated according to the number of suspected wrinkle pixels and candidate wrinkle pixels. : , where is the degree of wrinkles on the textile surface. represents the number of suspected wrinkle pixels in the first grayscale image, represents the number of candidate wrinkle pixels in the first grayscale image; S11: determining the wrinkle condition of the textile surface according to whether the wrinkle degree is greater than a wrinkle threshold; In an embodiment of the present invention, the wrinkle condition of the textile surface is determined according to whether the wrinkle degree is greater than the wrinkle threshold. : ; In the formula, Indicates the wrinkle condition of the textile surface. Indicates the wrinkle threshold, the wrinkle threshold value ; when When , the textile surface wrinkles are determined; when When the textile surface is not wrinkled, it is judged that the textile surface is not wrinkled.

[0025] The present invention also obtains the degree of fit corresponding to the suspected wrinkle pixel point by comprehensively considering the distance between the suspected wrinkle pixel point and the center point in the minimum circumscribed rectangle, the distance between the farthest distance pixel point and the suspected wrinkle pixel point, and the first probability according to the vertical distance between the suspected wrinkle pixel point in the minimum circumscribed rectangle and the minimum circumscribed rectangle. The smaller the degree of fit, the more likely the suspected wrinkle pixel point is to be a wrinkle pixel point. The degree of wrinkle is calculated based on the degree of fit. The degree of wrinkle is used to judge the severity of the wrinkle texture of the textile surface image, which facilitates the subsequent detection of wrinkles in the textile surface image. There is no need to train a machine learning classification model, and the calculation process is simple, which further improves the detection timeliness and detection accuracy of the present invention.

[0026] Embodiment 2: Figure 1 As shown, a textile surface wrinkle detection system based on machine vision includes an image acquisition module, a suspected wrinkle pixel point extraction module, a connected domain extraction module, a first probability acquisition module, a vertical distance acquisition module, a farthest distance pixel point acquisition module, a fitting degree acquisition module, a candidate wrinkle pixel point acquisition module, a wrinkle degree calculation module, and a wrinkle detection module: An image acquisition module is used to acquire a textile surface image, perform grayscale processing on the acquired textile surface image to obtain a textile surface grayscale image, and perform grayscale equalization processing on the textile surface grayscale image to obtain a first grayscale image; The suspected wrinkle pixel extraction module is used to extract each pixel in the first grayscale image and the pixel with the size of The grayscale values ​​of all pixels in the grayscale detection window are calculated for variance, and the pixels whose variance is greater than a preset variance threshold are recorded as suspected wrinkle pixels; A connected domain extraction module, used for processing the first grayscale image by a threshold segmentation method to obtain all connected domains; A class histogram calculation module is used to obtain the number of suspected wrinkle pixels in each connected domain and obtain a class histogram of each connected domain; A first probability acquisition module is used to obtain the probability that each suspected wrinkle pixel is a wrinkle pixel according to the class histogram of each connected domain, and obtain a plurality of first probabilities; A vertical distance acquisition module is used to obtain the minimum circumscribed rectangle of all suspected wrinkle pixels in the first grayscale image, calculate the distance from the suspected wrinkle pixel to the minimum circumscribed rectangle, and obtain the vertical distance between the suspected wrinkle pixel and the minimum circumscribed rectangle; A farthest distance pixel point acquisition module is used to acquire the farthest distance pixel point of the minimum circumscribed rectangle of the suspected wrinkle pixel point in the textile surface image according to the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle; A fitting degree acquisition module is used to calculate the fitting degree of the suspected wrinkle pixel point according to the vertical distance from the suspected wrinkle pixel point to the minimum circumscribed rectangle, the distance from the farthest distance pixel point to the suspected wrinkle pixel point, the number of suspected wrinkle pixels in the first grayscale image, and the probability that each suspected wrinkle pixel point is a wrinkle pixel point, and obtain a number of fitting degrees; A candidate wrinkle pixel point acquisition module is used to acquire candidate wrinkle pixel points according to the fit degree of each suspected wrinkle pixel point; A wrinkle degree calculation module is used to calculate the wrinkle degree of the textile surface based on the suspected wrinkle pixel points and the candidate wrinkle pixel points; The wrinkle detection module is used to determine the wrinkle condition of the textile surface according to whether the wrinkle degree is greater than the wrinkle threshold.

[0027] The embodiments of the present invention disclose preferred embodiments, but are not limited thereto. A person skilled in the art can easily understand the spirit of the present invention based on the above embodiments and make different extensions and changes. However, as long as they do not deviate from the spirit of the present invention, they are all within the protection scope of the present invention.

Claims

1. A method for detecting wrinkles on a textile surface based on machine vision, characterized in that: The following steps are involved: S1: collecting a textile surface image, performing grayscale processing and grayscale equalization processing on the collected textile surface image, and obtaining a first grayscale image; S2: For each pixel in the first grayscale image and the pixel as the center and the size The grayscale values ​​of all pixels in the grayscale detection window are calculated for variance, and the pixels whose variance is greater than a preset variance threshold are recorded as suspected wrinkle pixels; S3: Processing the first grayscale image by threshold segmentation method to obtain all connected domains; S4: Obtain the number of suspected wrinkle pixels in each connected domain, and obtain a class histogram of each connected domain; S5: according to the class histogram of each connected domain, obtaining the probability that each suspected wrinkle pixel is a wrinkle pixel, and obtaining a plurality of first probabilities; S6: Obtain the minimum circumscribed rectangle of all suspected wrinkle pixel points in the first grayscale image, calculate the distance from the suspected wrinkle pixel point to the minimum circumscribed rectangle, and obtain the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle; S7: Obtaining the farthest pixel point of the minimum circumscribed rectangle of the suspected wrinkle pixel point in the textile surface image according to the vertical distance between the suspected wrinkle pixel point and the minimum circumscribed rectangle; S8: calculating the fit of the suspected wrinkle pixel point according to the vertical distance from the suspected wrinkle pixel point to the minimum circumscribed rectangle, the distance from the farthest pixel point to the suspected wrinkle pixel point, the number of suspected wrinkle pixels in the first grayscale image, and the probability that each suspected wrinkle pixel point is a wrinkle pixel point, and obtaining a plurality of fits; S9: Obtain candidate wrinkle pixel points according to the fitting degree of each suspected wrinkle pixel point; S10: calculating the wrinkle degree of the textile surface according to the suspected wrinkle pixels and the candidate wrinkle pixels; S11: Determine the wrinkle condition of the textile surface according to whether the wrinkle degree is greater than a wrinkle threshold.

2. The method for detecting textile surface wrinkles based on machine vision according to claim 1, characterized in that: The variance of the grayscale value from the pixel to each pixel in the grayscale detection window and the grayscale value of all pixels in the grayscale detection window in step S2 is: ; In the formula, It represents the variance between the grayscale value of each pixel in the grayscale detection window and the grayscale value of all pixels in the grayscale detection window. Indicates that the coordinates in the first grayscale image are The gray value of the pixel, Represents the number of pixels in the grayscale detection window. Indicates that the coordinates in the first grayscale image are The gray value of the pixel.

3. The method for detecting textile surface wrinkles based on machine vision according to claim 2, characterized in that: The formula for obtaining the suspected wrinkle pixel points in step S2 is: ; In the formula, Indicates suspected wrinkle pixels. Indicates that the coordinates in the standard grayscale image are The gray value of the pixel, Indicates that the coordinates in the standard grayscale image are The gray value of the pixel, Represents the variance threshold.

4. The method for detecting textile surface wrinkles based on machine vision according to claim 1, characterized in that: In step S5, the probability of obtaining each suspected wrinkle pixel point as a wrinkle pixel point By formula Calculate, where For the The probability that a suspected wrinkle pixel is a wrinkle pixel, represents the number of all suspected wrinkle pixels in the first grayscale image, Indicates The number of wrinkle pixels in a connected domain. Indicates The number of suspected wrinkle pixels in the connected domain. Indicates the number of pixels corresponding to the grayscale value.

5. The method for detecting textile surface wrinkles based on machine vision according to claim 1, characterized in that: The vertical distance from the suspected wrinkle pixel to the minimum circumscribed rectangle in step S6 Calculated by the following formula: ; In the formula, Indicates the vertical distance between the suspected wrinkle pixel and the minimum circumscribed rectangle. Indicates The horizontal coordinate of the suspected wrinkle pixel, Indicates The vertical coordinate of the suspected wrinkle pixel, , They represent the minimum and maximum values ​​of the horizontal coordinates of the minimum bounding rectangle, respectively. , They respectively represent the minimum and maximum values ​​of the vertical coordinates of the minimum enclosing rectangle.

6. The method for detecting textile surface wrinkles based on machine vision according to claim 1, characterized in that: The distance from the farthest pixel point of the minimum circumscribed rectangle to the suspected wrinkle pixel point in step S8 Calculated by the following formula: ; Get the fitting degree of each suspected wrinkle pixel By formula Calculate, where For the The fitting degree of the suspected wrinkle pixels, Represents an exponential function with a natural constant as its base.

7. The method for detecting textile surface wrinkles based on machine vision according to claim 1, characterized in that: In step S9, candidate wrinkle pixel points are obtained, and the formula for obtaining candidate wrinkle pixel points is: ; In the formula, For the There are suspected wrinkle pixels. For the The probability that a suspected wrinkle pixel is a wrinkle pixel, is the maximum value of the probability that all suspected wrinkle pixels are wrinkle pixels, For the The fitting degree of the suspected wrinkle pixels, Represents the average fitting degree of all suspected wrinkle pixels.

8. The method for detecting textile surface wrinkles based on machine vision according to claim 1, characterized in that: The wrinkle degree of the textile surface in step S10 The calculation is done by the formula Carry out, where is the degree of wrinkles on the textile surface. represents the number of suspected wrinkle pixels in the first grayscale image, Represents the number of candidate wrinkle pixels in the first grayscale image.

9. The method for detecting textile surface wrinkles based on machine vision according to claim 1, characterized in that: The wrinkle condition of the textile surface in step S11 By formula To determine, Indicates the wrinkle condition of the textile surface. Indicates the wrinkle threshold, the wrinkle threshold value ; when When , the textile surface wrinkles are determined; when When the textile surface is not wrinkled, it is judged that the textile surface is not wrinkled.

10. A textile surface wrinkle detection system based on machine vision, using a textile surface wrinkle detection method based on machine vision according to any one of claims 1 to 9, characterized in that: include: An image acquisition module is used to acquire a textile surface image, perform grayscale processing and grayscale equalization processing, and obtain a first grayscale image; The suspected wrinkle pixel extraction module is used to extract each pixel in the first grayscale image and the pixel with the size of The grayscale values ​​of all pixels in the grayscale detection window are calculated for variance, and the pixels whose variance is greater than a preset variance threshold are recorded as suspected wrinkle pixels; A connected domain extraction module, used for processing the first grayscale image by a threshold segmentation method to obtain all connected domains; A class histogram calculation module is used to obtain the number of suspected wrinkle pixels in each connected domain and obtain a class histogram of each connected domain; A first probability acquisition module is used to obtain the probability that each suspected wrinkle pixel is a wrinkle pixel according to the class histogram of each connected domain, and obtain a plurality of first probabilities; A vertical distance acquisition module, used to acquire the minimum circumscribed rectangle of all suspected wrinkle pixel points in the first grayscale image, and acquire the vertical distance between the suspected wrinkle pixel points and the minimum circumscribed rectangle; A farthest distance pixel point acquisition module is used to acquire the farthest distance pixel point of the minimum circumscribed rectangle of the suspected wrinkle pixel point according to the vertical distance; A fitting degree acquisition module is used to calculate the fitting degree of the suspected wrinkle pixel point according to the vertical distance, the distance from the farthest pixel point to the suspected wrinkle pixel point, the number of suspected wrinkle pixels, and the probability that each suspected wrinkle pixel point is a wrinkle pixel point, and obtain several fitting degrees; A candidate wrinkle pixel point acquisition module is used to acquire candidate wrinkle pixel points according to the fit degree of each suspected wrinkle pixel point; A wrinkle degree calculation module is used to calculate the wrinkle degree of the textile surface based on the suspected wrinkle pixel points and the candidate wrinkle pixel points; The wrinkle detection module is used to determine the wrinkle condition of the textile surface according to whether the wrinkle degree is greater than the wrinkle threshold.