Image Processing-Based Method for Detecting Textile Fiber Impurities
By constructing a multi-scale impurity identification mechanism and comprehensively utilizing pixel features, the problems of missed detection and misjudgment in textile fiber impurity detection have been solved, enabling comprehensive detection of textile fiber impurities and improving detection accuracy and production efficiency.
Patent Information
- Application Number
- CN202511512140.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-10-22
AI Technical Summary
Existing technologies are insufficient for effectively identifying minute impurities or structural defects in textile fiber impurity detection, leading to missed detections or misjudgments, which affect the appearance quality and performance of textiles.
By constructing a multi-scale impurity identification mechanism, and comprehensively utilizing the principal orientation angle of pixels, fiber orientation angle, long-range directional consistency, local connectivity consistency, and anomaly index, the mechanism captures local microstructures to long-range macroscopic continuity anomalies in textile images, thereby achieving comprehensive detection of fiber impurities in textiles.
It improves the accuracy and robustness of textile fiber impurity detection, reduces scrap rates, and ensures product quality stability and production efficiency.
Smart Images

Figure CN120997212B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a method for detecting impurities in textile fibers based on image processing. Background Technology
[0002] Fiber composition and quality are key factors affecting the comfort, functionality, and value of textiles. Therefore, rapid and accurate testing of textiles is crucial for production quality control. With the development of computer vision technology, image analysis for impurity detection in textiles has become a new research direction.
[0003] In related technologies, for example, Chinese patent application CN115294077A discloses a method for non-destructive testing of textile fibers. This method includes: acquiring a fabric surface image dataset and fiber category information; preprocessing; adding position encoding; constructing an automatic fiber identification model, which includes a fiber feature extraction module based on a convolutional neural network, a fiber identification module based on a multi-head attention mechanism, a linear projection module, and an output judgment module. The automatic fiber identification model is trained based on the preprocessed fabric surface image dataset and the fiber category information containing position encoding. Training is completed when the loss function of the automatic fiber identification model converges. Non-destructive testing of textile fibers is then performed based on the trained automatic fiber identification model.
[0004] However, related technologies primarily focus on macroscopic fiber composition identification and classification of textiles, i.e., determining which fibers the fabric is composed of. While these methods can achieve non-destructive composition identification, they have limitations in detecting minute impurities or structural defects generated during the textile production process. Although these impurities and defects do not change the fiber type, they can significantly affect the appearance quality and final performance of the textile. Existing technologies use deep learning models for feature extraction and classification, focusing on distinguishing the overall characteristics of different fiber types. They are not sensitive enough to subtle features such as abrupt changes in fiber orientation, structural breaks, or texture anomalies caused by impurities, easily ignoring this defect information as background noise, leading to missed or misjudged impurities. Summary of the Invention
[0005] To address the technical problem of the aforementioned technologies lacking the ability to detect minute impurities or structural defects such as cotton knots and foreign fibers, this invention provides a textile fiber impurity detection method based on image processing, comprising: preprocessing a textile image to obtain an input image, and taking any pixel in the input image as a target pixel; obtaining the principal orientation angle of the target pixel based on the eigenvector corresponding to the largest eigenvalue in the eigenvalues of the pixel structure tensor within the neighborhood of the target pixel, and obtaining the fiber orientation angle of the pixel based on the principal orientation angle; taking pixels whose fiber orientation angle difference along the fiber orientation angle of the target pixel is less than an angle threshold as moving points of the target pixel, and based on the moving points of the target pixel... The following steps are taken: First, obtain the long-range directional consistency of the target pixel. Second, based on the long-range directional consistency of the target pixel and the ratio between the number of moving points belonging to the target pixel within its neighborhood and the total number of moving points within its neighborhood, obtain the local connectivity consistency of the target pixel. Third, obtain the unit vectors corresponding to the principal orientation angles of all pixels within the neighborhood of the target pixel, and obtain the local orientation vectors based on these unit vectors. Fourth, based on the similarity between the unit vectors corresponding to the principal orientation angles of the target pixel and the local orientation vectors, and the local connectivity consistency of the target pixel, obtain the anomaly index of the target pixel. Finally, perform textile fiber impurity detection based on the anomaly index of the pixels.
[0006] This invention constructs a multi-scale impurity identification mechanism by comprehensively utilizing the principal orientation angle of pixels, fiber orientation angle, long-range directional consistency, local connectivity consistency, and anomaly index. This mechanism can capture anomalies in textile images, ranging from local microstructure to long-range macroscopic continuity, avoiding misjudgments or missed detections that may result from single-feature analysis. Through the fusion analysis of these features, this invention achieves comprehensive detection of fiber impurities in textiles, improving detection accuracy and robustness. This helps to identify and eliminate quality problems in the production process early, thereby reducing the scrap rate and ensuring the quality stability and production efficiency of textile products.
[0007] Preferably, the neighborhood range is centered on a pixel. Pixel range, where This represents the side length of the neighborhood window.
[0008] Preferably, the principal direction angle satisfies the following relationship: In the formula, For the first image in the input image The main orientation angle of each pixel and The first and second parts of the input image are respectively the first and second parts. The horizontal and vertical components of the feature vector corresponding to the maximum neighborhood feature value of each pixel. It is a two-parameter arctangent function.
[0009] Preferably, the fiber orientation angle is obtained by rotating the direction corresponding to the main orientation angle of the pixel point counterclockwise by 90 degrees as the fiber orientation angle.
[0010] This invention obtains the fiber orientation angle based on the principal orientation angle of the pixel. The fiber orientation angle can directly characterize the actual direction of the fiber, providing a more intuitive and accurate basis for subsequent long-range orientation consistency calculations. This ensures that the fiber can be tracked along its actual path when tracking fiber continuity, and improves the accuracy of identifying local structural anomalies caused by fiber structure and impurities.
[0011] Preferably, the method for obtaining the long-range directional consistency includes: taking the eight neighboring pixels of the target pixel as the points to be moved, and taking the points to be moved whose fiber direction angle difference with the target pixel is less than an angle threshold as the moving points, using a recursive method, taking the non-moving points in the eight neighboring areas of the moving points as the points to be moved, and taking the points to be moved whose fiber direction angle difference with the moving points is less than an angle threshold as the moving points, until the number of moving points no longer increases, and linearly normalizing the number of moving points of the target pixel to obtain the long-range directional consistency of the target pixel.
[0012] This invention obtains the number of moving points of target pixels recursively, thereby achieving long-range directional consistency. It effectively tracks the continuity of pixel angles along the fiber direction and captures smooth bending or sudden breaks caused by impurities over a long range. This invention can accurately assess the continuity of fiber structures, distinguishing between normal fiber orientation and local discontinuities caused by impurities. This invention effectively identifies fiber structural anomalies spanning large areas that are difficult to detect using only local analysis, thus enhancing the detection capability for various types of impurities.
[0013] Preferably, the local connectivity consistency satisfies the following relation: In the formula, For the first image in the input image Local connectivity consistency of each pixel For the first image in the input image Long-range directional consistency of individual pixels For the first image in the input image Within the neighborhood of the nth pixel, it belongs to the... The number of moving points per pixel For the first image in the input image The number of moving points within the neighborhood of a pixel.
[0014] This invention obtains local connectivity consistency by combining the ratio of long-range directional consistency of pixels to the number of moving pixels in the local neighborhood, effectively compensating for the problem that local microstructural anomalies may be ignored by single long-range directional analysis. When the long-range directional consistency is high but the local connectivity consistency is low, it can indicate that although the local area has an overall orientation, it has the characteristic of directional isolation at the microscopic level. This invention can capture such impurities that do not cause significant changes in fiber orientation more precisely, thereby improving the detection capability of various complex impurities and making the detection results more comprehensive and reliable.
[0015] Preferably, the similarity between the unit vector of the direction corresponding to the principal direction angle and the local direction vector is the cosine similarity.
[0016] Preferably, the method for obtaining the local direction vector includes: obtaining the horizontal and vertical components of the unit vector corresponding to the main direction angle of each pixel within the neighborhood of the target pixel; using the mean of the horizontal component magnitudes as the modulus and the direction of the sum of the horizontal component vectors as the direction, as the local horizontal component of the target pixel; using the mean of the vertical component magnitudes as the modulus and the direction of the sum of the vertical component vectors as the direction, as the local vertical component of the target pixel; and using the vector sum of the local horizontal component and the local vertical component as the local direction vector of the target pixel.
[0017] Preferably, the anomaly index satisfies the following relationship: In the formula, For the first image in the input image Anomaly index of each pixel, For the first image in the input image Local connectivity consistency of each pixel For the first image in the input image The unit vector corresponding to the principal orientation angle of each pixel. For the first image in the input image Local direction vectors of each pixel This is the cosine similarity function.
[0018] This invention obtains an anomaly index by fusing the cosine similarity between the principal orientation angle of a pixel and the local orientation vector with the local connectivity consistency. It also considers the anomalies of fibers in the short-range direction and the continuity of the long-range structure, so that the anomaly index can sensitively reflect the characteristics of various impurities such as macroscopic fractures and microscopic inconsistencies in textile fibers. This effectively enhances the comprehensive identification ability of different types of impurities and provides a reliable basis for accurate impurity detection.
[0019] Preferably, the step of detecting textile fiber impurities based on the abnormality index of pixels includes: combining the abnormality indices of pixels into an abnormality index map; processing the abnormality index map using the Otsu algorithm to obtain two types of pixels; identifying the type of pixels with a larger average abnormality index as impurity pixels; obtaining all connected regions in the abnormality index map through a connected component analysis algorithm; if more than half of the pixels in a certain connected region are impurity pixels, then that connected region is considered an impurity region; if the area of the impurity region exceeds an area threshold, then the textile has impurity anomalies.
[0020] The beneficial effects of this invention are as follows:
[0021] This invention effectively distinguishes normal fiber structures from structural interruptions or directional anomalies caused by impurities by accurately acquiring fiber orientation angles and evaluating long-range directional consistency and local connectivity consistency. By fusing short-range directional anomalies with long-range connectivity to form an anomaly index, it comprehensively reflects the characteristics of different types of impurities. Furthermore, through automatic threshold segmentation and connected component analysis, it achieves precise location and quantification of impurity regions. This invention, through long-range directional consistency and local connectivity consistency, enables comprehensive impurity identification from macroscopic continuity to local microscopic texture. This invention improves the accuracy of textile quality inspection, reduces errors and costs associated with manual inspection, and ensures product quality stability and production efficiency. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating the image processing-based textile fiber impurity detection method of the present invention;
[0023] Figure 2 It is a schematic diagram showing the comparison of the main direction of the textile with and without impurities;
[0024] Figure 3 This is a schematic diagram showing the comparison of fiber length direction with and without impurities. Detailed Implementation
[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0027] This invention discloses a method for detecting impurities in textile fibers based on image processing, referring to... Figure 1 This includes steps S1 to S6:
[0028] S1. Textile image acquisition and preprocessing.
[0029] It is important to note that in textile fiber impurity detection, the quality of the original image directly affects the accuracy of subsequent feature extraction and judgment. For example, image noise may mask tiny impurities, while blurred fiber structures can make it difficult to detect fine particles. Therefore, before performing feature analysis, the acquired original image needs to be preprocessed to obtain stable and clear input, providing a foundation for subsequent impurity detection.
[0030] Specifically, textiles are photographed using an industrial camera to acquire high-resolution images. These images are then converted to grayscale to obtain grayscale images. Gaussian filtering is applied to these grayscale images for smoothing. Local contrast enhancement is then performed on the filtered image to obtain the input image.
[0031] S2. Obtain the principal orientation angle of the pixel based on the eigenvector corresponding to the largest eigenvalue of the structure tensor of the pixel, and obtain the fiber orientation angle corresponding to each pixel based on the principal orientation angle of the pixel.
[0032] It should be noted that after acquiring the preprocessed image, further analysis of the structural relationships between pixels is needed to accurately detect impurities. Relying solely on single features such as brightness or contrast may misclassify normal fiber structures as impurities or miss impurities with similar gray levels to the background. Therefore, this invention obtains the principal orientation angle of a pixel based on the eigenvector corresponding to the maximum eigenvalue of the pixel's structural tensor, and then obtains the fiber orientation angle corresponding to each pixel based on the principal orientation angle.
[0033] Specifically, the Sobel operator is used to obtain the horizontal and vertical gradients of each pixel in the input image, and the structure tensor of each pixel is obtained based on the horizontal and vertical gradients of each pixel; and the feature values and corresponding feature vectors of each pixel are obtained based on the structure tensor of the pixel.
[0034] Furthermore, taking any pixel in the input image as the target pixel, and centering on the target pixel, The pixel range is the neighborhood of the target pixel. The maximum value among all pixel feature values within the neighborhood of the target pixel is taken as the maximum neighborhood feature value, and the feature vector corresponding to the maximum neighborhood feature value is obtained. The principal orientation angle of the target pixel is obtained based on the feature vector of the maximum neighborhood feature value. The angle corresponding to the direction of rotating 90 degrees counterclockwise from the principal orientation angle is taken as the fiber orientation angle. In this embodiment, the side length of the neighborhood window is... The value is 5, and the implementers can adjust it according to the actual situation. Size.
[0035] It should be noted that obtaining the structure tensor of a pixel based on its horizontal and vertical gradients, and obtaining the feature value and corresponding feature vector of each pixel based on its structure tensor, are existing techniques and will not be elaborated here.
[0036] For example, Figure 2 This diagram illustrates the comparison of the main direction of textiles with and without impurities. The red arrows represent the main direction angles, and the green arrows represent the fiber direction angles. The left side of the diagram shows the fiber direction of the textile without impurities. When the textile is free of impurities, the fiber direction is consistent, resulting in the main direction of the corresponding pixels being consistent. The right side of the diagram shows the fiber direction of the textile with impurities. When impurities are present, the fiber direction is disordered, resulting in the main direction of the corresponding pixels being inconsistent.
[0037] Specifically, the principal direction angles satisfy the following relationship:
[0038] ;
[0039] In the formula, For the first image in the input image The main orientation angle of each pixel and The first and second parts of the input image are respectively the first and second parts. The horizontal and vertical components of the feature vector corresponding to the maximum neighborhood feature value of each pixel. It is a two-parameter arctangent function.
[0040] in, For the first image in the input image The direction of the maximum grayscale change of a pixel within its neighborhood represents the vertical direction of the fiber orientation in the input image; however, the output range of the two-parameter arctangent function is... This makes subsequent calculations inconvenient, so we add... In this way, the range of values for the principal direction angle is adjusted to... .
[0041] S3. Long-range directional consistency is obtained based on the continuous step size of the pixel's movement along the fiber direction angle.
[0042] It should be noted that even when normal fibers are bent, their directional changes are smooth and continuous; however, impurities, such as neps and foreign fibers, can cause abrupt changes in direction or structural breaks. Local neighborhood analysis alone cannot capture such long-range structural anomalies. Therefore, this invention obtains long-range directional consistency based on the continuous step size of pixel movement along the fiber direction angle, thus identifying naturally bent fiber structures and potential impurities.
[0043] Specifically, the eight neighboring pixels of the target pixel are taken as the points to be moved. If the difference in fiber direction angle between any point to be moved and the target pixel is less than the angle threshold, then the point to be moved is taken as the moving point. The non-moving points among the eight neighboring pixels of the moving point are taken as the points to be moved of the moving point. If the difference in fiber direction angle between the moving point and the point to be moved is less than the angle threshold, then the point to be moved of the moving point is also set as the moving point. If no point to be moved is set as the moving point, the number of moving points is obtained, and the result of linear normalization of the number of moving points corresponding to the target pixel is the long-range direction consistency. The difference in fiber direction angle is the minimum circumferential angle difference between two fiber direction angles. The minimum circumferential angle difference is obtained by calculating the absolute value of the difference between the two angles and the result obtained by subtracting the difference from 360. The smaller of the absolute value of the difference and the result obtained by subtracting the difference from 360 is the minimum circumferential angle difference.
[0044] It should be noted that directly using the difference between two angles does not reflect the direction corresponding to the two angles. For example, the numerical difference between 5 degrees and 355 degrees is 350, but in reality, the included angle between the directions corresponding to the two angles is only 10 degrees. Therefore, the difference between fiber direction angles is measured by the minimum circumferential angle difference between the two fiber direction angles.
[0045] For example, the angle threshold is 10 degrees, and the implementer can determine the angle threshold according to the actual situation.
[0046] For example, Figure 3 This diagram illustrates the comparison of fiber long-range direction with and without impurities. The left side of the diagram shows textile fibers without impurities. When textiles are free of impurities, the fiber continuity is strong, allowing for the exploration of more distant points of movement. The right side of the diagram shows textile fibers with impurities. When textiles contain impurities, the fiber continuity is weak, allowing for the exploration of only a few points of movement.
[0047] It should be further explained that the greater the long-range directional consistency of the pixels, the better the continuity of the fiber direction angle, and the more likely the pixels belong to a continuous fiber structure; the smaller the long-range directional consistency of the pixels, the more likely there are abrupt changes in the fiber direction angle of the pixels, and the more likely the pixels are located in the impurity region of the textile fiber.
[0048] S4. Local connectivity consistency is obtained based on the long-range directional consistency of pixels and the number of moving points.
[0049] It should be noted that some types of impurities may not cause significant changes in fiber orientation angles, but they will exhibit directional isolation features within a local neighborhood of the image. For example, if a small cotton lint adheres to a normal fiber, the long-range orientation consistency of the pixels at the lint's location is high, but the lint will cause some differences in the principal orientation between pixels within a local area. To enhance the detection capability of such microstructural anomalies, this invention obtains local connectivity consistency based on the long-range orientation consistency of pixels and the number of moving points.
[0050] Specifically, obtain all moving points within the neighborhood of the target pixel, as well as the moving points within the neighborhood of the target pixel that belong to the target pixel; obtain the local connectivity consistency of the target pixel based on the number of moving points belonging to the target pixel, the number of all moving points within the neighborhood of the target pixel, and the long-range directional consistency of the target pixel.
[0051] Specifically, local connectivity consistency satisfies the following relation:
[0052] ;
[0053] In the formula, For the first image in the input image Local connectivity consistency of each pixel For the first image in the input image Long-range directional consistency of individual pixels For the first image in the input image Within the neighborhood of the nth pixel, it belongs to the... The number of moving points per pixel For the first image in the input image The number of moving points within the neighborhood of a pixel.
[0054] in, The larger the number, the more likely it is to be the first. The more pixels a pixel has that are connected to each other and have the same fiber orientation angle, the greater the local connectivity consistency of that pixel. The smaller the number, the more likely it is to be the first The fewer pixels a pixel has that are connected to it and have the same fiber orientation angle, the lower its local connectivity consistency.
[0055] when When it is larger, the first The more likely a pixel is to lie on a continuous, smooth, and structurally intact fiber, the more pixels with the same orientation exist along the fiber direction over a relatively long distance from that point. Since this pixel belongs to a normal fiber structure, its local neighborhood pixels are also likely to have similar orientations and be interconnected, thus increasing the local connectivity consistency of the pixels. The smaller the hour, the more... The fiber structure at the location of a pixel is more likely to be interrupted, have sharp turns, or contain impurities, meaning that it is impossible to find a continuous pixel path with the same direction over a long distance from that point. This long-range discontinuity is a key feature of impurities or defects, which makes the local connectivity consistency of the pixel smaller.
[0056] It should be noted that there may be cases where there are no moving points within the neighborhood of a pixel. In this case, there are no pixels around the pixel that are connected to it with the same fiber orientation angle, and its local connectivity is 0.
[0057] S5. Obtain the anomaly index of the pixel based on the difference between the main direction angles of the pixels and the local connectivity consistency of the pixels.
[0058] It should be noted that textile fiber impurities have diverse forms, including macroscopic fiber breakage and microscopic inconsistencies in principal orientation angles. To achieve more comprehensive textile impurity detection, this invention obtains the abnormality index of pixels based on the differences between the principal orientation angles of pixels and the local connectivity consistency of pixels.
[0059] Specifically, the main direction angle of each pixel within the neighborhood of the target pixel is obtained; the horizontal and vertical components of the unit vector corresponding to the main direction angle are obtained; the mean of the magnitudes of the horizontal components and the mean of the magnitudes of the vertical components of all pixels within the neighborhood of the target pixel are obtained; and the vector sum of the horizontal components and the vector sum of the vertical components of all pixels within the neighborhood of the target pixel are obtained. The local horizontal component of the target pixel is a vector with the mean of the magnitudes of the horizontal components as its modulus and the direction of the vector sum of the horizontal components as its direction. The local vertical component of the target pixel is a vector with the mean of the magnitudes of the vertical components as its modulus and the direction of the vector sum of the vertical components as its direction. The local direction vector of the target pixel is the vector sum of the local horizontal and local vertical components.
[0060] Furthermore, the cosine similarity between the unit vector and the local direction vector of each pixel in the neighborhood of the target pixel is obtained, and the anomaly index of the target pixel is obtained based on the similarity and the local connectivity consistency of the target pixel.
[0061] Specifically, the anomaly index satisfies the following relationship:
[0062] ;
[0063] In the formula, For the first image in the input image Anomaly index of each pixel, For the first image in the input image Local connectivity consistency of each pixel For the first image in the input image The unit vector corresponding to the principal orientation angle of each pixel. For the first image in the input image Local direction vectors of each pixel This is the cosine similarity function.
[0064] in, For the first image in the input image Short-range orientation anomalies of individual pixels The smaller the number, the more likely it is to be the first The greater the difference in mainstream direction between a pixel and its neighboring pixels, the more likely that pixel is to correspond to an impurity in the textile. The greater the short-range orientation anomaly of the first pixel, the greater the... The larger the anomaly index of a pixel, the greater the anomaly index; The larger the number, the more likely it is to be the first. The smaller the difference in mainstream direction between a pixel and the pixels in its neighborhood window, the more likely that pixel corresponds to a fiber in the textile. The smaller the short-range orientation anomaly of the nth pixel, the better. The smaller the anomaly index of each pixel, the better. Since the cosine similarity ranges from -1 to 1, it is normalized by negative correlation by subtracting the cosine similarity from 1 and dividing by 2 for ease of calculation.
[0065] The larger the value, the more likely the pixel is to be on a continuous fiber. The smaller the anomaly index of each pixel; The smaller the value, the less likely the pixel is to be on a continuous fiber, and the more likely the pixel corresponds to an impurity in the textile. The larger the anomaly index of each pixel, the greater the anomaly index.
[0066] S6. Detect textile fiber impurities based on the abnormality index of pixels.
[0067] Specifically, the anomaly indices of all pixels in the input image are combined to form an anomaly index map. The anomaly index map is then processed using the Otsu algorithm to obtain two classes of pixels. The class of pixels with the larger average anomaly index is designated as impurity pixels. All connected regions in the anomaly index map are obtained through a connected component analysis algorithm. If more than half of the pixels in a certain connected region are impurity pixels, then that connected region is designated as an impurity region. If the area of the impurity region exceeds an area threshold, it indicates an anomaly in the production raw materials or production environment, and the machine should be stopped immediately for inspection to prevent the continued production of abnormal textiles. The area of the impurity region is defined as the number of pixels contained within it, and the area threshold is 20. The implementer can adjust the area threshold according to the actual situation.
Claims
1. A method for detecting textile fiber impurities based on image processing, characterized in that, The method comprises the following steps: Preprocessing a textile image to obtain an input image, and taking any pixel point in the input image as a target pixel point; The principal orientation angle of the target pixel is obtained by using the eigenvector corresponding to the largest eigenvalue among the eigenvalues of the pixel structure tensor within the neighborhood of the target pixel, including: In the formula, For the first image in the input image The main orientation angle of each pixel and The first and second parts of the input image are respectively the first and second parts. The horizontal and vertical components of the feature vector corresponding to the maximum neighborhood feature value of each pixel. It is a two-parameter arctangent function. The fiber orientation angle of the pixel is obtained from the principal orientation angle: the angle corresponding to the direction obtained by rotating the direction corresponding to the principal orientation angle of the pixel counterclockwise by 90 degrees is taken as the fiber orientation angle. The target pixel is selected as its moving point by using pixels whose fiber direction angle difference with the target pixel is less than an angle threshold, obtained by searching along its fiber direction angle. The long-range directional consistency of the target pixel is obtained based on the number of moving points, including: using the target pixel's eight neighboring pixels as moving points, and using moving points whose fiber direction angle difference with the target pixel is less than an angle threshold as moving points, a recursive approach is used, using non-moving points in the eight neighboring regions of the moving point as moving points, and moving points whose fiber direction angle difference with the moving point is less than an angle threshold as moving points, until the number of moving points no longer increases. The number of moving points of the target pixel is then linearly normalized to obtain the long-range directional consistency of the target pixel. Based on the long-range directional consistency of the target pixel and the ratio between the number of moving points belonging to the target pixel itself within its neighborhood and the total number of moving points within its neighborhood, the local connectivity consistency of the target pixel is obtained, including: In the formula, For the first image in the input image Local connectivity consistency of each pixel For the first image in the input image Long-range directional consistency of individual pixels For the first image in the input image Within the neighborhood of the nth pixel, it belongs to the... The number of moving points per pixel For the first image in the input image The number of moving points within the neighborhood of a pixel; Obtain the unit vectors corresponding to the principal orientation angles of all pixels within the neighborhood of the target pixel, and obtain local direction vectors based on the unit vectors, including: obtaining the horizontal and vertical components of the unit vectors corresponding to the principal orientation angles of each pixel within the neighborhood of the target pixel; using the mean of the horizontal component magnitudes as the modulus and the direction of the sum of the horizontal component vectors as the direction, as the local horizontal component of the target pixel; using the mean of the vertical component magnitudes as the modulus and the direction of the sum of the vertical component vectors as the direction, as the local vertical component of the target pixel; using the vector sum of the local horizontal and vertical components as the local direction vector of the target pixel; obtaining the anomaly index of the target pixel based on the similarity between the unit vectors corresponding to the principal orientation angles of the target pixel and the local direction vectors, and the local connectivity consistency of the target pixel, including: In the formula, For the first image in the input image Anomaly index of each pixel, For the first image in the input image The unit vector corresponding to the principal orientation angle of each pixel. For the first image in the input image Local direction vectors of each pixel The cosine similarity function; Textile fiber impurity detection is performed according to the abnormal index of the pixel point.
2. The image processing based textile fabric impurity detection method as claimed in claim 1 wherein, The neighborhood range is centered on a pixel A pixel range, wherein is the side length of the neighborhood window.
3. The image processing based textile fabric impurity detection method as claimed in claim 1 wherein, The similarity between the unit vector corresponding to the direction of the main direction angle and the local direction vector is a cosine similarity.
4. The image processing based textile fabric impurity detection method as claimed in claim 1 wherein, The textile fiber impurity detection according to the abnormal index of the pixel point comprises the following steps: The abnormal indexes of the pixel points are combined into an abnormal index graph, the abnormal index graph is processed using an Otsu algorithm, two types of pixel points are obtained, the type of pixel points with a larger average abnormal index is taken as impurity pixel points, all connected regions in the abnormal index graph are obtained through a connected region analysis algorithm, if more than half of the pixel points in a connected region are impurity pixel points, the connected region is taken as an impurity region, and if the area of the impurity region exceeds an area threshold, the textile has an impurity abnormality.
Citation Information
Patent Citations
Textile fiber nondestructive testing method and device and storage medium
CN115294077A
Fabric flaw detection method based on independent classification feature extraction
CN113920112A
Textile wear defect detection method based on image processing
CN114842007A