Method and system for real-time detection and self-adaptive deviation correction of fabric defects of air jet loom
By acquiring fabric image sequences in real time, calculating grayscale differences and region clustering, constructing heterogeneous vector fields for multi-scale decomposition, and generating correction control commands, the problems of false detection and inaccurate correction control in fabric defect detection of air-jet looms are solved, and efficient fabric defect detection and adaptive correction are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU WANJIAHUI INTELLIGENT EQUIP TECH CO LTD
- Filing Date
- 2026-02-04
- Publication Date
- 2026-05-15
AI Technical Summary
Existing defect detection methods for air-jet looms are susceptible to interference from changes in fabric texture and lighting, resulting in a high false detection rate. They also lack multi-scale decomposition and feature fusion capabilities, and their accuracy and real-time performance in corrective control are insufficient.
By acquiring fabric image sequences in real time, calculating grayscale differences to mark abnormal pixels, performing regional clustering analysis, constructing heterogeneous vector fields for multi-scale decomposition, extracting divergence distribution maps, and combining time-series data analysis to generate correction control commands.
It improves the accuracy and anti-interference ability of defect detection, accurately extracts local deformation features of fabric, accurately locates the source of deviation, and enhances the accuracy and speed of motion trend prediction and correction control.
Smart Images

Figure CN122048899A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of defect detection technology, specifically to a method and system for real-time detection and adaptive correction of defects in fabrics produced by air-jet looms. Background Technology
[0002] Existing image processing methods mainly employ pixel-level grayscale analysis for defect identification. However, because they only compare the grayscale differences of individual pixels, they are easily affected by fabric texture and lighting variations, leading to a high false detection rate. Although some studies have introduced region clustering analysis, they lack a systematic description and matching mechanism for defect features.
[0003] In fabric motion analysis, traditional methods mainly rely on edge detection to determine fabric position, neglecting the impact of defects on overall fabric deformation. While existing vector field analysis techniques can characterize local deformation, they lack multi-scale decomposition and feature fusion capabilities, making it difficult to accurately locate offset sources. Furthermore, existing systems, when processing continuous image sequences, often only focus on instantaneous states, failing to establish effective temporal analysis models to predict fabric motion trends.
[0004] Furthermore, in current intelligent fabric manufacturing systems, the conversion process between defect detection results and correction control commands is relatively simple, lacking comprehensive analysis of defect compensation parameters and offset evolution characteristics, resulting in insufficient accuracy and real-time performance of correction control. These technical issues severely restrict the automation level of the weaving process and the improvement of product quality. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for real-time detection and adaptive correction of fabric defects on air-jet looms, aiming to solve at least one of the technical problems existing in the prior art.
[0006] The technical solution of this invention is: a method for real-time detection and adaptive correction of fabric defects on air-jet looms, comprising the following steps: Real-time acquisition of fabric image sequences during the weaving process of an air-jet loom, obtaining fabric image data stream, calculating the grayscale difference between each pixel and its adjacent pixels in the fabric image data stream, and marking pixels with grayscale differences exceeding the judgment threshold as abnormal pixels; Defect regions are obtained by performing region clustering analysis based on abnormal pixels. Feature parameters of the defect regions are extracted and matched with preset defect feature templates to determine defect compensation parameters. A heterogeneous vector field is constructed based on abnormal pixels. The heterogeneous vector field is decomposed into multiple scales and superimposed according to weights to obtain a cascaded divergence distribution map. The offset source coordinates are obtained by extracting the divergence peak position from the cascaded divergence distribution map, the pixel coordinates of the gray-level abrupt change position are extracted from the fabric image data stream and fitted into the fabric boundary curve, and the geometric midline of the fabric boundary curve is calculated to obtain the fabric baseline. The current fabric offset is obtained by calculating the vertical distance between the offset source coordinates and the fabric baseline. The current fabric offset and the timestamp are used to construct a time series data pair and perform multi-order difference analysis to obtain the offset evolution characteristic parameters. The defect compensation parameters and offset evolution parameters are combined to calculate the predicted offset, and real-time correction control commands are generated based on the predicted offset.
[0007] Real-time acquisition of fabric image sequences during the weaving process of an air-jet loom yields a fabric image data stream. The grayscale difference between each pixel and its adjacent pixels is calculated, and pixels with grayscale differences exceeding a threshold are marked as abnormal pixels, including: Multiple image acquisition points are set along the width direction of the fabric during the weaving process of the air jet loom. Each acquisition point synchronously acquires images of the fabric surface, and the sampling period is adjusted according to the fabric conveying speed. The fabric images acquired in real time by multiple acquisition points are organized into a fabric image sequence according to their spatial positions to obtain a fabric image data stream. Multi-scale grayscale conversion is performed on the fabric image data stream to obtain a layered pixel grayscale matrix. The grayscale difference between each pixel and its neighboring pixels at different scales is calculated using the layered pixel grayscale matrix. An adaptive judgment threshold is constructed by calculating the gray distribution parameters of multiple local regions based on the layered pixel gray matrix. The gray difference of each pixel at different scales is compared with the adaptive judgment threshold, and the pixels with gray difference exceeding the judgment threshold are marked as abnormal pixels.
[0008] Defect regions are obtained by performing region clustering analysis on abnormal pixels. Feature parameters of the defect regions are extracted and matched with preset defect feature templates to determine defect compensation parameters, including: A spatial distribution map is constructed based on the location of abnormal pixels, and spatially adjacent abnormal pixels are combined into an initial defect block based on the spatial distribution map. Calculate the distribution density of abnormal pixels in the initial defect block, and merge adjacent initial defect blocks whose distribution density meets the preset merging threshold to form a defect region; The edge contour of the defect region is extracted to obtain the boundary curve, and the shape features of the defect region are calculated based on the boundary curve. The grayscale distribution features are obtained by analyzing the pixel grayscale changes within the defect area. The shape features and grayscale distribution features are combined to form a defect feature description. The defect feature description is matched and calculated with a preset defect feature template to obtain the defect type identification result. Based on the defect type identification results and the spatial distribution characteristics of the defect area in the fabric, the compensation direction and compensation amount are calculated to generate defect compensation parameters.
[0009] A heterogeneous vector field is constructed based on abnormal pixels. The heterogeneous vector field is then decomposed into multiple scales and weighted to obtain a cascaded divergence distribution map, including: The grayscale change is obtained by calculating the difference between the grayscale value of the abnormal pixel and the grayscale value of the adjacent pixel; the position change is obtained by calculating the difference between the spatial coordinates of the abnormal pixel and the spatial coordinates of the adjacent pixel. The grayscale change and the position change are combined to construct the vector features of the abnormal pixels, and a heterogeneous vector field is constructed based on the vector features of the abnormal pixels. The heterogeneous vector field is decomposed into multiple scale components by multi-scale decomposition. The spatial change rate of the vector features of abnormal pixels in each scale component is calculated to obtain the gradient distribution. The divergence distribution of each scale component is calculated based on the gradient distribution. The scale component weights are calculated based on the vector features of abnormal pixels in each scale component. The divergence distributions of each scale component are then weighted and superimposed based on the scale component weights to obtain a cascaded divergence distribution map.
[0010] The offset source coordinates are obtained by extracting the divergence peak position from the cascaded divergence distribution map, and the pixel coordinates of the gray-level abrupt change positions are extracted from the fabric image data stream and fitted to the fabric boundary curve. The geometric midline of the fabric boundary curve is calculated to obtain the fabric baseline, including: The distribution of divergence values in the cascaded divergence distribution map is calculated to obtain a numerical distribution matrix. The trend of divergence values is analyzed based on the numerical distribution matrix to obtain a change curve. The locations of maximum divergence values are extracted from the change curve to obtain a set of peak locations. The spatial distance between each location in the set of peak locations is calculated to obtain a distance matrix. The set of peak locations is then clustered based on the distance matrix to obtain the offset source coordinates. The grayscale change value is obtained by calculating the grayscale change of adjacent pixels in the fabric image data stream. The pixel coordinates of the grayscale change position are extracted from the grayscale change value to obtain the edge point set. Curve fitting is performed on the edge point set to obtain the fabric boundary curve. The fabric boundary curve is sampled at equal intervals to obtain a set of sampling points. The midpoint coordinates of the corresponding points in the sampling point set are calculated to obtain a midpoint sequence. The midpoint sequence is then fitted with a curve to obtain the fabric baseline.
[0011] The current fabric offset is obtained by calculating the vertical distance between the offset source coordinates and the fabric baseline. The current fabric offset and timestamp are then used to construct a time-series data pair, and multi-order difference analysis is performed to obtain the offset evolution characteristic parameters, including: Calculate the vertical direction from the offset source coordinates to the fabric baseline, and project the vertical projection point from the offset source coordinates to the fabric baseline along the vertical direction. The displacement value is obtained by calculating the spatial distance between the offset source coordinates and the vertical projection point; The offset indicator is obtained by analyzing the offset direction of the offset source coordinates relative to the fabric baseline. The current offset of the fabric is obtained by calibrating the direction of the displacement value according to the offset indicator. Record the timestamp corresponding to the current offset of the fabric, combine the current offset of the fabric with the timestamp to generate a time series data pair, and sort the continuously recorded time series data pairs according to time to obtain a time series data sequence; Construct a difference matrix to store the time series data sequence, calculate the change in the current fabric offset of adjacent time series data pairs in the time series data sequence to obtain the initial difference value, fill the initial difference value into the difference matrix to obtain the difference calculation sequence, calculate the change in adjacent difference values in the difference calculation sequence to obtain the new difference value, repeat the iteration until the change in difference value is less than the preset change value, and construct multi-order difference data from the difference values. The displacement change is obtained by calculating the change amplitude of adjacent difference values in multi-order difference data. Based on the displacement change, the acceleration trend of fabric motion is calculated and converted into offset evolution characteristic parameters.
[0012] The defect compensation parameters and offset evolution parameters are combined to calculate the predicted offset, and real-time correction control commands are generated based on the predicted offset, including: The compensation impact value is obtained by analyzing the numerical changes of the defect compensation parameters, and the evolution impact value is obtained by analyzing the numerical changes of the offset evolution parameters. The influence weight is obtained by calculating the ratio of the compensation influence value to the evolution influence value. The defect compensation parameter and the offset evolution parameter are weighted and combined according to the influence weight to obtain the combined prediction value. The change law of the combined prediction value is analyzed to obtain the predicted offset. Extracting the numerical range of the predicted offset yields the offset amplitude interval, and extracting the changing trend of the predicted offset yields the offset development direction. The offset amplitude range is mapped to the correction force, the offset development direction is mapped to the correction direction, and a correction compensation command is generated based on the correction force and the correction direction. Based on the variation characteristics of the predicted offset, the correction compensation command is decomposed into a segmented execution sequence, and the segmented execution sequence is converted into a real-time correction control command.
[0013] This invention provides a real-time defect detection and adaptive correction system for air-jet loom fabrics, the system comprising: The image acquisition module is used to acquire fabric image sequences in real time during the weaving process of the air-jet loom, and obtain fabric image data stream; The anomaly detection module is used to calculate the grayscale difference between each pixel and its neighboring pixels in the fabric image data stream, and to mark pixels whose grayscale difference exceeds the judgment threshold as abnormal pixels. The defect analysis module is used to perform regional clustering analysis based on abnormal pixels to obtain defect regions, extract feature parameters of the defect regions and match them with preset defect feature templates to determine defect compensation parameters. The vector field construction module is used to construct heterogeneous vector fields based on abnormal pixels, perform multi-scale decomposition on the heterogeneous vector fields, and superimpose them according to weights to obtain a cascaded divergence distribution map. The coordinate positioning module is used to extract the peak position of divergence from the cascaded divergence distribution map to obtain the offset source coordinates, extract the pixel coordinates of the gray-level change position from the fabric image data stream and fit them into the fabric boundary curve, and calculate the geometric center line of the fabric boundary curve to obtain the fabric baseline. The offset analysis module is used to calculate the vertical distance between the offset source coordinates and the fabric baseline to obtain the current offset of the fabric. The current offset of the fabric and the timestamp are used to construct a time series data pair and perform multi-order difference analysis to obtain the offset evolution characteristic parameters. The correction control module is used to combine the defect compensation parameters and the offset evolution parameters to calculate the predicted offset, and generate real-time correction control commands based on the predicted offset.
[0014] One technical solution provided in this embodiment of the invention is an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in any of the aforementioned methods.
[0015] One technical solution provided in this embodiment of the invention is a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the steps in any of the aforementioned methods.
[0016] This invention improves the accuracy and anti-interference capability of defect detection by real-time calculation of pixel grayscale differences combined with region clustering analysis. The introduction of heterogeneous vector fields and multi-scale decomposition techniques enables precise extraction of local deformation features of fabrics. Through cascaded divergence distribution analysis, the coordinates of offset sources are accurately located, solving the problem that traditional edge detection methods struggle to identify the influence of internal defects. Multi-order difference analysis using time-series data significantly improves the accuracy of motion trend prediction. Based on a combined calculation method of defect compensation parameters and offset evolution parameters, optimized mapping from detection results to control commands is achieved, improving system response speed and control accuracy. This effectively solves problems such as incomplete image feature extraction, inaccurate motion prediction, and poor coordination between detection and control. Attached Figure Description
[0017] Figure 1 A flowchart of a method for real-time detection and adaptive correction of fabric defects on an air-jet loom provided in an embodiment of the present invention; Figure 2 This is a flowchart of the predictive correction control based on defect compensation and offset evolution in an embodiment of the present invention. Detailed Implementation
[0018] like Figure 1 As shown, Figure 1 This is a flowchart of a method for real-time detection and adaptive correction of fabric defects on an air-jet loom provided in an embodiment of the present invention. The method includes the following steps: Real-time acquisition of fabric image sequences during the weaving process of an air-jet loom, obtaining fabric image data stream, calculating the grayscale difference between each pixel and its adjacent pixels in the fabric image data stream, and marking pixels with grayscale differences exceeding the judgment threshold as abnormal pixels; Defect regions are obtained by performing region clustering analysis based on abnormal pixels. Feature parameters of the defect regions are extracted and matched with preset defect feature templates to determine defect compensation parameters. A heterogeneous vector field is constructed based on abnormal pixels. The heterogeneous vector field is decomposed into multiple scales and superimposed according to weights to obtain a cascaded divergence distribution map. The offset source coordinates are obtained by extracting the divergence peak position from the cascaded divergence distribution map, the pixel coordinates of the gray-level abrupt change position are extracted from the fabric image data stream and fitted into the fabric boundary curve, and the geometric midline of the fabric boundary curve is calculated to obtain the fabric baseline. The current fabric offset is obtained by calculating the vertical distance between the offset source coordinates and the fabric baseline. The current fabric offset and the timestamp are used to construct a time series data pair and perform multi-order difference analysis to obtain the offset evolution characteristic parameters. The defect compensation parameters and offset evolution parameters are combined to calculate the predicted offset, and real-time correction control commands are generated based on the predicted offset.
[0019] Real-time acquisition of fabric image sequences during the weaving process of an air-jet loom yields a fabric image data stream. The grayscale difference between each pixel and its adjacent pixels is calculated, and pixels with grayscale differences exceeding a threshold are marked as abnormal pixels, including: Multiple image acquisition points are set along the width direction of the fabric during the weaving process of the air jet loom. Each acquisition point synchronously acquires images of the fabric surface, and the sampling period is adjusted according to the fabric conveying speed. The fabric images acquired in real time by multiple acquisition points are organized into a fabric image sequence according to their spatial positions to obtain a fabric image data stream. Multi-scale grayscale conversion is performed on the fabric image data stream to obtain a layered pixel grayscale matrix. The grayscale difference between each pixel and its neighboring pixels at different scales is calculated using the layered pixel grayscale matrix. An adaptive judgment threshold is constructed by calculating the gray distribution parameters of multiple local regions based on the layered pixel gray matrix. The gray difference of each pixel at different scales is compared with the adaptive judgment threshold, and the pixels with gray difference exceeding the judgment threshold are marked as abnormal pixels.
[0020] During the air-jet loom weaving process, multiple image acquisition points are set up along the width of the fabric. Each acquisition point is equipped with an industrial camera with a fixed focal length, and the camera's installation position ensures that it can clearly capture the detailed features of the fabric surface. These image acquisition points are typically arranged at 10cm intervals, covering the entire width of the fabric. The camera at each acquisition point is connected to the central processing unit, and a synchronous trigger signal ensures that all acquisition points acquire images simultaneously. The sampling period is dynamically adjusted according to the loom's conveyor speed. When the fabric conveyor speed is 50m / min, the sampling period is set to 25 frames / s to ensure the continuity and integrity of image coverage.
[0021] The acquired fabric images have a resolution of 2048×1536 pixels, with each pixel containing 256 levels of grayscale information. The fabric images are organized according to spatial location; images acquired from various points at the same time point are stitched together to form a complete wide-format image. These wide-format images from consecutive time points are then arranged chronologically to form a fabric image sequence, constituting a fabric image data stream. This fabric image data stream enters the image processing unit at a rate of 25 frames per second.
[0022] Multi-scale grayscale conversion was performed on the fabric image data stream, and image downsampling was performed using a Gaussian pyramid structure to construct a four-level image pyramid. The original image is level 0 with a resolution of 2048×1536 pixels; level 1 has a resolution of 1024×768 pixels; level 2 has a resolution of 512×384 pixels; and level 3 has a resolution of 256×192 pixels. At each level, the color image was converted to a grayscale image, resulting in a layered pixel grayscale matrix. This layered pixel grayscale matrix contains grayscale information at different scales, which helps in detecting fabric defects of different sizes.
[0023] Based on a layered pixel grayscale matrix, the grayscale difference between each pixel and its neighboring pixels at different scales is calculated. For a given pixel, the absolute values of its grayscale differences with its four adjacent pixels (upper, lower, left, and right) are calculated, and the maximum value is taken as the grayscale difference value of that pixel. In a level 0 image, the pixel grayscale difference value in normal fabric texture areas typically fluctuates between 15 and 30, while the grayscale difference value in defective areas may reach over 60.
[0024] To accurately identify abnormal pixels, an adaptive threshold is constructed by dividing the image into multiple local regions, each 64×64 pixels in size. For each local region, gray-level distribution parameters are calculated, including the mean, standard deviation, and histogram of gray-level differences among the pixels within the region. Based on these parameters, an adaptive threshold is constructed, which is equal to twice the sum of the mean and standard deviation of the gray-level differences within the region. For regions with special fabric structures, such as areas with varying warp yarn density, the threshold is adjusted accordingly to three times the sum of the mean and standard deviation of the gray-level differences within the region.
[0025] The grayscale differences of each pixel at different scales are compared with an adaptive judgment threshold. When the grayscale difference of a pixel exceeds the judgment threshold of its local area, it is marked as a suspected anomalous pixel. To reduce the false detection rate, for suspected anomalous pixels in the level 0 image, the pixel status of its corresponding position in the level 1 image is further examined. If an anomalous pixel also exists in that area in the level 1 image, it is confirmed as an anomalous pixel. This multi-scale verification mechanism effectively reduces false detections caused by image noise or normal fabric texture variations.
[0026] Cluster analysis is performed on confirmed abnormal pixels, grouping spatially adjacent abnormal pixels together to form defect candidate regions. If the number of abnormal pixels in a candidate region exceeds a preset threshold, such as 50 pixels, it is confirmed as a fabric defect. Fabric defects are marked with rectangular boxes, and their location, size, shape, and grayscale characteristics are recorded for subsequent defect classification and processing.
[0027] Based on the detected fabric defect information, the location and distribution characteristics of the defects are calculated, with particular attention paid to their distribution along the fabric width. When defects are detected to be mainly distributed on one side of the fabric, it is determined that the fabric may be misaligned. At this point, a correction command is sent to the control system of the air-jet loom to adjust the tension balance of the warp feed device and the fabric traction device, achieving real-time fabric correction. The correction operation adopts a gradual adjustment strategy to avoid new weaving problems caused by abrupt adjustments.
[0028] This invention achieves accurate detection of fabric defects by real-time acquisition of fabric image sequences during the weaving process of an air-jet loom, combined with multi-scale grayscale analysis and adaptive threshold determination technology. This invention can monitor and identify various fabric defects in real time during high-speed fabric production, including warp yarn breaks, missing weft yarns, and fabric holes. Through the combination of multi-scale grayscale conversion and adaptive threshold determination, early detection and handling of defects are achieved, significantly reducing the fabric defect rate.
[0029] Defect regions are obtained by performing region clustering analysis on abnormal pixels. Feature parameters of the defect regions are extracted and matched with preset defect feature templates to determine defect compensation parameters, including: A spatial distribution map is constructed based on the location of abnormal pixels, and spatially adjacent abnormal pixels are combined into an initial defect block based on the spatial distribution map. Calculate the distribution density of abnormal pixels in the initial defect block, and merge adjacent initial defect blocks whose distribution density meets the preset merging threshold to form a defect region; The edge contour of the defect region is extracted to obtain the boundary curve, and the shape features of the defect region are calculated based on the boundary curve. The grayscale distribution features are obtained by analyzing the pixel grayscale changes within the defect area. The shape features and grayscale distribution features are combined to form a defect feature description. The defect feature description is matched and calculated with a preset defect feature template to obtain the defect type identification result. Based on the defect type identification results and the spatial distribution characteristics of the defect area in the fabric, the compensation direction and compensation amount are calculated to generate defect compensation parameters.
[0030] The spatial distribution map is represented as a two-dimensional matrix with the same size as the original image. Abnormal pixels are marked as 1, and normal pixels are marked as 0. For a 2048×1536 resolution fabric image, the spatial distribution map is also a 2048×1536 binary matrix. Based on the spatial distribution map, a region growing technique is used to group spatially adjacent abnormal pixels into initial defect blocks. By checking the pixel status in eight directions around each abnormal pixel, if other abnormal pixels exist nearby, these pixels are grouped into the same initial defect block. In practice, starting from an unclassified abnormal pixel, the surrounding eight pixels are checked sequentially. If a pixel is found to be abnormal, it is added to the current defect block, and the process continues to expand outward from these newly added pixels until no new adjacent abnormal pixels can be found. Warp and weft breakage defects on the fabric surface typically form strip-shaped areas in the spatial distribution map, while fabric hole defects form block-shaped areas.
[0031] For each initial defect block, the distribution density of its abnormal pixels is calculated. Distribution density is defined as the ratio of the number of abnormal pixels within the initial defect block to the area of its minimum bounding rectangle. The distribution density of real defect areas is typically higher than that of noise areas. The distribution density of warp breakage defects is usually above 0.6, while the distribution density of noise areas is usually below 0.3. A preset merging threshold of 0.5 is set, and adjacent initial defect blocks whose distribution density meets the preset merging threshold are merged to form a defect region. The criterion for determining adjacent initial defect blocks is that the distance between the edges of the minimum bounding rectangles of the two defect blocks is less than 10 pixels. The merging process is performed iteratively until all defect blocks that meet the merging conditions are merged.
[0032] Edge contours are extracted from the formed defect region to obtain boundary curves. Edge extraction employs a region boundary description method. A boundary point is selected as the starting point from the defect region. The position of the next boundary point is determined by systematically checking adjacent positions, thus depicting the complete region edge. The boundary point at the upper left corner of the defect region is selected as the starting point. The process checks eight directions clockwise. When a point transitions from inside to outside the defect region, it is marked as a boundary point, and this current boundary point is used as the new inspection center to continue searching for the next boundary point until the starting point is returned, completing the description of the closed boundary. The boundary curve consists of a series of point coordinates, recording the edge shape of the defect region. Based on the boundary curve, the shape characteristics of the defect region are calculated, including features such as perimeter, area, aspect ratio, roundness, and directionality. The perimeter is the sum of the distances between all points on the boundary curve; the area is the total number of pixels within the defect area; the aspect ratio is the ratio of the long side to the short side of the smallest bounding rectangle of the defect area; circularity is a parameter describing the degree of similarity between the defect area and a circle, calculated by the relationship between the square of the perimeter and the area; the directionality is determined by calculating the principal axis direction of the defect area, and the angle between the principal axis direction and the warp direction can be used to determine the defect type.
[0033] Among common fabric defects, the aspect ratio of warp yarn breakage defects is usually >5, the directionality is consistent with the warp yarn direction, and the roundness is <0.2; the aspect ratio of weft yarn loss defects is usually >4, the directionality is consistent with the weft yarn direction, and the roundness is <0.25; the aspect ratio of fabric hole defects is close to 1, the roundness is >0.8, and there is no obvious directionality.
[0034] Gray-level distribution characteristics are obtained by analyzing the pixel gray-level changes within the defect area. These characteristics include the average gray-level value, gray-level standard deviation, gray-level histogram distribution characteristics, and gray-level gradient information of the pixels within the defect area. The gray-level change pattern within the defect area can reflect the physical characteristics of the defect. The gray-level value within the warp yarn breakage defect area is usually low and exhibits a gradual change along the warp direction; the gray-level value within the weft yarn missing defect area is also low, but exhibits an abrupt change along the weft direction; the gray-level value within the fabric hole defect area is significantly lower than the surrounding area, and the internal gray-level distribution is uniform.
[0035] A defect feature description vector is formed by combining shape features and grayscale distribution features. This vector includes characteristic parameters such as area, perimeter, aspect ratio, roundness, directionality, average grayscale value, and grayscale standard deviation. A pre-built defect feature template library contains feature description vectors for common defect types such as warp yarn breaks, weft yarn defects, and fabric holes. Typical values for the warp yarn break defect feature vector are: aspect ratio 6.8, direction angle 0 degrees, roundness 0.15, and average grayscale value 85; typical values for the weft yarn defect feature vector are: aspect ratio 5.2, direction angle 90 degrees, roundness 0.18, and average grayscale value 90; and typical values for the fabric hole defect feature vector are: aspect ratio 1.2, variable direction angle, roundness 0.85, and average grayscale value 60.
[0036] The defect feature description vector is matched with a preset defect feature template. A feature space distance metric is used to calculate the distance between the feature vector of the defect to be identified and the feature vectors of each type of defect template. The template type with the smallest distance is selected as the defect identification result. Identification results with a distance less than a preset threshold are considered reliable; those with a distance greater than the preset threshold require further manual verification.
[0037] Spatial distribution characteristics include the location and density distribution of defects along the fabric width. When defects are mainly distributed on one side of the fabric, it indicates a potential skew problem, requiring compensation in the opposite direction of the skew. The compensation direction is determined by the defect's location within the fabric; for example, if the defect is mainly distributed on the left side, the compensation direction is to the right. The compensation amount is determined by the degree of skew, which can be represented by the distance from the defect's center point to the fabric's centerline. For warp yarn breakage defects, compensation is primarily achieved by adjusting the warp tension in the corresponding area; for weft yarn loss defects, compensation is primarily achieved by adjusting the weft yarn feed speed; for fabric holes, a combination of warp tension and weft yarn feed speed needs to be adjusted. Finally, defect compensation parameters are generated, including compensation direction and amount information, and transmitted to the loom control device to execute the corresponding adjustment actions.
[0038] This invention achieves accurate detection and classification of fabric defects through spatial clustering analysis and feature matching of abnormal pixels, and can automatically calculate compensation parameters based on defect characteristics. This invention has significant technical advantages, enabling real-time detection of various defects occurring during fabric production. Through multi-dimensional feature analysis, it accurately identifies defect types, effectively reducing false detection and false negative rates. The adaptive compensation mechanism based on defect characteristics allows for precise corrective measures for different types of defects, significantly improving fabric quality consistency, greatly increasing production efficiency, and reducing labor costs.
[0039] A heterogeneous vector field is constructed based on abnormal pixels. The heterogeneous vector field is then decomposed into multiple scales and weighted to obtain a cascaded divergence distribution map, including: The grayscale change is obtained by calculating the difference between the grayscale value of the abnormal pixel and the grayscale value of the adjacent pixel; the position change is obtained by calculating the difference between the spatial coordinates of the abnormal pixel and the spatial coordinates of the adjacent pixel. The grayscale change and the position change are combined to construct the vector features of the abnormal pixels, and a heterogeneous vector field is constructed based on the vector features of the abnormal pixels. The heterogeneous vector field is decomposed into multiple scale components by multi-scale decomposition. The spatial change rate of the vector features of abnormal pixels in each scale component is calculated to obtain the gradient distribution. The divergence distribution of each scale component is calculated based on the gradient distribution. The scale component weights are calculated based on the vector features of abnormal pixels in each scale component. The divergence distributions of each scale component are then weighted and superimposed based on the scale component weights to obtain a cascaded divergence distribution map.
[0040] For abnormal pixels in a fabric image, the eight neighboring pixels in each direction are selected as reference points. Assuming an abnormal pixel has a grayscale value of 180, and its upper neighbor has a grayscale value of 150, the grayscale change in that direction is 30; if its upper right neighbor has a grayscale value of 145, the grayscale change in that direction is 35, and so on, calculating the grayscale change in all eight directions. Simultaneously, the spatial positional difference between the abnormal pixel and its neighboring pixels, i.e., the positional change, is calculated. Assuming an abnormal pixel has coordinates (100, 100), and its upper neighbor has coordinates (100, 99), the positional change in that direction is (0, -1); if its upper right neighbor has coordinates (101, 99), the positional change in that direction is (1, -1).
[0041] By combining grayscale changes with positional changes, vector features of abnormal pixels are constructed. These features are represented as four-dimensional vectors, including horizontal positional changes, vertical positional changes, grayscale changes, and the direction of change. The vector feature of an abnormal pixel relative to its upper neighbor is represented as (0, -1, 30, 0 degrees); its relationship with its upper right neighbor is represented as (1, -1, 35, 45 degrees). The vector features of all abnormal pixels are aggregated to form a heterogeneous vector field covering the entire fabric image. In areas with warp yarn breaks, the vector field exhibits a strong gradient along the warp direction; in areas with missing weft yarns, it exhibits a strong gradient along the weft direction; and in areas with fabric holes, the vector field radiates towards the center.
[0042] The constructed heterogeneous vector field is decomposed into multiple scales to capture defect features at different scales. Multi-scale decomposition is achieved using a sliding window technique, employing windows of 3×3, 5×5, 9×9, and 15×15 pixels to perform local region statistics on the heterogeneous vector field, obtaining components at different scales. For a 1024×768 resolution fabric image, a vector field with four scale components can be generated. In each scale component, the spatial rate of change of vector features of anomalous pixels is calculated to obtain the gradient distribution. The gradient distribution is obtained by calculating the difference in vector features between adjacent pixels. In the 3×3 scale component of the warp breakage defect region, the gradient value along the warp direction is relatively large, typically in the range of 25-35; while in the 9×9 scale component of the fabric hole defect, the gradient value radiating towards the center is significant, typically in the range of 40-60.
[0043] Divergence represents the degree of divergence of a vector field at a point, reflecting the local structural characteristics of a defective region. When calculating divergence, for each abnormal pixel, the pointing of vector features in its eight surrounding directions is statistically analyzed. If most surrounding vectors point towards the point, the divergence is negative, exhibiting a "converging" characteristic; if most surrounding vectors move away from the point, the divergence is positive, exhibiting a "diverging" characteristic. In the warp yarn breakage defect region, the divergence distribution of the 3×3 scale component appears as a stripe, with divergence values ranging from -15 to -25; while in the fabric tear region, the divergence distribution of the 9×9 scale component appears as a circular cluster, with divergence values ranging from -40 to -60.
[0044] The weights of each scale component are determined based on the intensity of the vector features of abnormal pixels. Weight calculation is based on the amplitude and consistency of the vector features. A larger vector feature amplitude results in a higher weight; better vector direction consistency also results in a higher weight. For warp yarn breakage defects, the 3×3 and 5×5 scale components have higher vector feature consistency and are assigned higher weights, at 0.4 and 0.3 respectively; while the 9×9 and 15×15 scale components have lower weights, at 0.2 and 0.1 respectively. For fabric hole defects, the 5×5 and 9×9 scale components have larger vector feature amplitudes and are assigned higher weights, at 0.35 and 0.4 respectively; while the 3×3 and 15×15 scale components have lower weights, at 0.15 and 0.1 respectively.
[0045] For each pixel location, the divergence values of each scale component are multiplied by their corresponding weights and then summed to obtain the final divergence value. The cascaded divergence distribution map reflects the comprehensive characteristics of fabric defect areas at multiple scales. In the cascaded divergence distribution map, defect areas appear as distinct high or low divergence regions, contrasting sharply with normal fabric areas. Warp breakage defects appear as negative divergence bands extending along the warp direction in the cascaded divergence distribution map, with divergence values typically in the range of -20 to -30; weft loss defects appear as negative divergence bands extending along the weft direction, with divergence values typically in the range of -18 to -25; fabric holes appear as circular or elliptical negative divergence regions, with central divergence values typically in the range of -45 to -70.
[0046] This invention employs a technique to construct a heterogeneous vector field from anomalous pixels and calculate a cascaded divergence distribution map. This method enables accurate detection and refined feature extraction of fabric defects, providing a reliable foundation for subsequent defect classification and compensation parameter calculation. It effectively captures multi-scale features of different types of fabric defects, significantly improves the noise resistance of defect detection, and maintains stable detection performance under complex fabric patterns and varying lighting conditions. The cascaded divergence distribution map visually reflects the structural features and spatial distribution of the defect region, providing rich feature information for defect type identification.
[0047] The offset source coordinates are obtained by extracting the divergence peak position from the cascaded divergence distribution map, and the pixel coordinates of the gray-level abrupt change positions are extracted from the fabric image data stream and fitted to the fabric boundary curve. The geometric midline of the fabric boundary curve is calculated to obtain the fabric baseline, including: The distribution of divergence values in the cascaded divergence distribution map is calculated to obtain a numerical distribution matrix. The trend of divergence values is analyzed based on the numerical distribution matrix to obtain a change curve. The locations of maximum divergence values are extracted from the change curve to obtain a set of peak locations. The spatial distance between each location in the set of peak locations is calculated to obtain a distance matrix. The set of peak locations is then clustered based on the distance matrix to obtain the offset source coordinates. The grayscale change value is obtained by calculating the grayscale change of adjacent pixels in the fabric image data stream. The pixel coordinates of the grayscale change position are extracted from the grayscale change value to obtain the edge point set. Curve fitting is performed on the edge point set to obtain the fabric boundary curve. The fabric boundary curve is sampled at equal intervals to obtain a set of sampling points. The midpoint coordinates of the corresponding points in the sampling point set are calculated to obtain a midpoint sequence. The midpoint sequence is then fitted with a curve to obtain the fabric baseline.
[0048] For a cascaded divergence distribution map with a resolution of 1024×768, each pixel location corresponds to a divergence value, and these values constitute a numerical distribution matrix. The values in the matrix are sorted and analyzed to form a trend curve of divergence value changes. Fabric warp breakage defects typically appear as a significant negative value region in the divergence distribution map, with divergence values reaching -65 to -85; while weft yarn loss defects typically have divergence values in the range of -55 to -70; and fabric holes have even lower divergence values, reaching -90 to -110. A local window sliding search method is used to extract the locations of maximum divergence values, with the window size set to 11×11 pixels. When the divergence value at the center point of the window is greater than the divergence values of all other points within the window, and this value exceeds a preset threshold of -50, the point is marked as a peak point. In images of plain weave fabrics with interlaced warp and weft, 5-12 peak points can usually be detected, and the coordinate information of these peak points constitutes a set of peak locations.
[0049] For any two peak points in the set, calculate their Euclidean distance in image space. If the two peak points are located at coordinates (320, 240) and (350, 265) respectively, the distance between them is 37.7 pixels. Fill the distance calculation results between all peak points into the distance matrix. Perform cluster analysis on the peak location set based on the distance matrix, using density clustering method, and set the cluster distance threshold to 50 pixels. When the distance between two peak points is less than the threshold, they are grouped into the same class. For each cluster, calculate the average of the coordinates of all peak points in it as the center point of the cluster, which is the offset source coordinate. In the fabric production process, the offset source coordinate reflects the concentrated area of fabric defect distribution, and these areas usually correspond to the location of loom component failures. For air-jet looms, if the offset source coordinates are concentrated in the edge area of the fabric, it may indicate an abnormality in the weft insertion tip; if the offset source coordinates are distributed in the middle area of the fabric, it may be related to abnormality in the reed or heald frame.
[0050] The grayscale change value is obtained by calculating the grayscale difference between adjacent pixels, and edge detection is performed using the Sobel operators in the horizontal and vertical directions. For plain weave fabric images, a grayscale change threshold of 35 is set. When the grayscale change value of adjacent pixels is greater than the threshold, the location is marked as a grayscale abrupt change location. At the boundary between the fabric and the background, the grayscale change value is usually in the range of 80-120, significantly higher than the threshold. The pixel coordinates of all grayscale abrupt change locations are extracted to form an edge point set. The random sampling consistency algorithm is applied to the edge point set for curve fitting, with 1000 samples and a fitting error threshold of 2.5 pixels. The fitted curve is the fabric boundary curve. Under normal production conditions, the fabric boundary curve should present a smooth straight line or a slightly fluctuating curve shape. When the loom tension control is improper or the weft insertion system is abnormal, the fabric boundary curve may show obvious fluctuations or deviations.
[0051] The fabric boundary curve is sampled at equal intervals, with a sampling point selected every 10 pixels on the curve, resulting in a set of sampling points. For a 1024×768 resolution fabric image, typically 75-80 sampling points can be obtained on each of the left and right boundary curves. The midpoint coordinates of the corresponding sampling points on the left and right boundaries are calculated to form a midpoint sequence. If the coordinates of a sampling point on the left boundary are (50, 200), and the corresponding point on the right boundary is (974, 205), then the midpoint coordinates are (512, 202.5). Cubic spline interpolation is applied to the midpoint sequence for curve fitting, with a fitting accuracy set to 0.5 pixels. The fitted curve is the fabric baseline, reflecting the position of the fabric's central axis. Generally, the fabric baseline should be a straight line parallel to the fabric's direction. When the fabric is skewed, the baseline will tilt or bend. The deviation of the baseline directly reflects the degree of fabric offset, providing a basis for subsequent correction operations.
[0052] The resolution of the cascaded divergence distribution map is the same as the original fabric image, 1024×768 pixels. For normal fabric areas, the divergence values typically fluctuate between -20 and 20; however, the divergence values in defective areas deviate significantly from this range. The peak divergence value for warp breakage defects can reach -75, the peak divergence value for weft missing defects is approximately -65, and the peak divergence value for fabric holes can be as low as -100. Using an 11×11 pixel sliding window to search for the location of divergence maxima, 8-10 significant peak points can usually be detected in fabric images containing multiple defects. Cluster analysis of these peak points, with a distance threshold set to 50 pixels, can group them into 2-3 offset source regions. Fabric edge detection uses the Sobel operator, with a grayscale change threshold set to 35. The grayscale change values detected at the boundary between the fabric and the background are typically around 100. Boundary curve fitting uses a random sampling consensus algorithm, with the fitting error controlled within 2.5 pixels. The fabric baseline is obtained by sampling the left and right boundaries every 10 pixels, calculating the midpoint coordinates of the corresponding sampling points, and then fitting the data using cubic spline interpolation, with a fitting accuracy of 0.5 pixels.
[0053] This invention extracts peak positions and determines offset source coordinates from cascaded divergence distribution maps. Combined with fabric boundary and baseline information, it achieves precise location of fabric defects and analysis of offset characteristics. It can accurately identify defect areas and determine concentrated defect distribution regions against complex fabric backgrounds, providing a basis for loom fault diagnosis and defect root cause analysis. Through fabric boundary detection and baseline fitting, it can monitor the fabric offset state in real time during production, accurately quantify the degree and direction of offset, and achieve correlation analysis between fabric defects and loom operating conditions, helping to determine the root cause of defects.
[0054] The current fabric offset is obtained by calculating the vertical distance between the offset source coordinates and the fabric baseline. The current fabric offset and timestamp are then used to construct a time-series data pair, and multi-order difference analysis is performed to obtain the offset evolution characteristic parameters, including: Calculate the vertical direction from the offset source coordinates to the fabric baseline, and project the vertical projection point from the offset source coordinates to the fabric baseline along the vertical direction. The displacement value is obtained by calculating the spatial distance between the offset source coordinates and the vertical projection point; The offset indicator is obtained by analyzing the offset direction of the offset source coordinates relative to the fabric baseline. The current offset of the fabric is obtained by calibrating the direction of the displacement value according to the offset indicator. Record the timestamp corresponding to the current offset of the fabric, combine the current offset of the fabric with the timestamp to generate a time series data pair, and sort the continuously recorded time series data pairs according to time to obtain a time series data sequence; Construct a difference matrix to store the time series data sequence, calculate the change in the current fabric offset of adjacent time series data pairs in the time series data sequence to obtain the initial difference value, fill the initial difference value into the difference matrix to obtain the difference calculation sequence, calculate the change in adjacent difference values in the difference calculation sequence to obtain the new difference value, repeat the iteration until the change in difference value is less than the preset change value, and construct multi-order difference data from the difference values. The displacement change is obtained by calculating the change amplitude of adjacent difference values in multi-order difference data. Based on the displacement change, the acceleration trend of fabric motion is calculated and converted into offset evolution characteristic parameters.
[0055] A fabric baseline can typically be represented as a curve equation on a plane, with the offset source coordinates being points on the two-dimensional plane. When calculating the vertical direction, first determine the tangent direction of the baseline in the region near the offset source coordinates, then determine the direction perpendicular to that tangent. Assuming the tangent direction of the fabric baseline in a certain region is at a 45-degree angle to the upper right, then the vertical direction is at a 45-degree angle to the upper left. Projecting along this vertical direction from the offset source coordinates onto the fabric baseline yields the vertical projection point. If the offset source coordinates are (320, 210), the calculated vertical projection point coordinates in the parameter representation of the fabric baseline in the region near that point are (315, 205).
[0056] Spatial distance is calculated using the Euclidean distance between two points. In the example above, with the offset source coordinates (320, 210) and the vertical projection point (315, 205), the calculated displacement is 7.1 pixels. This displacement value needs to be converted based on the image resolution and the actual fabric size. If the image resolution is 1024×768 pixels, corresponding to an actual fabric width of 150cm, then each pixel corresponds to an actual distance of approximately 1.46mm. Therefore, a displacement value of 7.1 pixels corresponds to an actual displacement of approximately 10.4mm.
[0057] The offset source coordinates can be located above or below the fabric baseline, corresponding to different offset directions. The cross product of the vectors determines which side of the baseline the offset source coordinates are on. If the offset source coordinates are above the fabric baseline, the offset flag is set to 1; if they are below, the offset flag is set to -1. In the example above, if the offset source coordinates are above the fabric baseline, the offset flag is 1. The direction of the displacement value is indicated by the offset flag, and the current fabric offset is obtained. The current fabric offset is the product of the displacement value and the offset flag. In the example above, the current fabric offset is 7.1 × 1 = 7.1 pixels, corresponding to an actual offset of approximately 10.4 mm.
[0058] The timestamp corresponding to the current fabric offset is recorded, accurate to the millisecond, and generated using a built-in clock. During the fabric production process on the air-jet loom, a high-speed camera acquires images at a frequency of 200 frames / s, corresponding to a time interval of 5ms. Each frame is processed to generate a set of time-series data pairs, containing a timestamp and the current fabric offset. The continuously recorded time-series data pairs are sorted according to their timestamps to obtain a time-series data sequence. To reduce computational load, a set of time-series data pairs can be generated every 5 frames, corresponding to a time interval of 25ms. The time-series data sequence records the change in fabric offset over time.
[0059] A difference matrix is constructed to store the time-series data sequence. Each row in the matrix corresponds to a time-series data pair, containing two values: a timestamp and an offset. The change in the current fabric offset of adjacent time-series data pairs is calculated to obtain the initial difference value. If the offsets of two adjacent frames are 7.1 pixels and 7.3 pixels respectively, the initial difference value is 0.2 pixels. The initial difference value is filled into the difference matrix to obtain the difference calculation sequence. The change in adjacent difference values in the difference calculation sequence is calculated to obtain a new difference value, i.e., the second-order difference value. If two adjacent initial difference values are 0.2 pixels and 0.25 pixels, the second-order difference value is 0.05 pixels. The change in adjacent second-order difference values is continued to be calculated to obtain the third-order difference value. This iterative calculation is repeated until the change in the difference value is less than a preset change value of 0.01 pixels. Typically, after 3 to 4 iterations, the change in the difference value will be less than a preset threshold. The difference values of different orders are then used to construct multi-order difference data.
[0060] The displacement change is obtained by calculating the amplitude of changes between adjacent difference values in the multi-order difference data. This displacement change reflects the change in offset velocity. The acceleration trend of fabric motion is calculated based on the displacement change. The acceleration trend is determined by analyzing the sign and amplitude of the displacement change. If the displacement change is consistently positive and the amplitude increases, it indicates that the fabric offset velocity is accelerating, with a clear acceleration trend. If the displacement change alternates between positive and negative values with small amplitudes, it indicates that the fabric offset velocity fluctuates less and is in a relatively stable state. If the displacement change is consistently negative and the amplitude increases, it indicates that the fabric offset velocity is slowing down. The fabric motion acceleration trend is converted into offset evolution characteristic parameters, including the offset velocity change rate and offset acceleration. The offset velocity change rate is determined by the changes in the first-order difference value, and the offset acceleration is determined by the second-order difference value. Third-order and higher difference values are used to predict the long-term trend of fabric offset.
[0061] For example, a high-speed camera acquires fabric images with a resolution of 1024×768 pixels at 200 frames per second. During a 25-second continuous monitoring period, 5000 frames are acquired, and 1000 frames are selected for analysis, generating 1000 sets of time-series data pairs. The calculated current fabric offset ranges from -15.3 pixels to 18.7 pixels, corresponding to an actual offset of approximately -22.3 mm to 27.3 mm. After calculating the initial difference values, it is found that the offset change is relatively gradual, with initial difference values ranging from -0.5 pixels to 0.6 pixels. The second-order difference value range is even smaller, between -0.15 pixels and 0.18 pixels. The third-order difference value is between -0.08 pixels and 0.09 pixels, and the fourth-order difference value is <0.01 pixels, allowing the iteration to terminate. Analysis of the multi-order difference data reveals that the fabric offset velocity exhibits periodic changes, related to the weft insertion cycle of the loom. The offset acceleration reaches its peak during weft insertion and remains relatively stable during weft weaving. These offset evolution characteristic parameters provide an important basis for implementing correction control.
[0062] This invention accurately calculates the vertical distance from the offset source coordinates to the fabric baseline, objectively reflecting the actual degree of fabric offset and avoiding the error accumulation of traditional edge detection methods. Time-series data analysis and multi-order difference techniques enable this invention not only to obtain the current offset state of the fabric but also to predict its development trend, achieving forward-looking correction control. By extracting offset evolution characteristic parameters, the correlation between fabric offset and loom operating state is established, revealing the intrinsic mechanism of offset generation and providing a basis for loom parameter optimization. It can cope with changes in different fabric varieties and weaving processes, maintaining stable offset detection and prediction performance, significantly improving fabric quality and production efficiency.
[0063] like Figure 2As shown, the defect compensation parameters and offset evolution parameters are combined to calculate the predicted offset, and real-time correction control commands are generated based on the predicted offset, including: The compensation impact value is obtained by analyzing the numerical changes of the defect compensation parameters, and the evolution impact value is obtained by analyzing the numerical changes of the offset evolution parameters. The influence weight is obtained by calculating the ratio of the compensation influence value to the evolution influence value. The defect compensation parameter and the offset evolution parameter are weighted and combined according to the influence weight to obtain the combined prediction value. The change law of the combined prediction value is analyzed to obtain the predicted offset. Extracting the numerical range of the predicted offset yields the offset amplitude interval, and extracting the changing trend of the predicted offset yields the offset development direction. The offset amplitude range is mapped to the correction force, the offset development direction is mapped to the correction direction, and a correction compensation command is generated based on the correction force and the correction direction. Based on the variation characteristics of the predicted offset, the correction compensation command is decomposed into a segmented execution sequence, and the segmented execution sequence is converted into a real-time correction control command.
[0064] The defect types detected in the fabric image are quantified and assigned values. For example, the compensation influence value ranges from 0.6 to 0.8 for warp yarn breakage defects, from 0.4 to 0.6 for weft yarn loss defects, and from 0.7 to 0.9 for fabric holes. The compensation influence value increases accordingly when the defect area or the number of defects increases. If a warp yarn breakage defect with an area of 200 square pixels is detected, the corresponding compensation influence value is 0.65 obtained by looking up a table.
[0065] The evolutionary influence value is obtained by analyzing the numerical changes of the offset evolution parameters. These parameters reflect the dynamic characteristics of the fabric offset state, including the rate of change of offset velocity and the offset acceleration. When the rate of change of offset velocity is positive and the offset acceleration increases, it indicates a significant intensification of the fabric offset trend, resulting in a larger evolutionary influence value. Conversely, when the rate of change of offset velocity is negative and the offset acceleration decreases, it indicates a weakening of the fabric offset trend, resulting in a smaller evolutionary influence value. The evolutionary influence value typically ranges from 0.3 to 0.9. In the production of plain weave fabrics, if a rate of change of offset velocity of 0.2 and an offset acceleration of 0.15 are detected, the evolutionary influence value obtained through mapping is 0.55.
[0066] The ratio of the compensation influence value to the evolution influence value is used to obtain the influence weight, which reflects the relative importance of defect factors and offset dynamic characteristics in fabric offset prediction. When the compensation influence value is 0.65 and the evolution influence value is 0.55, the calculated influence weight is 1.18. Based on the influence weight, the defect compensation parameter and the offset evolution parameter are weighted to obtain the combined predicted value. An adaptive weight allocation method is used for the weighted combination: when the influence weight > 1, the weight of the defect compensation parameter is relatively large; when the influence weight < 1, the weight of the offset evolution parameter is relatively large. With an influence weight of 1.18, the weight of the defect compensation parameter is set to 0.65, and the weight of the offset evolution parameter is set to 0.35. The defect compensation parameter and the offset evolution parameter are combined according to their respective weights to obtain the combined predicted value. The variation pattern of the combined predicted value is analyzed to obtain the predicted offset. The combined predicted value is processed by time-series interpolation to obtain the possible offset of the fabric in the future. In the production process of air-jet loom fabrics, the predicted fabric offset is usually calculated within a time window of 100ms to 500ms.
[0067] Statistical analysis of the predicted offset yields the maximum, minimum, and average offsets, forming the offset amplitude range. On an air-jet loom with a fabric width of 150cm, if the maximum predicted offset is 15 pixels, the minimum is -12 pixels, and the average is 5 pixels, then the offset amplitude range is [-12, 15] pixels. The trend of the predicted offset is extracted to determine the offset development direction. By analyzing the first derivative of the predicted offset, it is determined whether the offset is increasing or decreasing. If the first derivative of the predicted offset is 0.25, the offset development direction is positive, and the fabric offset is increasing.
[0068] The offset amplitude range is mapped to the correction force. The correction force indicates the magnitude of the correction force to be applied. The force range of the correction mechanism on an air-jet loom is typically 0 to 100 units. Through a linear mapping relationship, the offset amplitude range [-12, 15] pixels is mapped to the correction force range [30, 65] units. The offset development direction is mapped to the correction direction. The correction direction indicates the direction in which the correction force should be applied. When the offset development direction is positive, the correction direction is set to negative to counteract the increasing trend of fabric offset; when the offset development direction is negative, the correction direction is set to positive to counteract the decreasing trend of fabric offset. When the offset development direction is positive, the correction direction is set to negative. A correction compensation command is generated based on the correction force and the correction direction. The correction compensation command contains a correction force value and a direction identifier; the force value is 65 units, and the direction identifier is negative.
[0069] Considering the response characteristics of the web guiding actuator in an air-jet loom, the web guiding compensation command is decomposed into multiple small-amplitude continuous actions, forming a segmented execution sequence. The number of segments is determined based on the magnitude of the web guiding compensation command, typically ranging from 3 to 8 segments. For a web guiding compensation command with a force value of 65 units, it can be decomposed into 4 continuous actions: 15 units, 20 units, 20 units, and 10 units respectively. The segmented execution sequence is then converted into real-time web guiding control commands. These commands include specific execution parameters, such as the web guiding motor speed, duration, and rotation direction. In the web guiding control of an air-jet loom, if a stepper motor is used to drive the web guiding device, the control commands include pulse frequency, pulse quantity, and direction indicator. For the decomposed 15-unit guiding force, the converted motor control commands are: pulse frequency 500Hz, pulse quantity 300, and direction indicator reverse. These control commands are sent to the web guiding actuator of the air-jet loom via a communication interface to complete the fabric guiding operation.
[0070] This invention achieves accurate prediction and adaptive correction control of fabric offset by comprehensively analyzing the characteristics of fabric defects and offset evolution. Through a weighted combination of defect compensation parameters and offset evolution parameters, the static and dynamic characteristics of fabric offset are fully considered, improving the accuracy and reliability of prediction. The adaptive weight allocation mechanism allows the method to dynamically adjust the importance of each factor according to actual production conditions, adapting to different fabric types and process requirements. The segmented execution strategy of the correction compensation command effectively avoids oscillations and overshoot during the correction process, improving the smoothness and accuracy of the correction action.
[0071] The real-time defect detection and adaptive correction system for air-jet loom fabrics provided in this embodiment of the invention includes: The image acquisition module is used to acquire fabric image sequences in real time during the weaving process of the air-jet loom, and obtain fabric image data stream; The anomaly detection module is used to calculate the grayscale difference between each pixel and its neighboring pixels in the fabric image data stream, and to mark pixels whose grayscale difference exceeds the judgment threshold as abnormal pixels. The defect analysis module is used to perform regional clustering analysis based on abnormal pixels to obtain defect regions, extract feature parameters of the defect regions and match them with preset defect feature templates to determine defect compensation parameters. The vector field construction module is used to construct heterogeneous vector fields based on abnormal pixels, perform multi-scale decomposition on the heterogeneous vector fields, and superimpose them according to weights to obtain a cascaded divergence distribution map. The coordinate positioning module is used to extract the peak position of divergence from the cascaded divergence distribution map to obtain the offset source coordinates, extract the pixel coordinates of the gray-level change position from the fabric image data stream and fit them into the fabric boundary curve, and calculate the geometric center line of the fabric boundary curve to obtain the fabric baseline. The offset analysis module is used to calculate the vertical distance between the offset source coordinates and the fabric baseline to obtain the current offset of the fabric. The current offset of the fabric and the timestamp are used to construct a time series data pair and perform multi-order difference analysis to obtain the offset evolution characteristic parameters. The correction control module is used to combine the defect compensation parameters and the offset evolution parameters to calculate the predicted offset, and generate real-time correction control commands based on the predicted offset.
[0072] One technical solution provided in this embodiment of the invention is an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in any of the aforementioned methods.
[0073] One technical solution provided in this embodiment of the invention is a computer-readable storage medium storing a computer program, wherein the processor executes the computer program to implement the steps in any of the aforementioned methods.
[0074] The specific embodiments described above are preferred embodiments of the present invention and are not intended to limit the specific scope of the present invention. The scope of the present invention includes, but is not limited to, these specific embodiments. All equivalent changes made in accordance with the shape and structure of the present invention are within the protection scope of the present invention.
Claims
1. A method for real-time detection and adaptive correction of fabric defects on an air-jet loom, characterized in that, Includes the following steps: Real-time acquisition of fabric image sequences during the weaving process of an air-jet loom, obtaining fabric image data stream, calculating the grayscale difference between each pixel and its adjacent pixels in the fabric image data stream, and marking pixels with grayscale differences exceeding the judgment threshold as abnormal pixels; Defect regions are obtained by performing region clustering analysis based on abnormal pixels. Feature parameters of the defect regions are extracted and matched with preset defect feature templates to determine defect compensation parameters. A heterogeneous vector field is constructed based on abnormal pixels. The heterogeneous vector field is decomposed into multiple scales and superimposed according to weights to obtain a cascaded divergence distribution map. The offset source coordinates are obtained by extracting the divergence peak position from the cascaded divergence distribution map, the pixel coordinates of the gray-level abrupt change position are extracted from the fabric image data stream and fitted into the fabric boundary curve, and the geometric midline of the fabric boundary curve is calculated to obtain the fabric baseline. The current fabric offset is obtained by calculating the vertical distance between the offset source coordinates and the fabric baseline. The current fabric offset and the timestamp are used to construct a time series data pair and perform multi-order difference analysis to obtain the offset evolution characteristic parameters. The defect compensation parameters and offset evolution parameters are combined to calculate the predicted offset, and real-time correction control commands are generated based on the predicted offset.
2. The method according to claim 1, characterized in that, Real-time acquisition of fabric image sequences during the weaving process of an air-jet loom yields a fabric image data stream. The grayscale difference between each pixel and its adjacent pixels is calculated, and pixels with grayscale differences exceeding a threshold are marked as abnormal pixels, including: Multiple image acquisition points are set along the width direction of the fabric during the weaving process of the air jet loom. Each acquisition point synchronously acquires images of the fabric surface, and the sampling period is adjusted according to the fabric conveying speed. The fabric images acquired in real time by multiple acquisition points are organized into a fabric image sequence according to their spatial positions to obtain a fabric image data stream. Multi-scale grayscale conversion is performed on the fabric image data stream to obtain a layered pixel grayscale matrix. The grayscale difference between each pixel and its neighboring pixels at different scales is calculated using the layered pixel grayscale matrix. An adaptive judgment threshold is constructed by calculating the gray distribution parameters of multiple local regions based on the layered pixel gray matrix. The gray difference of each pixel at different scales is compared with the adaptive judgment threshold, and the pixels with gray difference exceeding the judgment threshold are marked as abnormal pixels.
3. The method according to claim 1, characterized in that, Defect regions are obtained by performing region clustering analysis on abnormal pixels. Feature parameters of the defect regions are extracted and matched with preset defect feature templates to determine defect compensation parameters, including: A spatial distribution map is constructed based on the location of abnormal pixels, and spatially adjacent abnormal pixels are combined into an initial defect block based on the spatial distribution map. Calculate the distribution density of abnormal pixels in the initial defect block, and merge adjacent initial defect blocks whose distribution density meets the preset merging threshold to form a defect region; The edge contour of the defect region is extracted to obtain the boundary curve, and the shape features of the defect region are calculated based on the boundary curve. The grayscale distribution features are obtained by analyzing the pixel grayscale changes within the defect area. The shape features and grayscale distribution features are combined to form a defect feature description. The defect feature description is matched and calculated with a preset defect feature template to obtain the defect type identification result. Based on the defect type identification results and the spatial distribution characteristics of the defect area in the fabric, the compensation direction and compensation amount are calculated to generate defect compensation parameters.
4. The method according to claim 1, characterized in that, A heterogeneous vector field is constructed based on abnormal pixels. The heterogeneous vector field is then decomposed into multiple scales and weighted to obtain a cascaded divergence distribution map, including: The grayscale change is obtained by calculating the difference between the grayscale value of the abnormal pixel and the grayscale value of the adjacent pixel; the position change is obtained by calculating the difference between the spatial coordinates of the abnormal pixel and the spatial coordinates of the adjacent pixel. The grayscale change and the position change are combined to construct the vector features of the abnormal pixels, and a heterogeneous vector field is constructed based on the vector features of the abnormal pixels. The heterogeneous vector field is decomposed into multiple scale components by multi-scale decomposition. The spatial change rate of the vector features of abnormal pixels in each scale component is calculated to obtain the gradient distribution. The divergence distribution of each scale component is calculated based on the gradient distribution. The scale component weights are calculated based on the vector features of abnormal pixels in each scale component. The divergence distributions of each scale component are then weighted and superimposed based on the scale component weights to obtain a cascaded divergence distribution map.
5. The method according to claim 1, characterized in that, The offset source coordinates are obtained by extracting the divergence peak position from the cascaded divergence distribution map, and the pixel coordinates of the gray-level abrupt change positions are extracted from the fabric image data stream and fitted to the fabric boundary curve. The geometric midline of the fabric boundary curve is calculated to obtain the fabric baseline, including: The distribution of divergence values in the cascaded divergence distribution map is calculated to obtain a numerical distribution matrix. The changing trend of the divergence values is analyzed based on the numerical distribution matrix to obtain a change curve. The maximum value positions of the divergence values are extracted from the change curve to obtain a set of peak positions. The spatial distance between each location in the set of peak locations is calculated to obtain a distance matrix. The set of peak locations is then clustered based on the distance matrix to obtain the offset source coordinates. The grayscale change value is obtained by calculating the grayscale change of adjacent pixels in the fabric image data stream. The pixel coordinates of the grayscale change position are extracted from the grayscale change value to obtain the edge point set. Curve fitting is performed on the edge point set to obtain the fabric boundary curve. The fabric boundary curve is sampled at equal intervals to obtain a set of sampling points. The midpoint coordinates of the corresponding points in the sampling point set are calculated to obtain a midpoint sequence. The midpoint sequence is then fitted with a curve to obtain the fabric baseline.
6. The method according to claim 1, characterized in that, The current fabric offset is obtained by calculating the vertical distance between the offset source coordinates and the fabric baseline. The current fabric offset and timestamp are then used to construct a time-series data pair, and multi-order difference analysis is performed to obtain the offset evolution characteristic parameters, including: Calculate the vertical direction from the offset source coordinates to the fabric baseline, and project the vertical projection point from the offset source coordinates to the fabric baseline along the vertical direction. The displacement value is obtained by calculating the spatial distance between the offset source coordinates and the vertical projection point; The offset indicator is obtained by analyzing the offset direction of the offset source coordinates relative to the fabric baseline. The current offset of the fabric is obtained by calibrating the direction of the displacement value according to the offset indicator. Record the timestamp corresponding to the current offset of the fabric, combine the current offset of the fabric with the timestamp to generate a time series data pair, and sort the continuously recorded time series data pairs according to time to obtain a time series data sequence; Construct a difference matrix to store the time series data sequence, calculate the change in the current fabric offset of adjacent time series data pairs in the time series data sequence to obtain the initial difference value, fill the initial difference value into the difference matrix to obtain the difference calculation sequence, calculate the change in adjacent difference values in the difference calculation sequence to obtain the new difference value, repeat the iteration until the change in difference value is less than the preset change value, and construct multi-order difference data from the difference values. The displacement change is obtained by calculating the change amplitude of adjacent difference values in multi-order difference data. Based on the displacement change, the acceleration trend of fabric motion is calculated and converted into offset evolution characteristic parameters.
7. The method according to claim 1, characterized in that, The defect compensation parameters and offset evolution parameters are combined to calculate the predicted offset, and real-time correction control commands are generated based on the predicted offset, including: The compensation impact value is obtained by analyzing the numerical changes of the defect compensation parameters, and the evolution impact value is obtained by analyzing the numerical changes of the offset evolution parameters. The influence weight is obtained by calculating the ratio of the compensation influence value to the evolution influence value. The defect compensation parameter and the offset evolution parameter are weighted and combined according to the influence weight to obtain the combined prediction value. The change law of the combined prediction value is analyzed to obtain the predicted offset. Extracting the numerical range of the predicted offset yields the offset amplitude interval, and extracting the changing trend of the predicted offset yields the offset development direction. The offset amplitude range is mapped to the correction force, the offset development direction is mapped to the correction direction, and a correction compensation command is generated based on the correction force and the correction direction. Based on the variation characteristics of the predicted offset, the correction compensation command is decomposed into a segmented execution sequence, and the segmented execution sequence is converted into a real-time correction control command.
8. A real-time defect detection and adaptive correction system for air-jet loom fabrics, used to implement the method described in any one of claims 1-7, characterized in that, The system includes: The image acquisition module is used to acquire fabric image sequences in real time during the weaving process of the air-jet loom, and obtain fabric image data stream; The anomaly detection module is used to calculate the grayscale difference between each pixel and its neighboring pixels in the fabric image data stream, and to mark pixels whose grayscale difference exceeds the judgment threshold as abnormal pixels. The defect analysis module is used to perform regional clustering analysis based on abnormal pixels to obtain defect regions, extract feature parameters of the defect regions and match them with preset defect feature templates to determine defect compensation parameters. The vector field construction module is used to construct heterogeneous vector fields based on abnormal pixels, perform multi-scale decomposition on the heterogeneous vector fields, and superimpose them according to weights to obtain a cascaded divergence distribution map. The coordinate positioning module is used to extract the peak position of divergence from the cascaded divergence distribution map to obtain the offset source coordinates, extract the pixel coordinates of the gray-level change position from the fabric image data stream and fit them into the fabric boundary curve, and calculate the geometric center line of the fabric boundary curve to obtain the fabric baseline. The offset analysis module is used to calculate the vertical distance between the offset source coordinates and the fabric baseline to obtain the current offset of the fabric. The current offset of the fabric and the timestamp are used to construct a time series data pair and perform multi-order difference analysis to obtain the offset evolution characteristic parameters. The correction control module is used to combine the defect compensation parameters and the offset evolution parameters to calculate the predicted offset, and generate real-time correction control commands based on the predicted offset.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 7.