A textile defect online detection method based on linear array camera and deep learning
By combining laser displacement sensor and encoder signals, the system can identify and avoid image acquisition of seam areas in real time, thus solving the problems of false detection and positioning misalignment in seam areas during textile defect detection and achieving high-precision textile defect detection.
Patent Information
- Application Number
- CN202611321291.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-20
AI Technical Summary
Existing textile defect detection technologies are prone to false detections, missed detections, and image positioning misalignment when dealing with fabric seam areas, especially due to abrupt changes in seam thickness and mechanical impacts causing abnormal images captured by line scan cameras and changes in fabric tension.
The height profile of the fabric surface is acquired in real time by a laser displacement sensor. Combined with the encoder phase signal and the guide roller tension signal, a suspected seam trigger signal is generated and the timing is verified. A collection gate prohibition pulse is generated to control the line scan camera to stop image acquisition during the seam passage. At the same time, a pre-trained defect detection model is used to detect defects in the effective fabric images.
It improves the accuracy of seam area identification, reduces false positives, maintains the continuity of longitudinal coordinates, improves the stability and accuracy of detection results, and ensures the integrity and reliability of defect detection.
Smart Images

Figure CN123135833A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of textile inspection technology, specifically to an online textile defect detection method based on a line scan camera and deep learning. Background Technology
[0002] With the continuous improvement of intelligent manufacturing in the textile industry, machine vision-based online fabric inspection technology has been widely applied in the fabric production process for real-time detection of surface defects such as holes, stains, broken warp and weft threads, thick knots, and oil stains. Among these, line scan cameras, due to their fast scanning speed, high resolution, and suitability for continuous roll inspection, have become the main image acquisition equipment in online inspection systems for high-speed textile production lines. Furthermore, combined with deep learning target detection models, automatic identification of fabric defects can be achieved, improving detection efficiency and accuracy while reducing manual inspection costs. Therefore, it has been widely used in the field of modern textile quality inspection.
[0003] However, in actual production, fabrics are usually made by splicing multiple fabric segments to form continuous rolls. There are seam areas between different fabric segments with a thickness that is significantly higher than that of normal fabrics. When the seam passes through the guide roller and the acquisition area of the line scan camera, due to the sudden change in seam thickness and mechanical impact, the line scan camera is prone to acquiring abnormal images containing the seam structure. At the same time, it may also cause instantaneous changes in the tension of the guide fabric and fluctuations in the encoder trigger beat.
[0004] Existing technologies typically employ fixed threshold detection, image post-processing filtering, or deep learning models to directly identify seam areas, treating seams as special targets. However, since seam morphology is greatly affected by fabric type, sewing process, and operating status, seam images have a high degree of visual similarity to real fabric defects, easily leading to false detections and missed detections. In addition, although some solutions avoid seam areas by pausing image acquisition, this often results in interruption of image sequence coordinates or displacement of subsequent image positions, affecting the positioning accuracy of continuous fabric images and subsequent defect correlation analysis. Summary of the Invention
[0005] To achieve the above objectives, the present invention provides the following technical solution: an online textile defect detection method based on a linear scan camera and deep learning, comprising: The height profile sequence of the fabric surface is acquired in real time by a laser displacement sensor, and the encoder phase signal and the guide roller tension signal are acquired simultaneously. The height change rate is obtained by performing a differential operation on the height profile sequence. When the height change rate exceeds a set threshold and the continuous width meets the physical characteristics of the seam, a suspected seam trigger signal is generated. In response to a suspected seam trigger signal, the encoder phase jitter amplitude and the tension transient drop slope at the current moment are extracted from the encoder phase signal and the guide roller tension signal. The encoder phase jitter amplitude, tension transient drop slope and suspected seam trigger signal are time-aligned and verified. When all three meet the seam mechanical response conditions, a data acquisition gate prohibition pulse is generated. The hardware trigger port of the acquisition gate prohibition pulse input line scan camera is controlled to stop responding to the encoder trigger line scan signal during the seam passage, so as to pause the acquisition of seam area image and send counting control command to encoder counting module to maintain longitudinal coordinate continuity. The effective fabric image sequence output by the line scan camera is obtained, and the effective fabric image sequence is input into the pre-trained defect detection model to obtain the textile defect detection result.
[0006] Preferably, the height profile sequence is differentiated to obtain the height change rate. When the height change rate exceeds a set change threshold and the continuous width meets the physical characteristics of the seam, a suspected seam trigger signal is generated, including: Using the encoder pulse interval as a spatial reference, the height difference between adjacent sampling points in the height profile sequence is divided by the corresponding encoder pulse interval to obtain the height change rate that eliminates the influence of fabric speed fluctuation. The height change rate is compared point by point with the preset rising edge threshold and falling edge threshold, and the starting point exceeding the rising edge threshold and the ending point below the falling edge threshold are marked. Calculate the number of sampling points between each starting point and the corresponding ending point, and multiply the number of sampling points by the current encoder pulse equivalent to obtain the physical width of the candidate seam; Perform contour feature verification on the height change rate curve corresponding to the physical width of the candidate joint. When the physical width of the candidate joint is within the preset joint width range, the extreme value of the height change rate between the start point and the end point exceeds the amplitude verification threshold, and the height change rate forms a continuous abrupt change contour with obvious rising and falling segments between the start point and the end point, the area corresponding to the physical width of the candidate joint is determined to be the true thickness abrupt change area, and a suspected joint trigger signal containing the start point position identifier and the physical width of the candidate joint is output.
[0007] Preferably, in response to a suspected seam trigger signal, the encoder phase jitter amplitude and tension transient drop slope at the current moment are extracted from the encoder phase signal and the guide roller tension signal, including: Using the starting point position identifier in the suspected seam trigger signal as a unified timing reference, the corresponding encoder analysis window is located in the encoder phase signal, and the corresponding tension analysis window is located in the guide roller tension signal; wherein, the width of both the encoder analysis window and the tension analysis window is determined based on the physical width of the candidate seam; Read the original encoder pulse sequence in the encoder analysis window and calculate the encoder phase jitter amplitude based on the standard deviation of adjacent encoder pulse periods; The tension sensor output signal is read in the tension analysis window, and the tension change rate sequence is obtained by performing differential operation on the tension sensor output signal. Extract the rapidly decreasing tension segment from the tension change rate sequence, and calculate the slope of the rapidly decreasing tension segment as the transient drop slope of tension.
[0008] Preferably, the encoder phase jitter amplitude, tension transient drop slope, and suspected seam trigger signal are time-aligned and verified. When all three satisfy the seam mechanical response condition, a data acquisition gating prohibition pulse is generated, including: Using the starting point location marker in the suspected seam trigger signal as a unified timing reference, a corresponding seam event timeline is established. The encoder phase jitter amplitude corresponding to the encoder analysis window and the tension transient drop slope corresponding to the tension analysis window are mapped to the seam event time axis respectively. The time point corresponding to the peak value of the encoder phase jitter is taken as the encoder response time, and the time point corresponding to the maximum value of the tension transient drop slope is taken as the tension response time. Calculate the first time offset between the encoder response time and the time corresponding to the starting point position mark, and the second time offset between the tension response time and the time corresponding to the starting point position mark. The first time offset and the second time offset are compared with the preset response tolerance window respectively. When the first time offset is within the encoder response tolerance window and the second time offset is within the tension response tolerance window, it is determined that the encoder phase jitter amplitude, the tension transient drop slope and the suspected seam trigger signal meet the timing consistency. When the timing consistency is satisfied, and the encoder phase jitter amplitude is greater than the preset phase jitter threshold and the tension transient drop slope is less than the preset tension drop threshold, a data acquisition gate prohibition pulse is generated.
[0009] Preferably, the control line scan camera stops responding to the encoder-triggered line scan signal during seam passage to pause image acquisition in the seam area and sends a counting control command to the encoder counting module to maintain longitudinal coordinate continuity, including: Based on the starting point position marker corresponding to the acquired gating prohibition pulse and the physical width of the candidate seam, the prohibited area for line scanning of the linear scan camera is determined; Within the prohibited line scan range, the acquisition gate prohibition pulse is output to the hardware trigger port of the line scan camera, so that the line scan camera stops generating line scan trigger signals; During the period when line scanning is prohibited, the encoder pulse counting module continues to receive encoder pulses and update the cumulative position count, while the generation of line scan trigger signals for the linear scan camera based on encoder pulses is prohibited. Once the seam area has been passed, the acquisition gate prohibition pulse is released, the line scan trigger of the linear scan camera is restored, and the longitudinal coordinate reference for the restoration of acquisition is used as the current encoder cumulative position count, and the longitudinal coordinate information of subsequent image sequences is updated.
[0010] Preferably, the effective fabric image sequence is input into a pre-trained defect detection model to obtain textile defect detection results, including: Based on the longitudinal coordinate information corresponding to the effective fabric image sequence, the effective fabric image sequence is divided into continuous image regions to obtain multiple image units to be detected. Each image unit to be detected is input into a pre-trained defect detection model to extract the defect feature information corresponding to each image unit to be detected. Based on the defect feature information and vertical coordinate information corresponding to each image unit to be detected, cross-image unit association matching is performed on the candidate defect targets in each image unit to be detected to obtain the textile defect detection result.
[0011] Preferably, based on the defect feature information and vertical coordinate information corresponding to each image unit to be detected, the candidate defect targets in each image unit to be detected are associated and matched, including: Obtain the coordinate overlap region between adjacent image units to be detected; The correlation between candidate defect targets is calculated based on the positional relationship, texture feature similarity, and vertical coordinate continuity of the candidate defect targets within the coordinate overlap area. When the correlation is greater than the preset correlation threshold, the corresponding candidate defect targets are identified as the same defect target, and the targets are merged to obtain a continuous defect area.
[0012] Preferably, after merging the candidate defect targets, the method further includes: Obtain the vertical coordinate interval corresponding to the candidate defect target, and determine whether the vertical coordinate interval overlaps with the row scan prohibited interval; When the vertical coordinate interval corresponding to the candidate defect target overlaps with the row scan prohibited interval, the seam authenticity is determined for the candidate defect target. Output textile defect detection results based on the seam authenticity determination results.
[0013] Preferably, when the vertical coordinate interval corresponding to the candidate defect target overlaps with the row scan prohibited interval, a seam authenticity determination is performed on the candidate defect target, including: Based on the starting and ending boundaries of the line scan prohibited area, a preset safety buffer width is extended to both sides of the line scan prohibited area to construct a seam transition analysis zone. Extract the effective fabric image region located within the seam transition analysis zone and outside the line scan prohibited zone, and use it as a reference background sample; The regions corresponding to the candidate defect targets are mapped to the spatial coordinate system of the seam transition analysis zone, and the difference between the defect feature information corresponding to the candidate defect targets and the defect feature information at the corresponding positions of the reference background samples is calculated to obtain the seam residual features. Calculate the local energy value and spatial continuity index of the joint residual characteristics; When the local energy value exceeds the preset energy threshold and the spatial continuity index meets the preset defect morphology constraint, the candidate defect target is determined as the real defect target and retained in the textile defect detection result. Otherwise, candidate defect targets are identified as pseudo-defect targets caused by seam structure and filtered out from the textile defect detection results.
[0014] Compared with the prior art, the beneficial effects of the present invention are: (1) This invention collects the height contour information of the fabric surface and combines the encoder phase signal and the guide roller tension signal to make a comprehensive judgment on the suspected seam area, which can improve the accuracy of seam area identification, reduce misjudgment caused by relying solely on image information, and by performing time-series verification on the height change rate, encoder phase jitter and tension transient change, it can distinguish between normal fabric defects and abnormal features caused by seam structure, reduce the interference of seam area on defect detection results, and improve the stability of online detection; (2) This invention generates a gating prohibition pulse based on the seam detection result and controls the line scan camera to stop scanning during the seam passage, which can prevent the seam area image from entering the defect detection process and reduce false detections caused by seam texture, thickness changes and mechanical impact; and by keeping the encoder counting module running continuously during the image acquisition stop, the continuity of the fabric longitudinal coordinate can be maintained, avoiding the subsequent image position shift caused by the pause in acquisition, and improving the positioning accuracy of the detection result. (3) By inputting effective fabric images with continuous longitudinal coordinate relationships into a pre-trained defect detection model and matching them with coordinate relationships, texture features and target association information between different image units, the present invention can achieve continuous identification of defect targets across image regions, avoid repeated detection or omission of the same defect target due to image segmentation, and improve the integrity of fabric defect detection. When there is spatial overlap between the candidate defect target and the seam area, a seam transition analysis zone is constructed, and effective fabric images on both sides of the seam area are used as reference samples to judge the authenticity of the candidate target. This can further filter out false defects generated by the seam structure and improve the reliability of the defect detection results. Attached Figure Description
[0015] Figure 1 This is a schematic flowchart of the overall method in one embodiment of the present invention. Detailed Implementation
[0016] 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 embodiments of the present invention, and not all embodiments. 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.
[0017] Example 1, please refer to Figure 1 This invention provides a technical solution: an online detection method for textile defects based on a linear array camera and deep learning, comprising: S1. The height profile sequence of the fabric surface is acquired in real time by a laser displacement sensor, and the encoder phase signal and the guide roller tension signal are acquired simultaneously. S2. Perform differential operation on the height profile sequence to obtain the height change rate. When the height change rate exceeds the set threshold and the continuous width meets the physical characteristics of the seam, generate a suspected seam trigger signal. S3. In response to a suspected seam trigger signal, extract the encoder phase jitter amplitude and tension transient drop slope at the current moment from the encoder phase signal and the guide roller tension signal. S4. Perform timing alignment verification on encoder phase jitter amplitude, tension transient drop slope and suspected seam trigger signal. When all three meet the seam mechanical response conditions, generate acquisition gate prohibition pulse. S5. The hardware trigger port of the acquisition gate prohibition pulse is input to the line scan camera, and the line scan camera is controlled to stop responding to the encoder trigger line scan signal during the seam passage, so as to pause the acquisition of the seam area image and send a counting control command to the encoder counting module to maintain the continuity of the longitudinal coordinate. S6. Obtain the effective fabric image sequence output by the line scan camera, input the effective fabric image sequence into the pre-trained defect detection model, and obtain the textile defect detection result.
[0018] It should be noted that the laser displacement sensor non-contactly acquires the three-dimensional morphology information of the fabric surface. This can include a series of height values continuously sampled along the fabric's travel direction to detect sudden changes in fabric thickness in real time. Simultaneously, encoder phase signals and guide roller tension signals are acquired. These two types of signals reflect the precise longitudinal position of the fabric and the mechanical transmission state, respectively, representing the motion disturbances and mechanical responses that may occur when the seam passes through. For example, suppose that in detecting the seam area during denim production, the laser displacement sensor acquires a contour segment with a sudden increase in height of 2mm and a continuous width of 15mm at 0.1mm intervals. At the same time, the encoder signal shows pulse interval fluctuations, and the tension sensor reading drops sharply by 8% within the same time period. These multi-source data together constitute the original observation basis for the seam event. Differential operations are performed on the height profile sequence to quantify the degree of its change: the height change rate is the ratio of the height difference between adjacent sampling points to the corresponding spatial interval, which is used to eliminate the interference of fabric speed fluctuations on the absolute height judgment; when the change rate exceeds a preset threshold and the lateral span of the abnormal section conforms to the physical width range of a typical seam, a suspected seam event is determined and a trigger signal is generated; for example: if the height change rate threshold is set to 5mm / m, the physical feature width range of the seam is 10–25mm, and the differential value of a certain profile reaches 7mm / m and the continuous width is 18mm, then the system automatically generates a suspected seam trigger signal containing the starting position identifier and candidate width, as the starting point for subsequent multimodal verification; In response to a suspected seam trigger signal, key mechanical response parameters are extracted from the synchronously acquired encoder phase signal and guide roller tension signal: the encoder phase jitter amplitude reflects the instantaneous speed instability of the transmission system when the seam passes through, which is usually expressed as the standard deviation or coefficient of variation of the time interval between adjacent pulses; the tension transient drop slope characterizes the rate at which the tension decreases in a very short time, reflecting the impact intensity of the seam on the constant tension control system; for example, within the analysis window of 50ms before and after the suspected seam trigger moment, the encoder pulse interval standard deviation reaches 12μs (3μs under normal operating conditions), and the tension signal drops from 50N to 42N within 8ms, and the calculated drop slope is -1000N / s. These two indicators together characterize the dynamic disturbance characteristics caused by the seam; The extracted encoder phase jitter amplitude, tension transient drop slope, and suspected seam trigger signal are time-aligned and verified: due to factors such as sensor installation position and signal transmission delay, the response times of the three types of signals may have slight offsets. They need to be mapped to a unified time axis and verified whether they fall within the allowable tolerance window. Only when the three are consistent in timing and their respective amplitudes meet the preset seam mechanical response conditions are they confirmed as real seam events and a data acquisition gate prohibition pulse is generated. For example: if the encoder response tolerance is set to ±2ms and the tension response tolerance is ±3ms, and the measured encoder jitter peak lags the trigger signal by 1.5ms and the tension drop start point leads the trigger signal by 2.0ms, and the jitter amplitude is greater than 8μs and the drop slope is less than -800N / s, then the three are judged to have a valid coordinated response, and a hardware-level prohibition pulse with a width covering the entire seam area is output. The acquisition gated prohibition pulse is directly connected to the hardware trigger port of the line scan camera, which actively blocks the row scan trigger signal emitted by the encoder during the seam passage, thereby avoiding the acquisition of invalid images caused by fabric undulations and lighting distortion. At the same time, a counting control command is sent to the encoder counting module, which continues to accumulate the pulse count during the stop scanning period to record the actual fabric length traveled, ensuring seamless connection of the longitudinal coordinates of the image sequence after the acquisition is restored. For example, when the prohibition pulse duration is 20ms and the corresponding fabric length is 30mm, the camera does not output any image lines during this period, but the encoder's accumulated position is updated from 1000.00mm to 1030.00mm. After the prohibition pulse ends, the longitudinal coordinate of the first valid image is set to 1030.00mm, and subsequent images continue to accumulate based on this benchmark, completely eliminating coordinate discontinuities or overlaps caused by the seam. The system acquires a sequence of valid fabric images after removing seam areas and inputs it into a pre-trained deep learning defect detection model. This model has been trained on a large number of labeled samples and can identify various textile defects such as holes, oil stains, and weft skew. Since the input images have eliminated seam interference, the model does not need to process artifacts and can directly focus on the detection and localization of real defects. For example, after the model infers a valid image sequence of 5m in length, it detects a circular hole with a diameter of 3mm at 2.3m with a confidence level of 0.96 and a transverse weft skew of 12mm in length at 4.1m with a confidence level of 0.89. Finally, it outputs a structured detection result containing defect type, location, size, and confidence level for use by downstream quality inspection systems.
[0019] In an optional embodiment, a height change rate is obtained by differentiating the height profile sequence. When the height change rate exceeds a set change threshold and the continuous width meets the physical characteristics of the seam, a suspected seam trigger signal is generated, including: Using the encoder pulse interval as a spatial reference, the height difference between adjacent sampling points in the height profile sequence is divided by the corresponding encoder pulse interval to obtain the height change rate that eliminates the influence of fabric speed fluctuation. The height change rate is compared point by point with the preset rising edge threshold and falling edge threshold, and the starting point exceeding the rising edge threshold and the ending point below the falling edge threshold are marked. Calculate the number of sampling points between each starting point and the corresponding ending point, and multiply the number of sampling points by the current encoder pulse equivalent to obtain the physical width of the candidate seam; Perform contour feature verification on the height change rate curve corresponding to the physical width of the candidate joint. When the physical width of the candidate joint is within the preset joint width range, the extreme value of the height change rate between the start point and the end point exceeds the amplitude verification threshold, and the height change rate forms a continuous abrupt change contour with obvious rising and falling segments between the start point and the end point, the area corresponding to the physical width of the candidate joint is determined to be the true thickness abrupt change area, and a suspected joint trigger signal containing the start point position identifier and the physical width of the candidate joint is output.
[0020] It should be noted that using the encoder pulse interval as a spatial reference for differential calculation means using the equidistant displacement markers output by the encoder to replace the fixed time sampling interval to calculate the height change rate. Because fabric speed fluctuates during production, directly using time-domain differential calculation would result in seams of the same physical thickness exhibiting different change rate values at different machine speeds. The encoder pulse interval, however, represents the constant physical distance the fabric actually travels. Using this as a divisor normalizes the height difference to the height change per unit length, thus completely eliminating the interference of instantaneous speed fluctuations on threshold determination. For example, when inspecting a batch of canvas, if the fabric speed fluctuates from 20 m / min to 25 m / min, using time differential calculation, the calculated change rate for the same 2mm thick seam would be 0.8 mm / ms at low speed and 1.0 mm / ms at high speed, easily leading to missed detections or false alarms. However, by using the encoder pulse interval as a spatial reference, regardless of the machine speed, the height change rate corresponding to this seam remains stable at 0.2 mm / mm, ensuring the universality of the trigger threshold. Comparing the height change rate point-by-point with preset rising and falling edge thresholds is crucial for accurately locating the boundaries of thickness abrupt change zones. The rising edge threshold identifies the starting position of the fabric surface transitioning from the normal area to the seam bulge area, while the falling edge threshold identifies the ending position of the fabric surface returning from the seam bulge area to the normal area. These two thresholds are typically set based on the statistical distribution of historical seam samples, and the absolute value of the falling edge threshold can be slightly lower than the rising edge threshold to accommodate potential gentle transitions at the seam tail. For example, in a polyester fabric inspection scenario, the rising edge threshold is set to 0.15 mm / mm, and the falling edge threshold is set to -0.12 mm / mm. When the value of a point in the height change rate sequence first exceeds 0.15 mm / mm, it is marked as the starting point; subsequently, when the value of a point first falls below -0.12 mm / mm, it is marked as the ending point. The interval between these two points represents the physical coverage area of the candidate seam. Calculating the number of sampling points between the start and end points and multiplying it by the current encoder pulse equivalent yields the candidate seam physical width. This process converts discrete digital signals into geometric dimensions with practical engineering significance. The encoder pulse equivalent represents the fabric travel distance corresponding to each pulse, determined by the guide roller circumference and encoder resolution. The number of sampling points reflects the number of pulses traversed in the spatial dimension by the abrupt change zone. Multiplying these two values yields the actual seam width in millimeters. For example, if the encoder pulse equivalent is 0.05mm, and a test shows 300 sampling points between the marked start and end points, the candidate seam physical width is 15mm. This value can be directly compared with the seam width specifications in the process standard. Perform contour feature verification on the height change rate curve corresponding to the physical width of the candidate seam. This is done by using multiple conditions to jointly verify and eliminate false triggers caused by non-seam factors. The preset seam width range is determined based on the seam process specifications of the target fabric. Too narrow a range may indicate yarn knots or fly waste, while too wide a range may indicate wrinkles or uneven tension. The amplitude verification threshold is used to confirm that the intensity of the abrupt change is sufficient to constitute a valid seam rather than just slight surface undulations. The continuous abrupt change profile requires that the height change rate presents a complete shape of rising and falling from the starting point to the ending point, and there should be no long-term plateau area or reverse fluctuation between the rising and falling segments, thus distinguishing it from non-structural anomalies such as scratches and stains. For example, in the detection of a certain cotton fabric, the preset seam width range is 8mm to 20mm, the amplitude verification threshold is 0.1mm / mm, the physical width of a candidate area is 12mm, the extreme value is 0.25mm / mm, and its height change rate curve continuously rises to the peak after the starting point and then smoothly falls to the ending point without interruption or reversal. This is then determined to be a true thickness abrupt change area, and the system immediately outputs a suspected seam trigger signal containing the starting point position identifier and 12mm width information.
[0021] In an optional embodiment, in response to a suspected seam trigger signal, extracting the encoder phase jitter amplitude and tension transient drop slope at the current moment from the encoder phase signal and the guide roller tension signal includes: Using the starting point position identifier in the suspected seam trigger signal as a unified timing reference, the corresponding encoder analysis window is located in the encoder phase signal, and the corresponding tension analysis window is located in the guide roller tension signal; wherein, the width of both the encoder analysis window and the tension analysis window is determined based on the physical width of the candidate seam; Read the original encoder pulse sequence in the encoder analysis window and calculate the encoder phase jitter amplitude based on the standard deviation of adjacent encoder pulse periods; The tension sensor output signal is read in the tension analysis window, and the tension change rate sequence is obtained by performing differential operation on the tension sensor output signal. Extract the rapidly decreasing tension segment from the tension change rate sequence, and calculate the slope of the rapidly decreasing tension segment as the transient drop slope of tension.
[0022] It should be noted that using the starting point position marker in the suspected seam trigger signal as a unified timing reference means anchoring the local analysis of multi-source heterogeneous signals to the same physical event starting point. Because laser displacement sensors, encoders, and tension sensors differ in mechanical installation position, signal transmission link, and sampling frequency, their raw data are naturally misaligned on the time axis. Directly extracting the analysis window based on their respective timestamps would result in extracted features corresponding to different physical sections of the fabric, losing the causal correlation of the mechanical response. The starting point position marker is determined by height profile differential calculation, representing the seam leading edge entering the detection range. The precise moment of the field of view, as a benchmark, ensures that all subsequent feature extractions revolve around the same seam event. For example, in a denim production line, a laser sensor is installed 150mm in front of the encoder. When the starting point of the suspected seam trigger signal corresponds to the encoder's cumulative position of 2000.00mm, the system automatically sets the starting point of the encoder analysis window to 2000.00mm, and the starting point of the tension analysis window is set to 1998.50mm after compensation based on the tension sensor's installation offset. Although the physical coordinates of the three are different, they all point to the same instantaneous state of the seam front passing through each sensor. The widths of the encoder analysis window and the tension analysis window are determined based on the physical width of the candidate seam. This is to ensure that the feature extraction range adaptively matches the actual spatial scale of the seam. If the window is too narrow, it may miss the mechanical response details at the tail of the seam, while if the window is too wide, it will introduce background noise from the normal fabric segment, reducing the feature signal-to-noise ratio. Typically, the window width is set to 1.5 to 3 times the physical width of the candidate seam, and extends backward from the aforementioned starting point as the front boundary. For example, in a certain detection, the physical width of the candidate seam is 12mm, and the system sets the encoder analysis window width to 30mm, that is, it covers 30mm of fabric length backward from the encoder position corresponding to the starting point. The tension analysis window is also set to 30mm to ensure that the two windows completely overlap in space, and the extracted phase jitter and tension drop both originate from the mechanical disturbance of the same seam segment. Reading the original encoder pulse sequence within the encoder analysis window and calculating the encoder phase jitter amplitude based on the standard deviation of adjacent encoder pulse periods is the core method for quantifying the speed stability of the transmission system when a seam passes through. The encoder pulse period refers to the time interval between the rising edges of two adjacent pulses, which should remain constant during uniform fabric movement. When the seam passes through the guide roller, the instantaneous load change caused by the sudden change in thickness leads to fluctuations in motor speed or slippage of the roller surface, which manifests as an increased dispersion of the pulse period. The standard deviation, as a statistical measure of dispersion, can effectively capture this non-periodic disturbance and is not sensitive to occasional noise. For example, in the detection of a certain polyester fabric, a total of 600 pulses were collected in the encoder analysis window. The standard deviation of the pulse period for the normal fabric section is 2μs, while the standard deviation rises to 15μs in the window corresponding to the seam. This 15μs is used as the encoder phase jitter amplitude output, which is significantly higher than the normal value, indicating that the seam causes significant transmission disturbance. Reading the tension sensor output signal and performing differential calculations within the tension analysis window to obtain the tension change rate sequence is a crucial step in converting static tension values into dynamic mechanical response indicators. The original output of the tension sensor is typically a millivolt-level analog voltage converted to a digital value, reflecting the absolute tension magnitude at a given moment. However, the characteristic of tension passing through a seam is not a shift in the absolute tension value, but rather a rapid drop in tension over a very short period. Differential calculations involve calculating the difference in tension values between adjacent sampling points and dividing by the sampling interval to obtain the tension change per unit time, thus highlighting the transient process. For example, if the tension sensor sampling rate is 1kHz, and the tension values at five consecutive sampling points within the tension analysis window are 50.0N, 49.8N, 49.2N, 48.0N, and 47.5N, the resulting tension change rate sequence after differential calculations is -200N / s, -600N / s, -1200N / s, and -500N / s, where -1200N / s represents the peak change rate during the rapid tension drop segment. Extracting the rapid tension drop segment from the tension change rate sequence and calculating its slope as the transient tension drop slope is a further focus and quantification of the aforementioned difference results. The rapid tension drop segment refers to the subsequence in the change rate sequence that is continuously below a preset negative threshold, representing the main process of tension release caused by the seam. The slope of this segment is obtained by linear fitting of the subsequence, which better reflects the overall trend of the drop than a single peak value and avoids misjudgment caused by sampling noise. For example, in the detection of a certain cotton fabric, the preset negative threshold is -300N / s. The rapid drop segment consisting of 8 consecutive points is identified from the tension change rate sequence. The least squares linear fitting is performed on it, and the slope is -980N / s. This value is used as the output of the transient tension drop slope. This slope, together with the aforementioned encoder phase jitter amplitude of 15μs, constitutes the two-dimensional feature vector of the seam mechanical response.
[0023] In an optional embodiment, the encoder phase jitter amplitude, tension transient drop slope, and suspected seam trigger signal are time-aligned and verified. When all three satisfy the seam mechanical response condition, a data acquisition gating prohibition pulse is generated, including: Using the starting point location marker in the suspected seam trigger signal as a unified timing reference, a corresponding seam event timeline is established. The encoder phase jitter amplitude corresponding to the encoder analysis window and the tension transient drop slope corresponding to the tension analysis window are mapped to the seam event time axis respectively. The time point corresponding to the peak value of the encoder phase jitter is taken as the encoder response time, and the time point corresponding to the maximum value of the tension transient drop slope is taken as the tension response time. Calculate the first time offset between the encoder response time and the time corresponding to the starting point position mark, and the second time offset between the tension response time and the time corresponding to the starting point position mark. The first time offset and the second time offset are compared with the preset response tolerance window respectively. When the first time offset is within the encoder response tolerance window and the second time offset is within the tension response tolerance window, it is determined that the encoder phase jitter amplitude, the tension transient drop slope and the suspected seam trigger signal meet the timing consistency. When the timing consistency is satisfied, and the encoder phase jitter amplitude is greater than the preset phase jitter threshold and the tension transient drop slope is less than the preset tension drop threshold, a data acquisition gate prohibition pulse is generated.
[0024] It should be noted that establishing the seam event time axis using the starting point position marker in the suspected seam trigger signal as a unified timing reference is to construct a common reference coordinate system independent of the local clocks of each sensor. Since the sampling frequencies, data transmission delays, and installation physical distances of the laser displacement sensor, encoder, and tension sensor are different, the timestamps of their raw data cannot be directly compared horizontally. The seam event time axis uses the absolute time corresponding to the starting point position marker as its zero point, converting all subsequent characteristic responses into relative time quantities relative to this zero point, thereby eliminating systematic time offsets between heterogeneous signals. For example, in a certain printed fabric detection system, the starting point of the suspected seam signal triggered by the laser sensor corresponds to 10.000s in the system master clock. Using this as the origin to establish the seam event time axis, if the encoder phase jitter peak occurs at 10.003s in the master clock, its coordinate on the event time axis is +3ms; if the maximum tension drop slope occurs at 9.998s in the master clock, its event time axis coordinate is -2ms. Thus, all three are included in the same time frame for alignment verification. Mapping the encoder phase jitter amplitude and tension transient drop slope to the seam event time axis and determining their respective response times is a key step in transforming amplitude characteristics into temporal characteristics. The encoder phase jitter amplitude itself is a scalar value, but the time of its peak reflects the dynamic response lag characteristic of the transmission system to seam disturbances. Similarly, the maximum value of the tension transient drop slope characterizes the initial inertial delay of the tension release process. By locating the precise coordinates of these two extreme points on the event time axis, the feature that originally only described "disturbance intensity" can be expanded into a spatiotemporal joint feature that also includes "disturbance timing." For example, in a certain detection, if the peak phase jitter amplitude within the encoder analysis window is 18μs, and it occurs at +4ms on the event time axis, then the encoder response time is recorded as +4ms; if the maximum drop slope within the tension analysis window is -1100N / s, and it occurs at -1ms on the event time axis, then the tension response time is recorded as -1ms. These two, together with the starting point zero, constitute three temporal anchor points.
[0025] The calculation of the first time offset between the encoder response time and the time corresponding to the starting point position marker, and the second time offset between the tension response time and the time corresponding to the starting point position marker, quantifies the degree of response delay or lead of each sensing channel relative to the reference event. Both the first and second time offsets are signed time differences; positive values indicate a response lagging behind the reference, and negative values indicate a response leading the reference. Their absolute values directly reflect the overall delay characteristics of the signal chain. For example, in the aforementioned case, if the encoder response time is +4ms and the starting point time is 0ms, then the first time offset is +4ms; if the tension response time is -1ms and the starting point time is 0ms, then the second time offset is -1ms. These two offsets will subsequently be compared with a preset tolerance window to determine whether the mechanical response occurs within a reasonable time range.
[0026] The first and second time offsets are compared with preset response tolerance windows to determine timing consistency. This dual time thresholding filters out non-causally related spurious signals. The upper and lower limits of the encoder response tolerance window and the tension response tolerance window are set based on the statistical distribution of response delays from historical real seam samples, typically taking into account factors such as sensor installation spacing, mechanical transmission inertia, and signal processing time. Only when both offsets fall within their respective tolerance ranges does it indicate that the three types of signals are indeed caused by the same physical event, rather than accidental noise or interference. For example, in a production line calibration, the encoder response tolerance window is set to -2ms to +6ms, and the tension response tolerance window is set to -3ms to +4ms. If the measured first time offset of +4ms is within the encoder tolerance window and the second time offset of -1ms is within the tension tolerance window, then the three are determined to meet timing consistency. If the first time offset is +8ms in a certain detection, exceeding the encoder tolerance upper limit, then even if the amplitude meets the standard, it is determined to be timing inconsistent, and no prohibition pulse is generated to avoid mistakenly blocking the acquisition of normal fabric images. When timing consistency is satisfied and the encoder phase jitter amplitude is greater than the preset phase jitter threshold, and the tension transient drop slope is less than the preset tension drop threshold, a data acquisition gating prohibition pulse is generated. This is the final decision logic that integrates timing verification and amplitude verification. The preset phase jitter threshold and preset tension drop threshold represent the minimum effective intensity of transmission disturbance and tension release caused by the seam, respectively. Responses below these intensities are considered normal fluctuations or caused by non-seam factors. Only under the dual conditions of timing alignment and both-dimensional amplitudes meeting the standards are they confirmed as real seam events and hardware-level control signals are output. For example, in a certain hemp... In fabric inspection, the preset phase jitter threshold is 10μs, and the preset tension drop threshold is -800N / s. In a certain calibration, the first time offset of +3ms and the second time offset of -1ms are both within the tolerance window. The encoder phase jitter amplitude is 16μs, which is greater than 10μs, and the tension transient drop slope is -950N / s, which is less than -800N / s. All four conditions are met. The system then generates a gating prohibition pulse that covers the entire seam area and sends it to the hardware trigger port of the line scan camera to pause image acquisition, ensuring that the subsequent defect detection model is not affected by seam artifacts.
[0027] In an optional embodiment, the control line scan camera stops responding to encoder-triggered line scan signals during seam passage to pause seam area image acquisition and sends a counting control command to the encoder counting module to maintain longitudinal coordinate continuity, including: Based on the starting point position marker corresponding to the acquired gating prohibition pulse and the physical width of the candidate seam, the prohibited area for line scanning of the linear scan camera is determined; Within the prohibited line scan range, the acquisition gate prohibition pulse is output to the hardware trigger port of the line scan camera, so that the line scan camera stops generating line scan trigger signals; During the period when line scanning is prohibited, the encoder pulse counting module continues to receive encoder pulses and update the cumulative position count, while the generation of line scan trigger signals for the linear scan camera based on encoder pulses is prohibited. Once the seam area has been passed, the acquisition gate prohibition pulse is released, the line scan trigger of the linear scan camera is restored, and the longitudinal coordinate reference for the restoration of acquisition is used as the current encoder cumulative position count, and the longitudinal coordinate information of subsequent image sequences is updated.
[0028] It should be noted that determining the prohibited area for line scan by the linear array camera based on the starting point position marker corresponding to the acquisition gating prohibition pulse and the physical width of the candidate seam is a key step in transforming the abstract seam detection result into a precise control sequence that can be executed by the camera hardware. The starting point position marker marks the absolute coordinates of the seam front edge in the longitudinal direction of the fabric, and the physical width of the candidate seam defines the spatial span of the seam in the longitudinal direction. Together, they determine the physical range that needs to be shielded for image acquisition. To avoid artifacts left at the seam edge due to detection delay or mechanical vibration, a safety margin is usually added before and after the physical width of the candidate seam as the actual prohibited area. For example, in a silk inspection system, the encoder cumulative position corresponding to the starting point position marker is 5000.00mm, the physical width of the candidate seam is 12mm, and the system sets a safety margin of 2mm before and after. Then, the starting point of the line scan prohibited area is 4998.00mm and the ending point is 5014.00mm. This area covers the seam body and possible transition areas, ensuring that the image does not contain any seam traces when the acquisition is restored. Within the prohibited line scan range, outputting the acquisition gate prohibition pulse to the line scan camera's hardware trigger port to stop the line scan trigger signal is a reliable means of pausing image acquisition through hardware interrupt. The line scan trigger signal of the line scan camera is usually generated by dividing or multiplying the encoder pulse to ensure that the vertical resolution of the image is synchronized with the fabric's movement speed. When the acquisition gate prohibition pulse is applied to the camera's hardware trigger port, the camera's internal trigger circuit is forcibly blocked. Even if external encoder pulses are continuously input, the camera will not perform photosensitive and readout operations, thus preventing the generation of images in the seam area from the source. Compared to software-level frame dropping or post-processing, hardware-triggered prohibition has microsecond-level response speed and deterministic timing, and will not cause missed or multiple prohibitions due to operating system scheduling jitter or communication delays. For example, in a high-speed non-woven fabric production line, the fabric speed reaches 60m / min. After the rising edge of the acquisition gate prohibition pulse reaches the camera trigger port, the camera completes the trigger block within 3μs. During the passage of the entire 12mm wide seam, a total of about 480 encoder pulses are generated, and the camera does not respond, achieving zero frame mis-sampling. The core mechanism for maintaining longitudinal coordinate continuity is to keep the encoder pulse counting module receiving encoder pulses and updating the cumulative position count during the line scan prohibition period, while prohibiting the generation of line scan trigger signals for the linear scan camera based on encoder pulses. The encoder pulse counting module operates independently of the camera trigger link, and its cumulative position count always accurately reflects the actual distance traveled by the fabric. If counting stops during the prohibition period, the vertical coordinate of the image after acquisition resumes will show a discontinuity equal to the seam width, causing subsequent splicing, positioning, or defect tracing functions to fail. By decoupling the counting and triggering paths, it is ensured that the camera does not acquire invalid images and that the spatial reference is continuously accumulated. For example, in the aforementioned silk inspection case, within the prohibited range of 4998.00mm to 5014.00mm, the encoder counting module continuously accumulated 320 pulses, and the accumulated position was smoothly updated from 4998.00mm to 5014.00mm. During the same period, the camera trigger signal generation circuit was disabled and did not output any line trigger pulses. When the prohibition is lifted, the vertical coordinate of the first frame image of the camera directly inherits 5014.00mm, and there is a seamless connection between it and the coordinate of the last frame before prohibition, 4998.00mm, without any coordinate jumps or repetitions in between. Once the seam area is passed, the acquisition gating prohibition pulse is released to restore the linear scan camera's line scan trigger. The current encoder's cumulative position count is used as the longitudinal coordinate reference for resuming acquisition, and the longitudinal coordinate information of subsequent image sequences is updated. This is the ultimate guarantee for achieving automatic reset of the acquisition process and continuity of data flow. The timing of the release is determined by the end point of the line scan prohibition interval. When the encoder's cumulative position exceeds the end point coordinate, the acquisition gating prohibition pulse is immediately removed, and the camera trigger circuit resumes its response to the encoder pulse. At this point, the vertical coordinate of the first frame image of the camera is strictly equal to the cumulative position value of the encoder at the instant of release. The vertical coordinate of each subsequent frame image increases by the pulse equivalent based on this, ensuring that the image sequence of the entire roll of fabric forms a monotonically increasing, uninterrupted, and non-overlapping complete spatial mapping in the vertical direction. For example, in the detection of a tire cord fabric, the end point of the prohibited interval is 8014.00mm. When the encoder count reaches 8014.00mm, the prohibited pulse is removed, and the camera immediately triggers the acquisition of the first frame on the rising edge of the next encoder pulse. The vertical coordinate of this frame is marked as 8014.00mm. After that, for each encoder pulse with a pulse equivalent of 0.05mm received, the vertical coordinate is updated to 8014.05mm, 8014.10mm, etc., which is completely consistent with the image sequence before prohibition in terms of database index and physical space, supporting the downstream defect location module to accurately trace back the actual position of the fabric corresponding to any pixel.
[0029] In an optional embodiment, a sequence of valid fabric images is input into a pre-trained defect detection model to obtain textile defect detection results, including: Based on the longitudinal coordinate information corresponding to the effective fabric image sequence, the effective fabric image sequence is divided into continuous image regions to obtain multiple image units to be detected. Each image unit to be detected is input into a pre-trained defect detection model to extract the defect feature information corresponding to each image unit to be detected. Based on the defect feature information and vertical coordinate information corresponding to each image unit to be detected, cross-image unit association matching is performed on the candidate defect targets in each image unit to be detected to obtain the textile defect detection result.
[0030] It should be noted that dividing the effective fabric image sequence into multiple image units to be detected by dividing the effective fabric image sequence into continuous image regions based on the vertical coordinate information corresponding to the effective fabric image sequence is the basic operation of discretizing the infinitely long fabric image stream into standard input blocks that the model can process. Since the images acquired by the line scan camera are continuous rows of pixels in the vertical direction, and the defect detection model usually has a fixed input size limit, it is necessary to divide the image stream into several units of fixed height according to the vertical coordinate. In order to ensure that defects across units are not truncated and lost, a certain proportion of overlap area is usually set between adjacent units. For example, in a denim detection system, the model input height is 1024 pixels, corresponding to a fabric vertical length of 51.2 mm. The system sets the overlap area height to 256 pixels, or 12.8 mm. Then the vertical coordinate range of the first image unit to be detected is 0 mm to 51.2 mm, the second unit is 38.4 mm to 89.6 mm, the third unit is 76.8 mm to 128.0 mm, and so on, to ensure that defects at any position appear completely in at least one unit. Inputting each image unit to be detected into a pre-trained defect detection model to extract the defect feature information corresponding to each image unit is the core step in semantic parsing of local images using a deep learning model. The pre-trained defect detection model is trained on a large number of historical labeled samples and can output the bounding box coordinates, class confidence, and high-dimensional feature vectors of candidate defect targets. It includes a feature extraction network, a feature fusion network, and a detection head. The feature extraction network adopts a ResNet50 structure, and the feature fusion network adopts an FPN structure. The input is an RGB fabric image patch with a size of H×W×3, and the output includes defect class probability, bounding box coordinates, and pixel-level mask. Its training method utilizes... Supervised training was conducted on fabric image samples labeled with categories such as holes, oil stains, weft skew, and warp breaks, using a combination of cross-entropy loss and bounding box regression loss function for optimization. This feature vector encodes deep semantic information about the defects, including texture, shape, and contrast, serving as the basis for subsequent cross-unit association matching. For example, in the detection of a polyester fabric, a given image unit outputs two candidate defect targets after model inference: the first is a weft skew defect located at the unit's vertical coordinate of 42.0 mm, with a confidence level of 0.92 and a feature vector dimension of 256; the second is an oil stain located at the unit's vertical coordinate of 48.5 mm, with a confidence level of 0.87 and a feature vector dimension of 256. Both are retained for subsequent association matching. Based on the defect feature information and vertical coordinate information of each image unit to be detected, cross-image unit association matching is performed on the candidate defect targets in each image unit to obtain the textile defect detection result. This is a key post-processing step to solve the problem of the same defect being split into multiple segments due to image segmentation. Due to the existence of overlapping areas, the same physical defect may be detected in two adjacent units. If association and merging are not performed, it will lead to duplicate counting and size misjudgment. Association matching comprehensively considers the triple constraints of spatial proximity, feature similarity and vertical coordinate continuity. Only when all three are satisfied is it identified as the same target. For example, in the aforementioned polyester fabric case, the first unit detects an oil stain at the vertical coordinate of 48.5mm. The second unit also detects the same type of oil stain at the vertical coordinate of 48.5mm (corresponding to 9.7mm in its own coordinate system). The two have the same vertical coordinate, the cosine similarity of the feature vector reaches 0.96, and they are located in the overlapping area. The system determines that they are the same defect and merges them into a complete target. In the final output textile defect detection result, the oil stain is recorded only once, and the vertical span accurately reflects the true size.
[0031] In an optional embodiment, the candidate defect targets in each image unit to be detected are associated and matched based on the defect feature information and vertical coordinate information corresponding to each image unit to be detected, including: Obtain the coordinate overlap region between adjacent image units to be detected; The correlation between candidate defect targets is calculated based on the positional relationship, texture feature similarity, and vertical coordinate continuity of the candidate defect targets within the coordinate overlap area. When the correlation is greater than the preset correlation threshold, the corresponding candidate defect targets are identified as the same defect target, and the targets are merged to obtain a continuous defect area.
[0032] It should be noted that obtaining the coordinate overlap region between adjacent image units to be detected provides the spatial intersection basis for cross-unit association matching. The vertical range of the overlap region is determined by the unit division strategy described above, and its physical width is equal to the unit height minus the step distance. Only candidate defect targets that appear simultaneously within the overlap region have the possibility of association. Targets in non-overlapping regions are directly regarded as independent defects because they have no spatial intersection. For example, in the detection of a certain cotton fabric, the unit height is 51.2mm and the step distance is 38.4mm. Then the vertical width of the overlap region between adjacent units is 12.8mm, corresponding to 256 rows of image pixels. If a candidate defect target is completely located within the non-overlapping segment from 0mm to 38.4mm of the first unit, then there is no need to match it with the second unit, and it is directly retained as an independent target. The correlation between candidate defect targets is calculated based on their positional relationship, texture feature similarity, and vertical coordinate continuity within the coordinate overlap area. This is a comprehensive scoring mechanism that quantifies whether two candidate targets belong to the same physical entity. Positional relationship refers to the vertical distance between the center points of the two targets within the overlap area; the smaller the distance, the higher the correlation tendency. Texture feature similarity is measured by the cosine similarity or Euclidean distance of the feature vectors, representing appearance consistency. Vertical coordinate continuity verifies whether the relative positions of the two targets in their respective unit coordinate systems conform to the overlap mapping rule. The three factors are weighted and fused to obtain a normalized correlation score. For example, in the detection of a certain silk, the vertical center distance between two candidate defect targets within the overlap area is 1.5mm, the cosine similarity of the feature vectors is 0.94, and the coordinate mapping deviation is 0.3mm. After weighted calculation, the correlation score is 0.91. The preset correlation threshold is 0.80. Since 0.91 is greater than 0.80, they are judged to be the same defect target. When the correlation is greater than the preset correlation threshold, the corresponding candidate defect targets are identified as the same defect target and the targets are merged to obtain a continuous defect region. This is the final execution step to achieve complete defect reconstruction. Target merging includes operations such as taking the union of bounding boxes, taking the maximum value of confidence, and taking the mean of feature vectors. The generated new target inherits all the spatial and semantic information of the original fragment. The merged continuous defect region is seamlessly connected in the vertical coordinate, providing an accurate geometric basis for subsequent quality rating. For example, in the silk case mentioned above, the two candidate targets are merged to form a new defect target. Its vertical coordinate range extends from 46.0mm in the first unit to 53.0mm in the second unit (corresponding to the global coordinate 53.0mm), with a total span of 7.0mm. The confidence is 0.93, and the feature vector is the mean of the two. This continuous defect region is output as the final detection result.
[0033] In an optional embodiment, after merging the candidate defect targets, the method further includes: Obtain the vertical coordinate interval corresponding to the candidate defect target, and determine whether the vertical coordinate interval overlaps with the row scan prohibited interval; When the vertical coordinate interval corresponding to the candidate defect target overlaps with the row scan prohibited interval, the seam authenticity is determined for the candidate defect target. Output textile defect detection results based on the seam authenticity determination results.
[0034] It should be noted that obtaining the vertical coordinate interval corresponding to the candidate defect target and determining whether the vertical coordinate interval overlaps with the line scan prohibition interval is a preliminary screening condition for identifying potential seam false defects. The line scan prohibition interval is the physical coordinate range set in the previous step to mask the seam image. Any candidate defect target that intersects with this interval may not be a real fabric defect, but a false detection caused by residual signals at the seam edge or texture distortion in the transition area. This step divides all candidate targets into two categories: those that do not overlap with the prohibition interval are directly identified. The defect is considered genuine; those with overlap are included in the seam authenticity determination process. For example, in the inspection of a certain linen fabric, the prohibited area for horizontal scanning is 100.00mm to 114.00mm, and the longitudinal coordinate range of a candidate defect target is 112.00mm to 118.00mm. The two overlap by 2mm in the 112.00mm to 114.00mm segment, and this target is marked as an object to be judged; another candidate target range is 120.00mm to 125.00mm, which has no intersection with the prohibited area, and is directly retained as a genuine defect. When the longitudinal coordinate interval corresponding to a candidate defect target overlaps with the prohibited line scan interval, the system performs a seam authenticity determination on the candidate defect target. This is the core protection mechanism that distinguishes between real defects and seam artifacts through a specially designed identification logic. Since the seam area itself is prohibited from being collected, theoretically no defect detection results should be generated. However, in practice, due to insufficient safety buffer, mechanical vibration, or limitations in model generalization, the seam transition area may still be falsely reported. This determination process does not rely on a general defect model, but is based on the unique mechanical and textural priors of the seam for targeted verification, avoiding misjudging normal seam structures as fabric defects. For example, in the aforementioned linen fabric case, when candidate targets with longitudinal coordinates from 112.00mm to 118.00mm enter the authenticity determination process, the system will call the reference background sample within the seam transition analysis zone to compare the difference with it, rather than simply selecting based on the confidence threshold.
[0035] In an optional embodiment, when the vertical coordinate interval corresponding to the candidate defect target overlaps with the line scan prohibition interval, a seam authenticity determination is performed on the candidate defect target, including: Based on the starting and ending boundaries of the line scan prohibited area, a preset safety buffer width is extended to both sides of the line scan prohibited area to construct a seam transition analysis zone. Extract the effective fabric image region located within the seam transition analysis zone and outside the line scan prohibited zone, and use it as a reference background sample; The regions corresponding to the candidate defect targets are mapped to the spatial coordinate system of the seam transition analysis zone, and the difference between the defect feature information corresponding to the candidate defect targets and the defect feature information at the corresponding positions of the reference background samples is calculated to obtain the seam residual features. Calculate the local energy value and spatial continuity index of the joint residual characteristics; When the local energy value exceeds the preset energy threshold and the spatial continuity index meets the preset defect morphology constraint, the candidate defect target is determined as the real defect target and retained in the textile defect detection result. Otherwise, candidate defect targets are identified as pseudo-defect targets caused by seam structure and filtered out from the textile defect detection results.
[0036] It should be noted that the seam transition analysis zone is constructed by extending a preset safety buffer width to both sides of the starting and ending boundaries of the prohibited area for line scanning. This defines a dedicated analysis domain for determining the authenticity of the seam. The setting of the safety buffer width takes into account the tension release trails, weaving structure adjustment areas, and image splicing errors that may exist before and after the seam. It is usually set to a value greater than the safety margin of the prohibited area for line scanning itself. The seam transition analysis zone covers the complete physical transition process from the normal fabric segment to the seam and back to the normal fabric segment, providing ample space for extracting a clean reference background. For example, in the inspection of a tire cord fabric, the prohibited area for line scanning is 200.00mm to 214.00mm, and the safety buffer width is set to 10mm. Then, the range of the seam transition analysis zone is 190.00mm to 224.00mm. Among them, the two segments from 190.00mm to 200.00mm and from 214.00mm to 224.00mm are effective fabric image areas, which can be used to extract reference background samples that are not affected by the seam. Extracting a valid fabric image region located within the seam transition analysis zone and outside the prohibited area of line scanning as a reference background sample serves as a benchmark for obtaining a control that shares the same fabric type and lighting conditions as the candidate defect target but is free from seam interference. The reference background sample is spatially adjacent to the candidate target and statistically represents the background characteristics of normal fabric at that location; any difference between the two can be attributed to the seam or the actual defect. For example, in the aforementioned tire cord fabric case, the candidate defect target is located between 212.00mm and 218.00mm. The segment from 212.00mm to 214.00mm has no image within the prohibited area, while the segment from 214.00mm to 218.00mm is within the analysis zone and has an image. The system extracts a valid image from the segment from 214.00mm to 224.00mm as a reference background sample. This image is vertically adjacent to the candidate target, and its lighting and fabric condition are highly consistent, providing a reliable benchmark for subsequent difference calculations. Mapping the region corresponding to the candidate defect target to the spatial coordinate system of the seam transition analysis zone and calculating the difference between the defect feature information corresponding to the candidate defect target and the defect feature information at the corresponding position of the reference background sample to obtain the seam residual feature is the core operation for quantifying the degree of deviation of the candidate target from the normal fabric surface. The mapping ensures that the two are compared point by point at the same physical position. The difference calculation can be carried out by means of feature vector difference, gray residual, or frequency domain energy difference, etc. The obtained seam residual feature highlights the abnormal components of the candidate target relative to the normal fabric surface. If the candidate target is actually a seam artifact, its residual feature will show the symmetry or periodicity unique to the seam. If it is a real defect, the residual feature will show local abrupt changes or unstructured noise. For example, in the detection of a certain canvas, the difference between the feature vector of the candidate target and the feature vector at the corresponding position of the reference background is used to obtain a 256-dimensional seam residual vector. Its first 32 dimensions are significantly higher than the other dimensions, indicating that the anomaly is concentrated in a specific texture frequency band, which is consistent with the characteristics of a real hole defect. The residual vector of another candidate target is uniformly low in all dimensions, showing a typical seam gradient pattern.
[0037] Calculating the local energy value and spatial continuity index of seam residual features involves secondary discrimination of seam residuals from two dimensions: intensity and morphology. The local energy value reflects the overall intensity of the residual signal; real defects typically have high energy concentration characteristics. The spatial continuity index measures the smoothness of the residual's change within its neighborhood; real defects often have clear boundaries and discontinuous jumps, while the residual of seam artifacts exhibits slow, gradual high continuity. The combination of these two factors can effectively separate real and false targets. For example, in the aforementioned canvas case, the local energy value of the seam residual corresponding to a real hole is 0.85, and the spatial continuity index is 0.22 (low continuity); while the local energy value corresponding to a seam artifact is 0.31, and the spatial continuity index is 0.78 (high continuity). With a preset energy threshold of 0.50 and a preset defect morphology constraint that the spatial continuity index is below 0.40, the hole target satisfies both conditions and is retained, while the artifact target is filtered out due to insufficient energy and excessive continuity. When the local energy value exceeds the preset energy threshold and the spatial continuity index meets the preset defect morphology constraint, the candidate defect target is identified as a real defect target and retained in the textile defect detection result. Otherwise, the candidate defect target is identified as a false defect target caused by the seam structure and filtered out from the textile defect detection result. This is the final decision-making output for the seam authenticity determination. This decision logic ensures that only candidate targets with sufficient abnormal intensity and conforming to the defect morphology characteristics can pass the verification, minimizing the false alarm rate of the seam area and avoiding the omission of rare defects that truly cross the seam boundary. For example, in the detection of a certain blended fabric, a candidate target with a local energy value of 0.62 is greater than the threshold of 0.50 and a spatial continuity index of 0.35 is lower than the constraint upper limit of 0.40. It is determined to be a real weft defect and retained. Another candidate target with a local energy value of 0.48 is lower than the threshold. Even though the spatial continuity index of 0.28 meets the constraint, it is still determined to be a seam artifact due to insufficient intensity and removed from the result. The final output textile defect detection result only contains real defects that have been doubly verified, ensuring the accuracy of downstream quality rating.
[0038] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited thereto. Various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention.
Claims
1. A method for online detection of textile defects based on a linear scan camera and deep learning, characterized in that, include: The height profile sequence of the fabric surface is acquired in real time by a laser displacement sensor, and the encoder phase signal and the guide roller tension signal are acquired simultaneously. The height change rate is obtained by performing a differential operation on the height profile sequence. When the height change rate exceeds a set threshold and the continuous width meets the physical characteristics of the seam, a suspected seam trigger signal is generated. In response to a suspected seam trigger signal, the encoder phase jitter amplitude and the tension transient drop slope at the current moment are extracted from the encoder phase signal and the guide roller tension signal. The encoder phase jitter amplitude, tension transient drop slope and suspected seam trigger signal are time-aligned and verified. When all three meet the seam mechanical response conditions, a data acquisition gate prohibition pulse is generated. The hardware trigger port of the acquisition gate prohibition pulse input line scan camera is controlled to stop responding to the encoder trigger line scan signal during the seam passage, so as to pause the acquisition of seam area image and send counting control command to encoder counting module to maintain longitudinal coordinate continuity. The effective fabric image sequence output by the line scan camera is obtained, and the effective fabric image sequence is input into the pre-trained defect detection model to obtain the textile defect detection result.
2. The online textile defect detection method based on a linear array camera and deep learning according to claim 1, characterized in that, The height change rate is obtained by differentiating the height profile sequence. When the height change rate exceeds a set change threshold and the continuous width meets the physical characteristics of the seam, a suspected seam trigger signal is generated, including: Using the encoder pulse interval as a spatial reference, the height difference between adjacent sampling points in the height profile sequence is divided by the corresponding encoder pulse interval to obtain the height change rate that eliminates the influence of fabric speed fluctuation. The height change rate is compared point by point with the preset rising edge threshold and falling edge threshold, and the starting point exceeding the rising edge threshold and the ending point below the falling edge threshold are marked. Calculate the number of sampling points between each starting point and the corresponding ending point, and multiply the number of sampling points by the current encoder pulse equivalent to obtain the physical width of the candidate seam; Perform contour feature verification on the height change rate curve corresponding to the physical width of the candidate joint. When the physical width of the candidate joint is within the preset joint width range, the extreme value of the height change rate between the start point and the end point exceeds the amplitude verification threshold, and the height change rate forms a continuous abrupt change contour with obvious rising and falling segments between the start point and the end point, the area corresponding to the physical width of the candidate joint is determined to be the true thickness abrupt change area, and a suspected joint trigger signal containing the start point position identifier and the physical width of the candidate joint is output.
3. The online textile defect detection method based on a linear array camera and deep learning according to claim 2, characterized in that, In response to a suspected seam trigger signal, the encoder phase jitter amplitude and tension transient drop slope at the current moment are extracted from the encoder phase signal and the guide roller tension signal, including: Using the starting point position identifier in the suspected seam trigger signal as a unified timing reference, the corresponding encoder analysis window is located in the encoder phase signal, and the corresponding tension analysis window is located in the guide roller tension signal; wherein, the width of both the encoder analysis window and the tension analysis window is determined based on the physical width of the candidate seam; Read the original encoder pulse sequence in the encoder analysis window and calculate the encoder phase jitter amplitude based on the standard deviation of adjacent encoder pulse periods; The tension sensor output signal is read in the tension analysis window, and the tension change rate sequence is obtained by performing differential operation on the tension sensor output signal. Extract the rapidly decreasing tension segment from the tension change rate sequence, and calculate the slope of the rapidly decreasing tension segment as the transient drop slope of tension.
4. The online textile defect detection method based on a linear array camera and deep learning according to claim 3, characterized in that, The encoder phase jitter amplitude, tension transient drop slope, and suspected seam trigger signal are time-aligned and verified. When all three satisfy the seam mechanical response condition, a data acquisition gating prohibition pulse is generated, including: Using the starting point location marker in the suspected seam trigger signal as a unified timing reference, a corresponding seam event timeline is established. The encoder phase jitter amplitude corresponding to the encoder analysis window and the tension transient drop slope corresponding to the tension analysis window are mapped to the seam event time axis respectively. The time point corresponding to the peak value of the encoder phase jitter is taken as the encoder response time, and the time point corresponding to the maximum value of the tension transient drop slope is taken as the tension response time. Calculate the first time offset between the encoder response time and the time corresponding to the starting point position mark, and the second time offset between the tension response time and the time corresponding to the starting point position mark. The first time offset and the second time offset are compared with the preset response tolerance window respectively. When the first time offset is within the encoder response tolerance window and the second time offset is within the tension response tolerance window, it is determined that the encoder phase jitter amplitude, the tension transient drop slope and the suspected seam trigger signal meet the timing consistency. When the timing consistency is satisfied, and the encoder phase jitter amplitude is greater than the preset phase jitter threshold and the tension transient drop slope is less than the preset tension drop threshold, a data acquisition gate prohibition pulse is generated.
5. The online textile defect detection method based on a linear array camera and deep learning according to claim 4, characterized in that, The control line scan camera stops responding to encoder-triggered line scan signals during seam passage to pause image acquisition in the seam area and sends counting control commands to the encoder counting module to maintain longitudinal coordinate continuity, including: Based on the starting point position marker corresponding to the acquired gating prohibition pulse and the physical width of the candidate seam, the prohibited area for line scanning of the linear scan camera is determined; Within the prohibited line scan range, the acquisition gate prohibition pulse is output to the hardware trigger port of the line scan camera, so that the line scan camera stops generating line scan trigger signals; During the period when line scanning is prohibited, the encoder pulse counting module continues to receive encoder pulses and update the cumulative position count, while the generation of line scan trigger signals for the linear scan camera based on encoder pulses is prohibited. Once the seam area has been passed, the acquisition gate prohibition pulse is released, the line scan trigger of the linear scan camera is restored, and the longitudinal coordinate reference for the restoration of acquisition is used as the current encoder cumulative position count, and the longitudinal coordinate information of subsequent image sequences is updated.
6. The online textile defect detection method based on a linear array camera and deep learning according to claim 5, characterized in that, Inputting a sequence of valid fabric images into a pre-trained defect detection model yields textile defect detection results, including: Based on the longitudinal coordinate information corresponding to the effective fabric image sequence, the effective fabric image sequence is divided into continuous image regions to obtain multiple image units to be detected. Each image unit to be detected is input into a pre-trained defect detection model to extract the defect feature information corresponding to each image unit to be detected. Based on the defect feature information and vertical coordinate information corresponding to each image unit to be detected, cross-image unit association matching is performed on the candidate defect targets in each image unit to be detected to obtain the textile defect detection result.
7. The online textile defect detection method based on a linear array camera and deep learning according to claim 6, characterized in that, Based on the defect feature information and vertical coordinate information corresponding to each image unit to be detected, the candidate defect targets in each image unit to be detected are associated and matched, including: Obtain the coordinate overlap region between adjacent image units to be detected; The correlation between candidate defect targets is calculated based on the positional relationship, texture feature similarity, and vertical coordinate continuity of the candidate defect targets within the coordinate overlap area. When the correlation is greater than the preset correlation threshold, the corresponding candidate defect targets are identified as the same defect target, and the targets are merged to obtain a continuous defect area.
8. The online textile defect detection method based on a linear array camera and deep learning according to claim 7, characterized in that, After merging the candidate defective targets, the following is also included: Obtain the vertical coordinate interval corresponding to the candidate defect target, and determine whether the vertical coordinate interval overlaps with the row scan prohibited interval; When the vertical coordinate interval corresponding to the candidate defect target overlaps with the row scan prohibited interval, the seam authenticity is determined for the candidate defect target. Output textile defect detection results based on the seam authenticity determination results.
9. The online textile defect detection method based on a linear array camera and deep learning according to claim 8, characterized in that, When the vertical coordinate interval corresponding to a candidate defective target overlaps with the row scan prohibited interval, a seam authenticity determination is performed on the candidate defective target, including: Based on the starting and ending boundaries of the line scan prohibited area, a preset safety buffer width is extended to both sides of the line scan prohibited area to construct a seam transition analysis zone. Extract the effective fabric image region located within the seam transition analysis zone and outside the line scan prohibited zone, and use it as a reference background sample; The regions corresponding to the candidate defect targets are mapped to the spatial coordinate system of the seam transition analysis zone, and the difference between the defect feature information corresponding to the candidate defect targets and the defect feature information at the corresponding positions of the reference background samples is calculated to obtain the seam residual features. Calculate the local energy value and spatial continuity index of the joint residual characteristics; When the local energy value exceeds the preset energy threshold and the spatial continuity index meets the preset defect morphology constraint, the candidate defect target is determined as the real defect target and retained in the textile defect detection result. Otherwise, candidate defect targets are identified as pseudo-defect targets caused by seam structure and filtered out from the textile defect detection results.
