A yarn defect recognition system based on visual inspection

CN122597359APending Publication Date: 2026-08-18YUNCHENG XINGZE TEXTILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610764705.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-29
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]采集到的纱线图像易受振动、光照波动和背景干扰影响,导致主体区域提取不稳定,纱线中心轨迹与边界位置容易发生偏移,影响后续检测结果的可靠性;针对毛羽、粗节、细节和污点等形态差异明显的瑕疵,传统固定窗口纹理分析方法缺乏对纱线局部宽度变化和边界过渡特征的自适应能力,容易造成特征表达失真和瑕疵区段混淆;对于连续运行纱线形成的时序图像,现有方法往往缺少沿纱线连续长度方向的统一响应组织与反向复核机制,导致相邻异常区间难以准确拼接,重复报警、漏检和误分级问题较为突出

Benefits of technology

[0063] Compared with existing yarn detection methods that rely on simple threshold segmentation, diameter measurement, or single-frame texture analysis, this invention constructs a complete technical chain around image frame sequence generation, subject segmentation, local scale parameter extraction, sampling window group construction, improved MRELBP texture code generation, abnormal response sequence and candidate defect segment generation, target defect segment generation, and classification and hierarchical output. It can stably extract the yarn center trajectory and boundary point set from continuously running yarn images, and form a local scale parameter set by combining projection spacing and grayscale transition width in the local axial coordinate system. This makes the texture analysis process no longer dependent on fixed windows and fixed sampling structures, thereby effectively reducing the impact of yarn sway, width fluctuation, boundary blurring, and background interference on feature extraction, and improving the accuracy and stability of defect characterization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597359A_ABST
    Figure CN122597359A_ABST
Patent Text Reader

Abstract

The application discloses a yarn defect identification system based on visual detection, comprising: an image frame sequence generation module for forming an image frame sequence; a main body segmentation module for extracting a yarn center track and a boundary point set; a local scale parameter set generation module for forming a local scale parameter set; a sampling window group construction module for forming a sampling window group; an improved MRELBP texture code generation module for forming an improved MRELBP texture code; an abnormal response sequence and candidate defect segment generation module for forming an abnormal response sequence and a candidate defect segment; a target defect segment generation module for forming a target defect segment; and a classification grading output module for outputting a yarn defect type, a defect position and a defect level. The application improves yarn defect identification precision, positioning accuracy and online detection stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision technology, and in particular to a yarn defect recognition system based on visual inspection. Background Technology

[0002] With the continuous improvement of automation levels and the increasing demand for online quality control in textile manufacturing, defect identification and grading technologies during yarn processing have received widespread attention. Existing yarn inspection equipment mainly relies on simple threshold segmentation, diameter measurement, or single-frame texture analysis for defect identification, but these methods generally suffer from the following problems in practical applications:

[0003] The acquired yarn images are susceptible to vibration, lighting fluctuations, and background interference, leading to unstable extraction of the main area and easy deviation of the yarn center trajectory and boundary position, affecting the reliability of subsequent detection results. For defects with obvious morphological differences such as hairiness, thick knots, fine details, and stains, traditional fixed-window texture analysis methods lack the ability to adapt to local width changes and boundary transition features of the yarn, which can easily cause feature expression distortion and confusion of defect segments. For time-series images formed by continuously running yarns, existing methods often lack a unified response organization and reverse verification mechanism along the continuous length of the yarn, making it difficult to accurately stitch adjacent abnormal intervals, resulting in prominent problems of repeated alarms, missed detections, and misclassification.

[0004] Therefore, how to provide a yarn defect identification system based on visual inspection is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] One objective of this invention is to propose a yarn defect recognition system based on visual inspection. This invention employs an improved MRELBP texture encoding, continuous length coordinate unrolling, and forward accumulation combined with reverse rollback verification to identify, locate, and classify defective segments in continuous yarn images. It has the advantages of high recognition accuracy, strong anti-interference ability, and good online detection stability.

[0006] A yarn defect identification system based on visual detection according to an embodiment of the present invention includes:

[0007] The image frame sequence generation module is used to acquire continuous images of yarn and form an image frame sequence;

[0008] The main body segmentation module is used to perform main body segmentation on the image frame sequence and extract the yarn center trajectory and boundary point set;

[0009] The local scale parameter set generation module is used to set sampling positions along the yarn center trajectory, establish a local axial coordinate system, project the boundary point set onto the normal direction, and form a local scale parameter set.

[0010] The sampling window group construction module is used to set the center sampling window, the nearest sampling window, and the far neighbor sampling window in the local axial coordinate system;

[0011] An improved MRELBP texture code generation module is used to adjust the nearest and far neighbor sampling windows according to the local scale parameter set, calculate the median of the pixels covered by the center sampling window, the nearest sampling window, and the far neighbor sampling window, and perform MRELBP encoding to form an improved MRELBP texture code.

[0012] The module for generating abnormal response sequences and candidate defective segments is used to unfold the improved MRELBP texture code along the center trajectory of the yarn to a continuous length coordinate, and perform segment splicing according to the response difference between adjacent sampling positions to form abnormal response sequences and candidate defective segments.

[0013] The target defect segment generation module is used to perform forward accumulation and reverse rollback verification on candidate defect segments to form target defect segments;

[0014] The classification and grading output module is used to perform classification and grading based on the segment length, width variation, and texture jump variable of the target defect segment, and output the yarn defect type, defect location, and defect level.

[0015] Optionally, the image frame sequence generation module specifically comprises:

[0016] Continuous imaging sampling is performed on the imaging area where the running yarn is located to form a continuous image of the yarn;

[0017] The continuous yarn image is segmented frame by frame according to a preset sampling frequency, and the acquisition time of each frame is marked to form an image frame set.

[0018] The frame images in the image frame set are arranged in the execution time sequence from front to back according to the acquisition time to form the initial image frame sequence;

[0019] A consistency check is performed on the time interval between adjacent frames in the initial image frame sequence, and the position of frames whose time interval deviates from the preset sampling frequency is adjusted to form an image frame sequence.

[0020] Optionally, the main body segmentation module specifically comprises:

[0021] The frame images in the image frame sequence are converted into grayscale images, and the yarn area is separated from the background area according to the grayscale value distribution to form the initial subject area;

[0022] For the connected regions in the initial main region, calculate the area value, length value and main extension direction of each connected region. Retain the connected regions whose area value meets the lower limit condition, whose length value meets the lower limit condition and whose main extension direction is consistent with the yarn running direction to form the yarn main region.

[0023] The centerline is refined within the main yarn area to obtain the main skeleton. Then, curve fitting is performed along the pixel arrangement order of the main skeleton to form the yarn center trajectory.

[0024] Contour tracking is performed along the outer edge of the main yarn area to extract contour pixels. Then, the contour pixels are aggregated according to their positional relationship on both sides of the yarn center trajectory to form a boundary point set.

[0025] Optionally, the local scale parameter set generation module specifically comprises:

[0026] Accumulate arc length along the center trajectory of the yarn at a fixed trajectory step size. When the accumulated arc length reaches the fixed trajectory step size, intercept the trajectory point and determine the trajectory point as the sampling position.

[0027] Around each sampling position, extract trajectory points located on both sides of the sampling position and adjacent to the sampling position. Perform line fitting on the adjacent trajectory points on both sides of the sampling position and determine the extension direction of the fitted line as the tangent direction.

[0028] With the sampling position as the origin and the tangent direction as the axial direction, a direction perpendicular to the tangent direction is established at the sampling position as the normal direction, and a local axial coordinate system is established with the axial direction and the normal direction.

[0029] Around each sampling location, the neighboring boundary points in the boundary point set are extracted, and the neighboring boundary points are mapped to the local axial coordinate system. The projection distance from the neighboring boundary points on both sides of the yarn center trajectory to the sampling location is calculated along the normal direction, and the sum of the projection distances on both sides is determined as the projection spacing.

[0030] At each sampling location, extract the grayscale profile passing through the sampling location along the normal direction, perform boundary positioning on the continuous interval of grayscale change in the grayscale profile, and determine the interval span of grayscale value transition from the yarn area to the background area as the grayscale transition width.

[0031] The projection spacing and grayscale transition width corresponding to each sampling position are merged according to the arrangement order of the sampling positions on the yarn center trajectory to form a local scale parameter set.

[0032] Optionally, the sampling window group construction module specifically comprises:

[0033] At each sampling location, the sampling location is determined as the center positioning point, and a window area is intercepted around the center positioning point along the axial direction and the normal direction in the local axial coordinate system to form the center sampling window;

[0034] Nearest neighbor positioning points are determined on both sides of the central positioning point along the normal direction, so that the nearest neighbor positioning points are located close to the central positioning point. A window area is intercepted around the nearest neighbor positioning points along the axial direction and the normal direction to form a nearest neighbor sampling window.

[0035] Determine neighboring locations on both sides of the central location point along the normal direction, so that the neighboring locations are located far away from the central location point. Then, extract window areas around the neighboring locations along the axial direction and the normal direction to form a neighboring sampling window.

[0036] Make the boundaries of the center sampling window, the nearest sampling window, and the far neighbor sampling window parallel to the axial direction and the normal direction, respectively, and position the nearest neighbor sampling window between the center sampling window and the far neighbor sampling window;

[0037] The central sampling window, the nearby sampling window, and the distant sampling window are arranged in the order of their sampling positions on the yarn center trajectory to form a sampling window group.

[0038] Optionally, the improved MRELBP texture code generation module specifically comprises:

[0039] The local scale parameter set is matched with the sampling window group execution position according to the arrangement order of the sampling position on the yarn center trajectory. The projection spacing and grayscale transition width are written into the center sampling window, the nearest sampling window and the far neighbor sampling window corresponding to the sampling position.

[0040] Adjust the offset distance of the nearest and far neighbor sampling windows in the normal direction according to the projection spacing, adjust the window length of the nearest and far neighbor sampling windows in the axial direction and the window width in the normal direction according to the grayscale transition width, and keep the center sampling window located at the center positioning point.

[0041] Median calculation is performed on the pixels covered by the central sampling window to form the central median. Median calculation is also performed on the pixels covered by the nearest and far neighbor sampling windows on the positive side of the normal direction to form the positive nearest neighbor median and the positive far neighbor median. Median calculation is also performed on the pixels covered by the nearest and far neighbor sampling windows on the negative side of the normal direction to form the negative nearest neighbor median and the negative far neighbor median.

[0042] Using the central median as a reference, calculate the median difference between the median of the forward nearest neighbors and the central median, calculate the median difference between the median of the reverse nearest neighbors and the central median, calculate the median difference between the median of the forward distant neighbors and the central median, and calculate the median difference between the median of the reverse distant neighbors and the central median.

[0043] Nearest neighbor and far neighbor codes are generated based on the positive and negative states of the median difference, and the codes are combined according to the arrangement of the positive side of the normal direction and the negative side of the normal direction to form an improved MRELBP texture code.

[0044] Optionally, the abnormal response sequence and candidate defect segment generation module specifically comprises:

[0045] Arc length accumulation is performed along the yarn center trajectory in the order of sampling positions. The accumulated arc length corresponding to each sampling position is determined as the position value in the continuous length coordinate. The improved MRELBP texture code corresponding to each sampling position is associated with the position value to form a length texture record set.

[0046] In the length texture record set, the improved MRELBP texture code corresponding to adjacent sampling positions is extracted in order of position value. The code bit comparison is performed on the adjacent improved MRELBP texture codes, the code bit difference value is counted, and the response difference between adjacent sampling positions is formed.

[0047] The intervals where the difference in response between adjacent sampling positions in a continuous length coordinate system is greater than the difference threshold are continuously merged to form an abnormal response interval;

[0048] Compare the length intervals between adjacent abnormal response intervals, and perform segment splicing on adjacent abnormal response intervals whose length intervals are less than the splicing distance threshold to form candidate defective segments;

[0049] The abnormal response intervals are joined according to the order of their continuous length coordinates to form an abnormal response sequence, and the abnormal response sequence and candidate defect segments are output.

[0050] Optionally, the target defect segment generation module specifically comprises:

[0051] Within each candidate defect segment, the response difference in the abnormal response sequence is extracted from the starting position value to the ending position value along the continuous length coordinate, and the response difference is accumulated position by position along the continuous length coordinate to form a forward cumulative sequence;

[0052] Perform a difference comparison on the cumulative increments corresponding to adjacent positions in the forward cumulative sequence, and determine the position where the cumulative increment changes from continuous increase to continuous decrease as the rollback start point;

[0053] Starting from the rollback point, the response difference in the abnormal response sequence is extracted along the continuous length coordinate towards the starting position value, and then accumulated position by position in the rollback direction to form a reverse rollback sequence.

[0054] The cumulative results of the reverse roll-back sequence and the forward cumulative sequence at the same continuous length coordinate position are compared for deviation. The position interval where the cumulative result deviation is less than the roll-back consistency threshold is determined as the valid segment.

[0055] The start and end position values ​​corresponding to the valid segment are separated from the candidate defective segment and the segment is updated to form the target defective segment.

[0056] Optionally, the classification and grading output module specifically comprises:

[0057] Perform difference calculation on the start and end position values ​​of the target defect segment in the continuous length coordinate to form the segment length, and determine the start and end position values ​​as the defect location;

[0058] The projection spacing within the target defect area is extracted from the local scale parameter set. The maximum and minimum values ​​of the projection spacing within the target defect area are calculated, and the difference between the maximum and minimum values ​​is determined as the width change.

[0059] Extract the response difference within the target defect area range from the abnormal response sequence, and perform numerical accumulation or numerical averaging on the response difference within the target defect area range to form a texture jump variable;

[0060] The segment length, width variation, and texture jump variable are compared with the type determination interval, and the target defect segment that meets the type determination interval is determined as the yarn defect type.

[0061] The segment length, width variation, and texture jump variable are compared with the grade judgment interval. The target defect segment that meets the grade judgment interval is determined as the defect grade, and the yarn defect type, defect location, and defect grade are output.

[0062] The beneficial effects of this invention are:

[0063] Compared with existing yarn detection methods that rely on simple threshold segmentation, diameter measurement, or single-frame texture analysis, this invention constructs a complete technical chain around image frame sequence generation, subject segmentation, local scale parameter extraction, sampling window group construction, improved MRELBP texture code generation, abnormal response sequence and candidate defect segment generation, target defect segment generation, and classification and hierarchical output. It can stably extract the yarn center trajectory and boundary point set from continuously running yarn images, and form a local scale parameter set by combining projection spacing and grayscale transition width in the local axial coordinate system. This makes the texture analysis process no longer dependent on fixed windows and fixed sampling structures, thereby effectively reducing the impact of yarn sway, width fluctuation, boundary blurring, and background interference on feature extraction, and improving the accuracy and stability of defect characterization.

[0064] Meanwhile, this invention adjusts the window size and offset distance of the nearest and far-neighbor sampling windows according to the local scale parameter set to form an improved MRELBP texture code. This improved MRELBP texture code is then unfolded along the yarn center trajectory to a continuous length coordinate system. Further combining this with abnormal response interval splicing, candidate defect segment generation, forward accumulation, and reverse rollback verification, it achieves continuous judgment and fine screening of yarn defect segments, effectively reducing single-frame misjudgment, adjacent abnormal interval breakage, repeated alarms, and missed detections. Based on this, classification and grading are performed using segment length, width variation, and texture jump variables, simultaneously outputting the yarn defect type, defect location, and defect level. Therefore, it possesses the beneficial effects of high recognition accuracy, strong anti-interference ability, accurate segment positioning, and good online detection stability. Attached Figure Description

[0065] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0066] Figure 1 This is a structural diagram of a yarn defect identification system based on visual detection proposed in this invention;

[0067] Figure 2 This is a schematic diagram illustrating the generation of an improved MRELBP texture code for a vision-based yarn defect recognition system proposed in this invention. Detailed Implementation

[0068] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0069] refer to Figures 1-2 A vision-based yarn defect identification system includes:

[0070] The image frame sequence generation module is used to acquire continuous images of yarn and form an image frame sequence;

[0071] The main body segmentation module is used to perform main body segmentation on the image frame sequence and extract the yarn center trajectory and boundary point set;

[0072] The local scale parameter set generation module is used to set sampling positions along the yarn center trajectory, establish a local axial coordinate system, project the boundary point set onto the normal direction, and form a local scale parameter set.

[0073] The sampling window group construction module is used to set the center sampling window, the nearest sampling window, and the far neighbor sampling window in the local axial coordinate system;

[0074] An improved MRELBP texture code generation module is used to adjust the nearest and far neighbor sampling windows according to the local scale parameter set, calculate the median of the pixels covered by the center sampling window, the nearest sampling window, and the far neighbor sampling window, and perform MRELBP encoding to form an improved MRELBP texture code.

[0075] The module for generating abnormal response sequences and candidate defective segments is used to unfold the improved MRELBP texture code along the center trajectory of the yarn to a continuous length coordinate, and perform segment splicing according to the response difference between adjacent sampling positions to form abnormal response sequences and candidate defective segments.

[0076] The target defect segment generation module is used to perform forward accumulation and reverse rollback verification on candidate defect segments to form target defect segments;

[0077] The classification and grading output module is used to perform classification and grading based on the segment length, width variation, and texture jump variable of the target defect segment, and output the yarn defect type, defect location, and defect level.

[0078] In this embodiment, the image frame sequence generation module specifically comprises:

[0079] When performing continuous imaging sampling on the imaging area where the running yarn is located, the imaging device continuously outputs yarn image data along the time axis, and continuously records the yarn image data continuously output along the time axis in chronological order to form a continuous yarn image;

[0080] When performing frame-by-frame segmentation of a continuous yarn image at a preset sampling frequency, the number of frames taken per unit time is determined before sampling begins, taking into account the yarn running speed, the frame rate range of the imaging device, and the length of the imaging area. The determined result is used as the preset sampling frequency. Then, the continuous yarn image is segmented in time according to the sampling time interval corresponding to the preset sampling frequency, so that each sampling time interval corresponds to one frame image. The corresponding acquisition time is marked for each frame image to form an image frame set.

[0081] When arranging the frame images in the image frame set in the order of acquisition time from front to back, first extract the acquisition time corresponding to each frame image, and then sort all the frame images according to the order of acquisition time, so that the frame images with earlier acquisition time are placed in the first position and the frame images with later acquisition time are placed in the last position, forming the initial image frame sequence.

[0082] When performing consistency verification on the time interval between adjacent frames in the initial image frame sequence, the acquisition time difference between adjacent frames is calculated sequentially, and the acquisition time difference is compared with the sampling time interval corresponding to the preset sampling frequency. The position of the frame image whose acquisition time difference deviates from the sampling time interval is adjusted so that the frame images in the initial image frame sequence are arranged continuously in time order to form an image frame sequence.

[0083] In this embodiment, the main body segmentation module specifically comprises:

[0084] When converting frame images in an image frame sequence into grayscale images, the brightness information of each pixel position in the frame image is uniformly mapped to the same grayscale representation range, and the yarn region and background region are divided around the grayscale value distribution in the grayscale image. This separates the pixel region that is continuously distributed along the yarn extension position and has a grayscale difference from the background region from the grayscale image, forming the initial main body region.

[0085] When processing the connected regions in the initial main region, the area value is obtained by counting the pixel coverage of each connected region, the length value is obtained by counting the first and last spans along the extension direction of the connected region, and the main extension direction is determined according to the pixel distribution in the connected region. Connected regions that meet the lower limit conditions for area value and length value and whose main extension direction is consistent with the yarn running direction are retained, while connected regions that do not meet the conditions are removed to form the main yarn region.

[0086] When performing central axis refinement within the main yarn region, the edge pixels are shrunk along the width direction of the main yarn region while maintaining the connectivity of the main yarn region, resulting in the main skeleton located in the middle of the main yarn region. The skeleton point positions are extracted along the pixel arrangement order of the main skeleton, and curve fitting is performed on the skeleton point positions to connect the discrete skeleton points into a continuous extended curve, forming the yarn center trajectory.

[0087] When performing contour tracking along the outer edge of the main yarn area, the boundary position is continuously searched around the edge of the main yarn area and the edge pixel coordinates are recorded. Contour pixels are extracted, and the relative position of contour pixels and the yarn center trajectory is compared with the yarn center trajectory as the dividing benchmark. Contour pixels located on one side of the yarn center trajectory are grouped into one group, and contour pixels located on the other side of the yarn center trajectory are grouped into another group to form a boundary point set.

[0088] In this embodiment, the local scale parameter set generation module specifically comprises:

[0089] When performing arc length accumulation along the yarn center trajectory at a fixed trajectory step, the trajectory length between adjacent trajectory positions on the yarn center trajectory is used as the accumulation unit. The trajectory length is accumulated segment by segment along the extension direction of the yarn center trajectory. When the accumulation result reaches the fixed trajectory step, the trajectory point is intercepted, so that the sampling position is distributed at a fixed distance interval along the yarn center trajectory.

[0090] When extracting trajectory points located on both sides of each sampling position and adjacent to the sampling position, select the front and rear trajectory points close to the sampling position on the yarn center trajectory, perform linear fitting on the adjacent trajectory points on both sides of the sampling position, so that the trajectory change trend on both sides of the sampling position can be uniformly represented under the same straight line expression, and determine the extension direction of the fitted straight line as the tangent direction.

[0091] Using the sampling position as the origin of the coordinate system and the tangent direction as the axial direction, when a direction perpendicular to the tangent direction is established at the sampling position as the normal direction, the axial direction represents the extension trend of the yarn center trajectory at the sampling position, and the normal direction represents the lateral change direction perpendicular to the extension trend. A local axial coordinate system is established using the axial direction and the normal direction, so that the spatial positional relationship near the sampling position is unified under the same coordinate representation method.

[0092] When selecting neighborhood boundary points in the boundary point set around each sampling location, the selection area of ​​the boundary point set is limited according to the position range of the sampling location on the yarn center trajectory, so that the neighborhood boundary points and the sampling location maintain a close correspondence. After mapping the neighborhood boundary points to the local axial coordinate system, the projection distance from the neighborhood boundary points on both sides of the yarn center trajectory to the sampling location is calculated along the normal direction, and the sum of the projection distances on both sides is determined as the projection spacing, so that the projection spacing represents the transverse width of the yarn at the sampling location.

[0093] When extracting the grayscale profile passing through the sampling position along the normal direction at each sampling position, the pixel grayscale values ​​in the normal direction are arranged in spatial order to form the grayscale profile. Boundary positioning is performed on the continuous interval of grayscale change in the grayscale profile to determine the position range of grayscale value transition from the yarn area to the background area. The interval span of grayscale value transition from the yarn area to the background area is determined as the grayscale transition width, so that the grayscale transition width characterizes the speed of boundary change at the sampling position.

[0094] When merging the projection spacing and grayscale transition width corresponding to each sampling position according to the arrangement order of the sampling positions on the yarn center trajectory, each sampling position is kept in correspondence with a projection spacing and a grayscale transition width, and the correspondence is continuously arranged according to the arrangement order of the sampling positions to form a local scale parameter set.

[0095] In this embodiment, the sampling window group construction module is specifically as follows:

[0096] At each sampling location, the sampling location is determined as the center positioning point. In the local axial coordinate system, a window area is intercepted around the center positioning point along the axial direction and the normal direction to form the center sampling window. When forming the center sampling window, the coordinate value of the center positioning point in the local axial coordinate system is used as the center position of the window. Based on the position of the center positioning point in the axial direction and the position in the normal direction, pixel areas are intercepted on both sides of the axial direction and the normal direction according to a predetermined window range. The intercepted window area covers the central texture area near the sampling location to form the center sampling window.

[0097] Nearest neighbor positioning points are determined on both sides of the center positioning point along the normal direction, so that the nearest neighbor positioning points are located close to the center positioning point. Window regions are intercepted around the nearest neighbor positioning points along the axial direction and the normal direction to form the nearest neighbor sampling window. When forming the nearest neighbor sampling window, the coordinate value of the center positioning point in the normal direction is used as the reference. Positions that maintain a nearest neighbor distance from the center positioning point are selected along the positive and negative directions of the normal direction, respectively. Pixel regions are intercepted on both sides of the axial direction and the normal direction, centered on the coordinate value of each nearest neighbor positioning point in the local axial coordinate system, so that the nearest neighbor sampling window covers the adjacent texture region close to the center sampling window.

[0098] Along the normal direction, distant neighbor positioning points are determined on both sides of the central positioning point, so that the distant neighbor positioning points are located far away from the central positioning point. When forming the distant neighbor sampling window, the coordinate value of the central positioning point in the normal direction is used as the reference. Positions that maintain a distance from the central positioning point along the positive and negative directions of the normal direction are selected as distant neighbor positioning points. And with the coordinate value of each distant neighbor positioning point in the local axial coordinate system as the center, pixel areas are intercepted on both sides of the axial direction and the normal direction, so that the distant neighbor sampling window covers the outer texture area far away from the central sampling window.

[0099] The boundaries of the center sampling window, the nearest sampling window, and the far neighbor sampling window are kept parallel to the axial direction and the normal direction, respectively. When the nearest sampling window is located between the center sampling window and the far neighbor sampling window, the boundary directions of the center sampling window, the nearest sampling window, and the far neighbor sampling window are constrained to the coordinate direction of the local axial coordinate system. This ensures that each sampling window extends in a consistent manner in the axial direction, maintains a layered arrangement in the normal direction, and places the position of the nearest sampling window between the center sampling window and the far neighbor sampling window in the normal direction.

[0100] The central sampling window, the nearest sampling window, and the far neighbor sampling window are arranged in the order of their sampling positions on the yarn center trajectory to form a sampling window group. Each sampling position corresponds to a central sampling window, a group of nearest sampling windows, and a group of far neighbor sampling windows. The central sampling window, the near neighbor sampling window, and the far neighbor sampling window corresponding to each sampling position are arranged in the order of their sampling positions on the yarn center trajectory to form a sampling window group.

[0101] In this embodiment, the improved MRELBP texture code generation module is specifically as follows:

[0102] The local scale parameter set is matched with the sampling window group execution position according to the arrangement order of the sampling positions on the yarn center trajectory. Each set of projection spacing and grayscale transition width in the local scale parameter set is made to correspond one-to-one with a sampling position on the yarn center trajectory. The projection spacing and grayscale transition width corresponding to a sampling position are configured to the center sampling window, the nearest sampling window, and the far neighbor sampling window corresponding to the same sampling position, so that the sampling window group corresponding to a sampling position uses the same set of local scale parameters.

[0103] Adjust the offset distance of the nearest and far neighbor sampling windows in the normal direction according to the projection spacing. Convert the projection spacing into the neighborhood offset from the center positioning point to the positive side and the negative side of the normal direction. This makes the nearest neighbor sampling windows distributed close to the center positioning point and the far neighbor sampling windows distributed far away from the center positioning point. Adjust the window length in the axial direction and the window width in the normal direction according to the grayscale transition width. Make the window length and window width increase as the grayscale transition width increases and decrease as the grayscale transition width decreases, while keeping the center sampling window located at the center positioning point.

[0104] Median calculation is performed on the pixels covered by the central sampling window. The gray values ​​of all pixels within the coverage area of ​​the central sampling window are arranged according to the gray value size. The gray value at the middle position is selected to form the central median. The same gray value arrangement and median extraction are performed on the pixels covered by the nearest and far neighbor sampling windows on the positive side of the normal direction to form the positive nearest neighbor median and the positive far neighbor median. The same gray value arrangement and median extraction are performed on the pixels covered by the nearest and far neighbor sampling windows on the negative side of the normal direction to form the negative nearest neighbor median and the negative far neighbor median.

[0105] The median difference is calculated based on the center median. The median difference between the positive nearest neighbor median and the center median is obtained by subtracting the center median from the positive nearest neighbor median. The median difference between the negative nearest neighbor median and the center median is obtained by subtracting the center median from the negative nearest neighbor median. The median difference between the positive far neighbor median and the center median is obtained by subtracting the center median from the positive far neighbor median. The median difference between the negative far neighbor median and the center median is obtained by subtracting the center median from the negative far neighbor median. This unifies the grayscale variation relationship between the center sampling window and the nearest and far neighbor sampling windows into the median difference.

[0106] Nearest neighbor and far neighbor codes are generated based on the positive and negative states of the median difference. A median difference greater than zero is identified as one type of coding state, and a median difference less than zero is identified as another type of coding state. The nearest and far neighbor codes corresponding to the positive side of the normal direction and the nearest and far neighbor codes corresponding to the negative side of the normal direction are combined in a fixed arrangement to output an improved MRELBP texture code corresponding to the window size, offset distance, and grayscale comparison result at each sampling position.

[0107] Compared to conventional MRELBP, this invention does not directly use a fixed radius, fixed window, and fixed neighborhood position for texture encoding. Instead, it makes targeted improvements to the sampling structure, scale adaptation method, and encoding basis around the continuous operation scenario of yarn. On the one hand, the local scale parameter set is matched with the sampling window group according to the sampling position. The projection spacing and grayscale transition width are introduced into the construction process of the center sampling window, the nearest neighbor sampling window, and the far neighbor sampling window. This makes texture encoding no longer dependent on a uniform and unchanging window scale, but can synchronously adjust the sampling range according to the local width change of the yarn and the boundary transition state. On the other hand, the offset distance of the nearest neighbor sampling window and the far neighbor sampling window in the normal direction is adjusted according to the projection spacing, and the window length and window width are adjusted according to the grayscale transition width. This makes the texture comparison on both sides of the sampling position based on the neighborhood distribution that matches the local structure, thereby overcoming the sampling problems that are easy to occur in fixed window MRELBP under the conditions of yarn thickness fluctuation, boundary blurring, and hairy disturbance. To address the issue of sample mismatch, this invention constructs a median difference using the center median, forward nearest neighbor median, forward far neighbor median, reverse nearest neighbor median, and reverse far neighbor median. This median difference is then used to generate nearest and far neighbor codes, which are combined according to their positional relationship on both sides of the normal direction. This allows the coding result to simultaneously reflect the grayscale variation relationship between the yarn's central region and its neighboring regions on both sides, enhancing the texture code's ability to express local asymmetric anomalies, edge mutations, and subtle structural disturbances. Based on these improvements, the improved MRELBP texture code formed in this invention can more accurately adapt to the width fluctuations, sway offsets, and boundary transitions that occur during yarn operation. This not only improves the targeting of texture feature extraction but also enhances the ability to distinguish different types of defects such as thick knots, fine details, hair clusters, and stains. Simultaneously, it effectively reduces false detections, missed detections, and duplicate alarms caused by fixed sampling. Therefore, it possesses advantages such as high coding stability, strong local adaptation ability, good anti-interference ability, and high recognition accuracy.

[0108] In this embodiment, the abnormal response sequence and candidate defect segment generation module specifically comprises:

[0109] Arc length accumulation is performed along the yarn center trajectory in the order of sampling positions. The trajectory lengths along the yarn center trajectory between adjacent sampling positions are accumulated segment by segment. The accumulated result corresponding to each sampling position is determined as the position value in the continuous length coordinate. The improved MRELBP texture code corresponding to each sampling position is written into the same position value to form a length texture record set.

[0110] In the length texture record set, the improved MRELBP texture code corresponding to the adjacent sampling positions is extracted in order of position value. The code bits in the same arrangement position in the adjacent improved MRELBP texture code are compared bit by bit. The code bits with different values ​​are recorded as difference bits. The statistical result of the number of all difference bits is determined as the code bit difference value. The code bit difference value is written into the length interval between adjacent sampling positions to form the response difference value between adjacent sampling positions.

[0111] The intervals where the response difference between adjacent sampling positions in a continuous length coordinate is greater than the difference threshold are continuously merged. The length intervals where the positions are adjacent and the response difference is continuously greater than the difference threshold are merged into the same interval to form an abnormal response interval.

[0112] The length interval between adjacent abnormal response intervals is compared. The difference between the ending position value of the previous abnormal response interval and the starting position value of the next abnormal response interval is determined as the length interval. Adjacent abnormal response intervals with a length interval less than the splicing distance threshold are spliced ​​together to form candidate defective segments.

[0113] The abnormal response intervals are connected in the order of their continuous length coordinates. The abnormal response intervals are arranged and combined in the direction of increasing position value to form an abnormal response sequence. The abnormal response sequence and candidate defect segments are then output.

[0114] In this embodiment, the target defect segment generation module specifically comprises:

[0115] Within each candidate defect segment, the response difference in the abnormal response sequence is extracted from the starting position value to the ending position value along the continuous length coordinate. When the response difference is accumulated position by position along the continuous length coordinate, the continuous length coordinate range covered by the candidate defect segment is determined as the accumulation range. The response difference on the continuous length coordinate is arranged continuously in position order, and the response difference at the current position is added to the accumulated result obtained at the immediately preceding position, so that each position on the continuous length coordinate corresponds to a forward accumulation result, forming a forward accumulation sequence.

[0116] When performing difference comparison on the cumulative increments corresponding to adjacent positions in the forward cumulative sequence, the cumulative increment is obtained by subtracting the forward cumulative result of the current position from the forward cumulative result of the immediately preceding position. The cumulative increments of consecutive positions are compared according to the trend of numerical change, and the position where the cumulative increment continues to increase and then decreases is determined as the rollback starting point.

[0117] Starting from the rollback point, the response difference in the abnormal response sequence is extracted along the continuous length coordinate towards the starting position value. When accumulating position by position in the rollback direction, the response difference between the rollback point and the starting position value is arranged in reverse order of position. The response difference at the current position is added to the rollback accumulation result obtained at the immediately preceding position, so that each position in the rollback direction corresponds to a reverse accumulation result, forming a reverse rollback sequence.

[0118] When comparing the cumulative results of the reverse rollback sequence and the forward cumulative sequence at the same continuous length coordinate position, the deviation of the cumulative result is obtained by subtracting the reverse cumulative result from the forward cumulative result at the same continuous length coordinate position. Positions where the cumulative result deviation on the continuous length coordinate is less than the rollback consistency threshold are continuously merged to form effective segments.

[0119] When separating the start and end position values ​​corresponding to the valid segment from the candidate defective segment and performing segment update, the position range of the valid segment in the continuous length coordinate is written into the segment boundary corresponding to the candidate defective segment, and the target defective segment is determined by the updated segment boundary.

[0120] In this embodiment, the classification and grading output module specifically comprises:

[0121] Perform difference calculation on the start and end position values ​​of the target defect segment in the continuous length coordinate. Subtract the start position value from the end position value to obtain the span value of the target defect segment in the continuous length coordinate. The span value is determined as the segment length. At the same time, the start and end position values ​​are retained as the boundary positions of the target defect segment in the continuous length coordinate. The defect position is determined by the boundary positions.

[0122] The projection spacing within the target defect area is extracted from the local scale parameter set. The projection spacing where the position value falls between the start position value and the end position value is arranged in the order of continuous length coordinates. The projection spacing in the arrangement result is numerically compared to determine the maximum projection spacing and the minimum projection spacing. The difference between the maximum projection spacing and the minimum projection spacing is determined as the width change, so that the width change represents the change range of the transverse width of the yarn within the target defect area.

[0123] Extract the response difference values ​​located within the target defect segment position range from the abnormal response sequence. Arrange the response difference values ​​whose position values ​​fall between the start position value and the end position value in the continuous length coordinate order. Perform numerical accumulation on the response difference values ​​in the arrangement result to obtain the cumulative result, or perform numerical summation on the response difference values ​​in the arrangement result and divide by the number of response difference values ​​to obtain the average result. Then determine the cumulative result or the average result as the texture jump variable, so that the texture jump variable represents the intensity of the change in texture response within the target defect segment.

[0124] The segment length, width variation, and texture jump variable are compared with the type determination interval. The segment length, width variation, and texture jump variable are matched with the numerical range corresponding to each type determination interval. The target defect segment that meets the matching conditions in the same type determination interval is determined as the corresponding yarn defect type.

[0125] The segment length, width variation, and texture jump variable are compared with the grade judgment interval. The segment length, width variation, and texture jump variable are matched with the numerical range corresponding to each grade judgment interval. The target defect segment that meets the matching conditions in the same grade judgment interval is determined as the corresponding defect grade, and the yarn defect type, defect location, and defect grade are output.

[0126] Example 1: To verify the feasibility of this invention in practice, it was applied to an online quality inspection scenario in a continuous spinning production line. The object being inspected is a high-speed running yarn that continuously passes through the imaging area, and its surface may exhibit thick spots, thin spots, fuzzy clusters, attached stains, and local texture abrupt changes. During production, the yarn often experiences slight swaying, blurred local boundaries, and width fluctuations. The response of the same defect in continuous images is prone to breakage, making it difficult for traditional methods to simultaneously achieve both recognition accuracy and alarm stability. After the image frame sequence is generated, this invention first extracts the yarn center trajectory and boundary point set through a main body segmentation module, then sets sampling positions along the yarn center trajectory, establishes a local axial coordinate system, calculates the projection spacing and grayscale transition width, and forms a local scale parameter set. Subsequently, a center sampling window, a nearest neighbor sampling window, and a far neighbor sampling window are constructed within the local axial coordinate system, and the window size and offset distance of the nearest neighbor sampling window and the far neighbor sampling window are adjusted according to the local scale parameter set. The median of the pixels covered by the sampling window is calculated and MRELBP encoding is performed to form an improved MRELBP texture code. The improved MRELBP texture code is unfolded along the center trajectory of the yarn to a continuous length coordinate. The abnormal response interval is spliced ​​by the response difference between adjacent sampling positions. Then, forward accumulation and reverse roll-back verification are performed on the candidate defect segments, and finally the yarn defect type, defect location and defect level are output.

[0127] To better demonstrate the improvement effect, a comparison scheme was set up. The comparison scheme adopted a conventional fixed-window detection process. First, grayscale conversion and threshold segmentation were performed on the continuous yarn images to obtain the main yarn region. Then, a square detection window with a fixed pixel size was set within the main yarn region. The detection window moved sequentially with the image frames. Standard MRELBP encoding was directly performed on the pixels covered by each detection window. The nearest neighbor radius, far neighbor radius, and window size remained unchanged across all image frames, without adjustment based on projection spacing and grayscale transition width. The standard MRELBP encoding results in each frame were used for anomaly judgment according to a fixed response threshold. Anomaly windows were directly merged into suspected defect areas within a single frame. Continuous length coordinates were not established, anomaly response interval splicing was not performed, and forward accumulation and reverse rollback verification were not performed. During testing, the same batch of yarn samples were tested using both the present invention and the comparison scheme. A sample length of 12,000 meters was manually verified, and a total of 932 valid defects were manually confirmed. The test results are shown in Table 1.

[0128] Table 1. Comparison of Detection Results between the Invention and the Comparative Solution

[0129] Total number of valid defects confirmed manually 932 places 932 places Detected number of valid defects 907 842 places Number of missed detections 25 places 90 places False alarms 31 places 108 places Recognition accuracy 96.70% 88.61% Repeat alarm rate 2.36% 7.94% Average processing latency 36 milliseconds 43 milliseconds

[0130] Table 1 shows that, due to the use of fixed windows, fixed radii, and fixed response thresholds, the standard MRELBP encoding process of the comparative scheme cannot be synchronously adjusted with changes in local yarn width and boundary transition states. When there is coexistence of hair clusters and slight thick spots, blurred boundaries, and short-term reflective interference, the same defect is easily segmented into several suspected defect areas. It is also easy to misjudge instantaneous abnormal responses as real defects, resulting in significantly higher missed detections, false alarms, and repeated alarm rates. This invention drives the adjustment of the sampling window group through a local scale parameter set, ensuring that the improved MRELBP texture code adapts to the local morphology of the yarn. Combined with the splicing of abnormal response intervals on continuous length coordinates and forward accumulation and reverse rollback verification, it can improve the continuity and consistency of abnormal segments. Therefore, it outperforms the comparative scheme in terms of recognition accuracy, false alarm suppression capability, and online detection efficiency.

[0131] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A yarn defect identification system based on visual inspection, characterized in that, include: The image frame sequence generation module is used to acquire continuous images of yarn and form an image frame sequence; The main body segmentation module is used to perform main body segmentation on the image frame sequence and extract the yarn center trajectory and boundary point set; The local scale parameter set generation module is used to set sampling positions along the yarn center trajectory, establish a local axial coordinate system, project the boundary point set onto the normal direction, and form a local scale parameter set. The sampling window group construction module is used to set the center sampling window, the nearest sampling window, and the far neighbor sampling window in the local axial coordinate system; An improved MRELBP texture code generation module is used to adjust the nearest and far neighbor sampling windows according to the local scale parameter set, calculate the median of the pixels covered by the center sampling window, the nearest sampling window, and the far neighbor sampling window, and perform MRELBP encoding to form an improved MRELBP texture code. The module for generating abnormal response sequences and candidate defective segments is used to unfold the improved MRELBP texture code along the center trajectory of the yarn to a continuous length coordinate, and perform segment splicing according to the response difference between adjacent sampling positions to form abnormal response sequences and candidate defective segments. The target defect segment generation module is used to perform forward accumulation and reverse rollback verification on candidate defect segments to form target defect segments; The classification and grading output module is used to perform classification and grading based on the segment length, width variation, and texture jump variable of the target defect segment, and output the yarn defect type, defect location, and defect level.

2. The yarn defect identification system based on visual inspection according to claim 1, characterized in that, The image frame sequence generation module specifically comprises: Continuous imaging sampling is performed on the imaging area where the running yarn is located to form a continuous image of the yarn; The continuous yarn image is segmented frame by frame according to a preset sampling frequency, and the acquisition time of each frame is marked to form an image frame set. The frame images in the image frame set are arranged in the execution time sequence from front to back according to the acquisition time to form the initial image frame sequence; A consistency check is performed on the time interval between adjacent frames in the initial image frame sequence, and the position of frames whose time interval deviates from the preset sampling frequency is adjusted to form an image frame sequence.

3. The yarn defect identification system based on visual inspection according to claim 1, characterized in that, The main body segmentation module is specifically as follows: The frame images in the image frame sequence are converted into grayscale images, and the yarn area is separated from the background area according to the grayscale value distribution to form the initial subject area; For the connected regions in the initial main region, calculate the area value, length value and main extension direction of each connected region. Retain the connected regions whose area value meets the lower limit condition, whose length value meets the lower limit condition and whose main extension direction is consistent with the yarn running direction to form the yarn main region. The centerline is refined within the main yarn area to obtain the main skeleton. Then, curve fitting is performed along the pixel arrangement order of the main skeleton to form the yarn center trajectory. Contour tracking is performed along the outer edge of the main yarn area to extract contour pixels. Then, the contour pixels are aggregated according to their positional relationship on both sides of the yarn center trajectory to form a boundary point set.

4. The yarn defect identification system based on visual inspection according to claim 1, characterized in that, The local scale parameter set generation module specifically comprises: Accumulate arc length along the center trajectory of the yarn at a fixed trajectory step size. When the accumulated arc length reaches the fixed trajectory step size, intercept the trajectory point and determine the trajectory point as the sampling position. Around each sampling position, extract trajectory points located on both sides of the sampling position and adjacent to the sampling position. Perform line fitting on the adjacent trajectory points on both sides of the sampling position and determine the extension direction of the fitted line as the tangent direction. With the sampling position as the origin and the tangent direction as the axial direction, a direction perpendicular to the tangent direction is established at the sampling position as the normal direction, and a local axial coordinate system is established with the axial direction and the normal direction. Around each sampling location, the neighboring boundary points in the boundary point set are extracted, and the neighboring boundary points are mapped to the local axial coordinate system. The projection distance from the neighboring boundary points on both sides of the yarn center trajectory to the sampling location is calculated along the normal direction, and the sum of the projection distances on both sides is determined as the projection spacing. At each sampling location, extract the grayscale profile passing through the sampling location along the normal direction, perform boundary positioning on the continuous interval of grayscale change in the grayscale profile, and determine the interval span of grayscale value transition from the yarn area to the background area as the grayscale transition width. The projection spacing and grayscale transition width corresponding to each sampling position are merged according to the arrangement order of the sampling positions on the yarn center trajectory to form a local scale parameter set.

5. The yarn defect identification system based on visual inspection according to claim 1, characterized in that, The sampling window group construction module is specifically as follows: At each sampling location, the sampling location is determined as the center positioning point, and a window area is intercepted around the center positioning point along the axial direction and the normal direction in the local axial coordinate system to form the center sampling window; Nearest neighbor positioning points are determined on both sides of the central positioning point along the normal direction, so that the nearest neighbor positioning points are located close to the central positioning point. A window area is intercepted around the nearest neighbor positioning points along the axial direction and the normal direction to form a nearest neighbor sampling window. Determine neighboring locations on both sides of the central location point along the normal direction, so that the neighboring locations are located far away from the central location point. Then, extract window areas around the neighboring locations along the axial direction and the normal direction to form a neighboring sampling window. Make the boundaries of the center sampling window, the nearest sampling window, and the far neighbor sampling window parallel to the axial direction and the normal direction, respectively, and position the nearest neighbor sampling window between the center sampling window and the far neighbor sampling window; The central sampling window, the nearby sampling window, and the distant sampling window are arranged in the order of their sampling positions on the yarn center trajectory to form a sampling window group.

6. The yarn defect identification system based on visual inspection according to claim 1, characterized in that, The improved MRELBP texture code generation module is specifically as follows: The local scale parameter set is matched with the sampling window group execution position according to the arrangement order of the sampling position on the yarn center trajectory. The projection spacing and grayscale transition width are written into the center sampling window, the nearest sampling window and the far neighbor sampling window corresponding to the sampling position. Adjust the offset distance of the nearest and far neighbor sampling windows in the normal direction according to the projection spacing, adjust the window length of the nearest and far neighbor sampling windows in the axial direction and the window width in the normal direction according to the grayscale transition width, and keep the center sampling window located at the center positioning point. Median calculation is performed on the pixels covered by the central sampling window to form the central median. Median calculation is also performed on the pixels covered by the nearest and far neighbor sampling windows on the positive side of the normal direction to form the positive nearest neighbor median and the positive far neighbor median. Median calculation is also performed on the pixels covered by the nearest and far neighbor sampling windows on the negative side of the normal direction to form the negative nearest neighbor median and the negative far neighbor median. Using the central median as a reference, calculate the median difference between the median of the forward nearest neighbors and the central median, calculate the median difference between the median of the reverse nearest neighbors and the central median, calculate the median difference between the median of the forward distant neighbors and the central median, and calculate the median difference between the median of the reverse distant neighbors and the central median. Nearest neighbor and far neighbor codes are generated based on the positive and negative states of the median difference, and the codes are combined according to the arrangement of the positive side of the normal direction and the negative side of the normal direction to form an improved MRELBP texture code.

7. The yarn defect identification system based on visual inspection according to claim 1, characterized in that, The abnormal response sequence and candidate defect segment generation module specifically comprises: Arc length accumulation is performed along the yarn center trajectory in the order of sampling positions. The accumulated arc length corresponding to each sampling position is determined as the position value in the continuous length coordinate. The improved MRELBP texture code corresponding to each sampling position is associated with the position value to form a length texture record set. In the length texture record set, the improved MRELBP texture code corresponding to adjacent sampling positions is extracted in order of position value. The code bit comparison is performed on the adjacent improved MRELBP texture codes, the code bit difference value is counted, and the response difference between adjacent sampling positions is formed. The intervals where the difference in response between adjacent sampling positions in a continuous length coordinate system is greater than the difference threshold are continuously merged to form an abnormal response interval; Compare the length intervals between adjacent abnormal response intervals, and perform segment splicing on adjacent abnormal response intervals whose length intervals are less than the splicing distance threshold to form candidate defective segments; The abnormal response intervals are joined according to the order of their continuous length coordinates to form an abnormal response sequence, and the abnormal response sequence and candidate defect segments are output.

8. The yarn defect identification system based on visual inspection according to claim 1, characterized in that, The target defect segment generation module is specifically as follows: Within each candidate defect segment, the response difference in the abnormal response sequence is extracted from the starting position value to the ending position value along the continuous length coordinate, and the response difference is accumulated position by position along the continuous length coordinate to form a forward cumulative sequence; Perform a difference comparison on the cumulative increments corresponding to adjacent positions in the forward cumulative sequence, and determine the position where the cumulative increment changes from continuous increase to continuous decrease as the rollback start point; Starting from the rollback point, the response difference in the abnormal response sequence is extracted along the continuous length coordinate towards the starting position value, and then accumulated position by position in the rollback direction to form a reverse rollback sequence. The cumulative results of the reverse roll-back sequence and the forward cumulative sequence at the same continuous length coordinate position are compared for deviation. The position interval where the cumulative result deviation is less than the roll-back consistency threshold is determined as the valid segment. The start and end position values ​​corresponding to the valid segment are separated from the candidate defective segment and the segment is updated to form the target defective segment.

9. A yarn defect identification system based on visual inspection according to claim 1, characterized in that, The classification and grading output module specifically includes: Perform difference calculation on the start and end position values ​​of the target defect segment in the continuous length coordinate to form the segment length, and determine the start and end position values ​​as the defect location; The projection spacing within the target defect area is extracted from the local scale parameter set. The maximum and minimum values ​​of the projection spacing within the target defect area are calculated, and the difference between the maximum and minimum values ​​is determined as the width change. Extract the response difference within the target defect area range from the abnormal response sequence, and perform numerical accumulation or numerical averaging on the response difference within the target defect area range to form a texture jump variable; The segment length, width variation, and texture jump variable are compared with the type determination interval, and the target defect segment that meets the type determination interval is determined as the yarn defect type. The segment length, width variation, and texture jump variable are compared with the grade judgment interval. The target defect segment that meets the grade judgment interval is determined as the defect grade, and the yarn defect type, defect location, and defect grade are output.