Knitted fabric production color difference detection method based on AI vision

CN122948997APending Publication Date: 2026-10-20SAILAISI LNDUSTRIAL (HANGZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611126817.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0005]因此,本发明提供了一种基于AI视觉的针织面料生产色差检测方法解决针织面料结构诱发色偏与真实生产色偏难以准确分离的问题

Benefits of technology

[0016]本发明有益效果为:通过识别标准样图像与实时针织面料图像中的线圈连接关系和组织周期,建立标准组织网格与实时组织网格,并依据位置偏移、间距变化及方向偏转实施弹性配准,实现相同组织相位位置之间的精确对应,避免固定坐标比对受到面料牵伸、张力波动及线圈形变干扰,从而提高原始颜色偏离定位的准确性;通过提取结构异常范围邻域的线圈结构参照信息和局部颜色承接信息,重建结构异常未发生时的反事实校正图像,并分别比对实时针织面料图像、反事实校正图像与合格标准样图像,实现结构诱发色偏与真实生产色偏的分离;结合色差承接轨迹对真实生产色偏进行连续定位和分布类型识别,能够减少结构缺陷造成的色差误判,并为染色、供纱及生产工艺调整提供更可靠的检测依据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention discloses a method for detecting color difference in knitted fabric production based on AI vision, belonging to the field of AI vision technology. The method includes: extracting coil structure reference information and local color continuity information from the neighborhood of structural anomalies in a structural color deviation correlation map; reconstructing a counterfactual correction image; comparing it with real-time knitted fabric images and qualified standard sample images to separate structure-induced color deviation from actual production color deviation, forming a true color difference distribution map; locating the fabric position corresponding to each color difference region in the true color difference distribution map according to the fabric position correspondence in the reference color correction image group; associating the position continuity and color deviation changes of color difference regions in adjacent real-time knitted fabric images to form a color difference continuity trajectory; confirming the continuous production color difference and its distribution type based on the color difference continuity trajectory; and generating a production color difference detection record. This invention improves the reliability of continuous color difference detection and classification by organizing phase registration and counterfactual correction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of AI vision technology, and in particular to a method for detecting color difference in the production of knitted fabrics based on AI vision. Background Technology

[0002] As textile production equipment develops towards higher speeds, continuous operation, and intelligence, color difference detection of knitted fabrics is gradually shifting from manual visual inspection and offline sampling color comparison to online detection based on industrial cameras, machine vision, and artificial intelligence algorithms. Existing technologies typically utilize line-scan or area-scan cameras to acquire continuously running fabric images. After dark field correction, white field correction, color space conversion, and comparison with standard samples, brightness deviation, chromaticity deviation, and overall color difference are obtained. These are then combined with image segmentation, feature recognition, or anomaly detection models to locate abnormal areas such as color spots, color patches, and color streaks. While these technologies can improve detection coverage and processing efficiency, knitted fabrics are composed of periodically arranged and interlocked knitted loops. Stretching, tension fluctuations, and structural anomalies can cause loop position shifts, spacing changes, direction deflections, and changes in opening morphology, thereby altering local reflection, light transmission, and shadow states, resulting in different image color responses for the same yarn color.

[0003] Existing AI vision-based color difference detection methods for knitted fabrics often rely on fixed image coordinates, regular detection areas, or the registration results of the entire image as the basis for comparing the standard sample with the real-time image. This makes it difficult to establish accurate correspondences between similar coil positions based on coil connection relationships, weave cycles, and weave phases. This can easily lead to misjudging apparent color shifts caused by coil structural deformation as actual production color shifts caused by dyeing, yarn supply, or process fluctuations. Furthermore, existing methods typically output color difference results from a single image or a single detection window, lacking continuous correlation processing of the positional continuity, color shift direction, and boundary changes of color difference regions in adjacent real-time images. This makes it difficult to distinguish between isolated color differences and continuous production color differences, and also makes it difficult to accurately determine the distribution types such as horizontal color bands, vertical color stripes, periodic color patterns, and whole-piece gradient color differences. Therefore, existing knitted fabric visual inspection technologies mainly suffer from the problem of difficulty in separating structure-induced color shifts from actual production color shifts. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides an AI vision-based method for detecting color difference in knitted fabric production, which solves the problem of difficulty in accurately separating color deviation induced by the structure of knitted fabric from the actual production color deviation.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: This invention provides a color difference detection method for knitted fabric production based on AI vision, comprising: acquiring a qualified standard sample image corresponding to the current production batch; using an encoder to trigger an industrial camera to acquire real-time knitted fabric images of continuously moving knitted fabric, and performing image correction and color unification; establishing a correspondence between the real-time knitted fabric image and the fabric position to form a reference color calibration image group; based on the reference color calibration image group, identifying the coil connection relationship and weave period of the qualified standard sample image and the real-time knitted fabric image, establishing a standard weave grid and a real-time weave grid respectively; determining local deformation by comparing the standard weave grid and the real-time weave grid; performing elastic registration based on the local deformation; establishing a correspondence between the positions of the same weave phase to form a weave phase correspondence record; and based on the reference color calibration image group, identifying the range of structural anomalies in the real-time knitted fabric image and classifying them within the same group. By comparing the phase position of the knitted fabric image with that of the qualified standard sample, the original color deviation is determined. The spatial correspondence and change correlation between the structural anomaly range and the original color deviation are analyzed to form a structural color deviation correlation map. From the structural color deviation correlation map, the coil structure reference information and local color continuity information of the neighborhood of the structural anomaly range are extracted to reconstruct the counterfactual correction image. This image is then compared with the real-time knitted fabric image and the qualified standard sample image to separate the structure-induced color deviation from the actual production color deviation, forming a true color difference distribution map. According to the fabric position correspondence in the reference color correction image group, the fabric position corresponding to each color difference region in the true color difference distribution map is located. The position continuity and color deviation change of the color difference region in the adjacent real-time knitted fabric image are correlated to form a color difference continuity trajectory. Based on the color difference continuity trajectory, the continuous production color difference and its distribution type are confirmed, and a production color difference detection record is generated.

[0007] As a preferred embodiment of the AI ​​vision-based color difference detection method for knitted fabric production described in this invention, the specific steps for forming a reference color calibration image set are as follows: Read the current production batch identifier from the production task, retrieve the qualified standard sample image corresponding to the current production batch identifier, and obtain the dark field image, white field image, color correction relationship, and calibration relationship between encoder pulse and fabric travel distance formed by the calibration of the inspection station. The trigger pulses output by the encoder are used to control the industrial camera to acquire continuously moving knitted fabric line by line. The fabric position corresponding to each image line is determined according to the calibration relationship between the encoder pulses and the fabric travel distance. The continuous image lines are then stitched together to form a real-time knitted fabric image. By using dark field and white field images to correct the fixed noise and illumination differences between qualified standard sample images and real-time knitted fabric images, color expression is unified according to color correction relationships, a correspondence between real-time knitted fabric images and fabric positions is established, and the qualified standard sample images, real-time knitted fabric images, and the correspondence between real-time knitted fabric images and fabric positions are associated to form a reference color calibration image group.

[0008] As a preferred embodiment of the AI ​​vision-based color difference detection method for knitted fabric production described in this invention, the steps of identifying the coil connection relationship and weave period of the qualified standard sample image and the real-time knitted fabric image, establishing a standard weave grid and a real-time weave grid respectively, and determining local deformation by comparing the standard weave grid and the real-time weave grid are as follows: Locate the reference position of the standard knitting loop in the qualified standard sample image in the reference color calibration image group, locate the reference position of the real-time knitting loop in the real-time knitted fabric image, and connect the adjacent reference positions of the standard knitting loop and the adjacent reference positions of the real-time knitting loop along the horizontal and vertical directions respectively to form the standard loop connection relationship and the real-time loop connection relationship. Analyze the repetition interval and arrangement of the standard and real-time loop connection relationships, determine the standard and real-time weave cycles, mark the weave phase of the standard and real-time knitting loop reference positions, and establish the standard and real-time weave grids respectively. By comparing the reference positions of standard knitting loops in the standard tissue grid with the reference positions of real-time knitting loops in the real-time tissue grid, the position offset, spacing change and direction deflection are determined, and the continuously changing reference positions of real-time knitting loops along the horizontal and vertical directions are merged to form local deformation.

[0009] As a preferred embodiment of the AI ​​vision-based color difference detection method for knitted fabric production according to the present invention, the specific steps for forming the tissue phase correspondence record are as follows: The continuous deformation range is divided according to the real-time knitting loop reference position and change direction involved in the local deformation. Based on the position offset, spacing change and direction deflection of the real-time knitting loop reference position relative to the standard knitting loop reference position within the continuous deformation range, the correction position corresponding to the real-time knitting loop reference position is determined. Adjust the real-time knitting loop reference position to the corresponding correction position to form the registration grid position, and maintain the real-time loop connection relationship and the tissue phase arrangement order to establish the registration tissue grid; By comparing the registration grid position with the reference position of the standard knitting loop, a correspondence between the same organizational phase positions is established. The positions of the registration grid position in the real-time knitted fabric image, the positions of the reference positions of the standard knitting loops in the qualified standard sample image, the organizational phase, and local deformation are recorded to form an organizational phase correspondence record.

[0010] As a preferred embodiment of the AI ​​vision-based color difference detection method for knitted fabric production described in this invention, the specific steps for identifying the range of structural anomalies in real-time knitted fabric images are as follows: According to the tissue phase correspondence record, extract the reference position of the standard knitting loop and the position of the registration mesh with the same tissue phase from the standard tissue mesh and the registration tissue mesh, compare the continuity of the knitting loop connection, the adjacent spacing and the opening shape of the corresponding positions, and locate the structural difference position in the registration tissue mesh. The structural difference locations are mapped to real-time knitted fabric images, adjacent structural difference locations are merged along the horizontal and vertical directions, and repeated structural difference locations are merged according to the weave cycle to determine the range of structural anomalies.

[0011] As a preferred embodiment of the AI ​​vision-based color difference detection method for knitted fabric production described in this invention, the specific steps for forming the structural color deviation correlation map are as follows: According to the corresponding records of the tissue phase, the lightness and chromaticity values ​​of the same tissue phase positions in the real-time knitted fabric image and the qualified standard sample image are compared after color unification. The lightness deviation, chromaticity deviation and comprehensive color difference of the same tissue phase positions are determined to form the original color deviation. The original color deviation is superimposed on the corresponding position in the real-time knitted fabric image. The overlap, boundary correspondence and synchronous change of the structural anomaly range and the original color deviation are analyzed to establish spatial correspondence and change correlation, forming a structural color deviation correlation map.

[0012] As a preferred embodiment of the AI ​​vision-based color difference detection method for knitted fabric production described in this invention, the specific steps for reconstructing the counterfactual corrected image are as follows: The structural anomaly range is extracted from the structural color deviation correlation map. According to the corresponding record of the tissue phase, the standard knitting coil morphology with the same tissue phase as the structural anomaly range is extracted from the qualified standard sample image. The connection status of the knitting coil around the structural anomaly range is extracted from the real-time knitted fabric image to form coil structure reference information. From real-time knitted fabric images and adjacent real-time knitted fabric images, extract the brightness values, chromaticity values ​​and color change directions around the structural anomaly range and the corresponding tissue phase position, and connect the color changes according to the fabric position correspondence in the reference color calibration image group to form local color continuity information. The connection status and opening shape of the knitted coils within the structural anomaly range are reconstructed based on the coil structure reference information, and the color change of the reconstructed area is continued according to the local color continuity information to form a counterfactual correction image when the structural anomaly has not occurred.

[0013] As a preferred embodiment of the AI ​​vision-based color difference detection method for knitted fabric production according to the present invention, the specific steps for forming a true color difference distribution map are as follows: By comparing the brightness and chromaticity values ​​of the corresponding positions of structural anomalies in the real-time knitted fabric image and the counterfactual correction image, the color difference between the real-time knitted fabric image and the counterfactual correction image is identified as structure-induced color deviation. According to the tissue phase correspondence record, compare the lightness and chromaticity values ​​of the same tissue phase position in the counterfactual corrected image and the qualified standard sample image, and determine the color difference that still exists after counterfactual correction as the actual production color deviation; The structure-induced color deviation and the actual production color deviation are mapped to the position of the real-time knitted fabric image. For positions where both structure-induced color deviation and actual production color deviation exist, the structure-induced color deviation and the actual production color deviation are retained respectively. A true color difference distribution map is formed according to the color deviation range, color deviation direction and comprehensive color difference of the actual production color deviation.

[0014] As a preferred embodiment of the AI ​​vision-based color difference detection method for knitted fabric production according to the present invention, the specific steps for forming the color difference trajectory are as follows: According to the correspondence of fabric positions in the reference color calibration image group, the image positions of each color difference region in the real color difference distribution map are converted into the fabric position range on the continuous knitted fabric, and the start and end positions and color deviation direction of the fabric position range are recorded. According to the fabric running direction, compare the fabric position range of the color difference area in adjacent real-time knitted fabric images, filter the color difference areas whose fabric position ranges can be continuously connected, and establish candidate continuity relationships. By comparing the color deviation direction, overall color difference, and boundary changes of the color difference areas in the candidate inheritance relationship, color difference areas with continuous connection of fabric location range and continuous changes in color deviation direction and overall color difference are sequentially associated to form a color difference inheritance trajectory.

[0015] As a preferred embodiment of the AI ​​vision-based color difference detection method for knitted fabric production according to the present invention, the specific steps for generating production color difference detection records are as follows: The color difference region is checked along the color difference continuation trajectory to examine the fabric position continuation status and color deviation direction stability status of the color difference region in consecutive adjacent real-time knitted fabric images. Color difference regions with continuous fabric position continuation and stable color deviation direction are identified as continuous production color differences, and color difference regions with interrupted fabric position continuation and abrupt color deviation direction are excluded. Analyze the extension range of continuous production color difference along the horizontal and vertical directions, the repetition state of the weave cycle, and the comprehensive color difference change along the fabric running direction to determine the distribution type of continuous production color difference. Record the fabric start and end positions, influence range, color deviation direction, comprehensive color difference, duration, and distribution type to generate a production color difference detection record.

[0016] The beneficial effects of this invention are as follows: By identifying the coil connection relationship and weave cycle in the standard sample image and the real-time knitted fabric image, a standard weave grid and a real-time weave grid are established. Elastic registration is then implemented based on positional offset, spacing changes, and directional deflection, achieving precise correspondence between the same weave phase positions. This avoids interference from fabric stretching, tension fluctuations, and coil deformation during fixed coordinate comparison, thereby improving the accuracy of original color deviation positioning. By extracting coil structure reference information and local color continuity information from the neighborhood of the structural anomaly range, a counterfactual correction image is reconstructed when the structural anomaly has not occurred. This image is then compared with the real-time knitted fabric image, the counterfactual correction image, and the qualified standard sample image, achieving separation between structure-induced color deviation and actual production color deviation. Combining the color difference continuity trajectory with continuous positioning and distribution type identification of actual production color deviation reduces misjudgments of color difference caused by structural defects and provides a more reliable detection basis for dyeing, yarn supply, and production process adjustments. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart for a color difference detection method for knitted fabrics based on AI vision.

[0019] Figure 2 This is a schematic diagram of tissue phase registration.

[0020] Figure 3 This is a schematic diagram of counterfactual correction and color bias separation.

[0021] Figure 4 This is a schematic diagram for determining the type of color difference and its distribution.

[0022] Figure 5 This is a comparison chart of tissue phase registration errors under multi-factor local deformation.

[0023] Figure 6 This is a comparison chart of the counterfactual correction and color deviation separation results using different processing methods.

[0024] Figure 7 A comparison diagram of color difference trajectories under different image segmentation conditions. Detailed Implementation

[0025] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0026] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0027] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0028] Reference Figures 1-7 This is one embodiment of the present invention, which provides a color difference detection method for knitted fabric production based on AI vision, including the following steps: S1. Obtain the qualified standard sample image corresponding to the current production batch, use the encoder to trigger the industrial camera to collect the real-time knitted fabric image of the continuously moving knitted fabric, and perform imaging correction and color unification to establish the correspondence between the real-time knitted fabric image and the fabric position, forming a reference color calibration image group.

[0029] S1.1 Read the current production batch identifier from the production task, retrieve the qualified standard sample image corresponding to the current production batch identifier, and obtain the dark field image, white field image, color correction relationship, and calibration relationship between encoder pulse and fabric travel distance formed by the calibration of the inspection station.

[0030] It should be noted that when knitted fabric production begins, the current production batch identifier is retrieved from the production task issued by the production management equipment. The production task records the knitted fabric type, color code, knit structure specification, yarn batch, and production equipment number. Based on the current production batch identifier, the qualified standard sample image is located in the standard sample data, and the knitted fabric type, color code, and knit structure specification associated with the qualified standard sample image are verified against the corresponding information in the production task. The qualified standard sample image is acquired and stored under imaging conditions at the inspection station from a knitted fabric standard sample that has passed quality confirmation.

[0031] After the industrial camera, lighting device, and encoder are installed at the inspection station, calibration is performed while keeping the exposure time, gain, shooting distance, and lighting conditions of the industrial camera constant. The lighting device is turned off and the imaging range of the industrial camera is blocked. Pixel responses under no effective incident light are collected to form a dark field image. A white calibration plate with uniform surface brightness is placed at the inspection position of the knitted fabric, and the brightness responses at different image positions are collected under the inspection lighting conditions to form a white field image.

[0032] Each standard color patch in the color calibration plate was measured using a calibrated spectrophotometer. During measurement, the edges of the standard color patches were avoided, and multiple measurement positions were selected inside the standard color patches to obtain the lightness value, red-green value, and yellow-blue value of each measurement position. The standard lightness value, standard red-green value, and standard yellow-blue value of the standard color patch were determined by averaging the color values ​​of the corresponding measurement positions of the same standard color patch. The standard color patch number was then associated with and saved with the corresponding standard lightness value, standard red-green value, and standard yellow-blue value.

[0033] The color calibration board was photographed under the condition that the exposure time, gain, shooting distance and lighting conditions of the industrial camera remained unchanged. Dark field correction and white field correction were performed on the color calibration board image. The image area corresponding to each standard color block was located according to the standard color block number. The edge position of the image area was removed, and the median value of the red channel, green channel value and blue channel value inside the image area was used as the three channel representative values ​​of the corresponding standard color block. The three channel representative values ​​were proportionally converted according to the maximum channel value corresponding to the output bit depth of the industrial camera. The proportional conversion result was correlated with the standard lightness value, standard red-green value and standard yellow-blue value corresponding to the same standard color block to form a color calibration sample.

[0034] A three-channel color mapping matrix with a bias term is established based on all color calibration samples. Standard lightness value, standard red-green value, and standard yellow-blue value are used as mapping targets, and the channel mapping coefficients corresponding to the three mapping targets are solved using the least squares method. The color calibration samples are re-input into the three-channel color mapping matrix to obtain the comprehensive color difference between the mapped color values ​​and the corresponding standard color values. The comprehensive color difference is checked based on the color fluctuation range formed by repeated measurements of the same standard color patch using a spectrophotometer. If the comprehensive color difference exceeds the color fluctuation range, the color calibration plate is photographed again and the channel mapping coefficients are solved.

[0035] When any channel value of the pixel to be corrected exceeds the coverage range of the corresponding channel of the color calibration sample, the channel value is restricted to the nearest boundary value of the corresponding coverage range, and the state of exceeding the calibration range is recorded. The channel mapping coefficient, bias term, coverage range of the three channel values, standard lightness value coverage range, standard red-green value coverage range, standard yellow-blue value coverage range, maximum fitted color difference formed by back substitution of the color calibration sample, and calibration version are saved to form a color correction relationship.

[0036] The knitted fabric is driven to move over a known distance, and the number of pulses output by the encoder is counted synchronously. Based on the correspondence between the known distance and the number of pulses, a calibration relationship between the encoder pulses and the fabric travel distance is formed. The dark field image, white field image, color correction relationship, and calibration relationship between the encoder pulses and the fabric travel distance are saved in correspondence with the detection station number and calibration version.

[0037] S1.2. The trigger pulses output by the encoder are used to control the industrial camera to acquire continuously moving knitted fabric line by line. The fabric position corresponding to each image line is determined according to the calibration relationship between the encoder pulses and the fabric travel distance. The continuous image lines are then stitched together to form a real-time knitted fabric image.

[0038] It should be noted that the position of the knitted fabric corresponding to the imaging area of ​​the industrial camera at the start of acquisition is set as the fabric's starting position, and the corresponding starting pulse value is recorded. Based on the required image row spacing along the fabric's running direction and the calibration relationship between encoder pulses and fabric travel distance, the trigger pulse interval between adjacent image rows is determined. When the continuously moving knitted fabric passes through the imaging area of ​​the industrial camera, the encoder sends an acquisition trigger signal to the industrial camera every time the cumulative number of pulses reaches one trigger pulse interval. The industrial camera then acquires an image row covering the width direction of the knitted fabric and saves the image row corresponding to the encoder's cumulative pulse value.

[0039] Based on the difference between the cumulative encoder pulse value and the initial pulse value of each image row, the travel distance of each image row relative to the starting position of the fabric and the corresponding fabric position are determined by using the calibration relationship between the encoder pulse and the fabric travel distance. Continuous image rows are connected in order from front to back according to the fabric position, so that adjacent image rows maintain pixel column correspondence in the fabric width direction. The image rows are checked for missing rows, duplicate acquisitions, or abnormal position order, and the continuous valid image rows are sequentially stitched into a real-time knitted fabric image.

[0040] S1.3. Use dark field and white field images to correct the fixed noise and illumination difference between the qualified standard sample image and the real-time knitted fabric image, unify the color expression according to the color correction relationship, establish the correspondence between the real-time knitted fabric image and the fabric position, and associate the qualified standard sample image, the real-time knitted fabric image and the correspondence between the real-time knitted fabric image and the fabric position to form a reference color calibration image group.

[0041] It should be noted that, according to the pixel column arrangement of the industrial camera, each image column in the dark field image and the white field image is associated with the corresponding image column in the qualified standard sample image and the real-time knitted fabric image; for each color channel of each image column, the median of the channel response value of the corresponding image column in the dark field image and the white field image is obtained to form the dark field column response value and the white field column response value; the difference between the white field column response value and the dark field column response value is obtained, and this difference is used as the effective white field response value.

[0042] If the white point column response value does not reach the maximum channel value corresponding to the output bit depth of the industrial camera, and the effective white point response value is greater than one quantization level of the industrial camera, the corresponding image column is determined as an effective correction column; the median of the effective white point response value of each effective correction column in the current color channel is obtained, and this median is used as the unified white point reference value; the ratio between the unified white point reference value and the effective white point response value of each effective correction column is used as the illuminance correction coefficient of the corresponding effective correction column.

[0043] When the white field column response value reaches the maximum channel value corresponding to the output bit depth of the industrial camera, or when the effective white field response value is not greater than one quantization level of the industrial camera, the corresponding image column is determined as an invalid correction column. When there are effective correction columns on both sides of the invalid correction column, the first column distance between the invalid correction column and the nearest effective correction column on the left, and the second column distance between the invalid correction column and the nearest effective correction column on the right are obtained. The sum of the first column distance and the second column distance is obtained, and the ratio of the second column distance to the sum of the column distances is used as the left interpolation ratio, and the ratio of the first column distance to the sum of the column distances is used as the right interpolation ratio. The first product between the left illumination correction coefficient and the left interpolation ratio, and the second product between the right illumination correction coefficient and the right interpolation ratio are obtained, and the sum of the first product and the second product is used as the replacement correction coefficient. When there is an effective correction column on only one side of the invalid correction column, the illumination correction coefficient of the nearest effective correction column on that side is used as the replacement correction coefficient. When there is no effective correction column in the current color channel, the dark field image and the white field image are re-acquired.

[0044] The illuminance correction coefficient of the effective correction column and the alternative correction coefficient of the invalid correction column are unified as the column correction coefficient of the corresponding image column. For each pixel position in the qualified standard sample image and the real-time knitted fabric image, the difference between the channel response value and the corresponding dark field column response value is obtained, and the product of the difference and the corresponding column correction coefficient is used as the channel value after fixing noise and illuminance difference correction.

[0045] The corrected red, green, and blue channel values ​​are input into the color correction relationship to obtain the corresponding lightness, red-green, and yellow-blue values. A correspondence between the real-time knitted fabric image and its position is established according to the fabric movement position corresponding to each row and the fabric width direction position corresponding to each column in the real-time knitted fabric image. The corrected and color-unified qualified standard sample image, the real-time knitted fabric image, and the correspondence between the real-time knitted fabric image and its position are then associated and written with the current production batch identifier, inspection station number, and calibration version to form a reference color calibration image group.

[0046] S2. Based on the reference color calibration image group, identify the coil connection relationship and weave period of the qualified standard sample image and the real-time knitted fabric image, establish standard weave grid and real-time weave grid respectively, determine local deformation by comparing the standard weave grid and the real-time weave grid, perform elastic registration based on the local deformation, establish the correspondence between the same weave phase positions, and form a weave phase correspondence record.

[0047] S2.1 Locate the reference position of the standard knitting loop in the qualified standard sample image in the reference color calibration image group, locate the reference position of the real-time knitting loop in the real-time knitted fabric image, and connect the adjacent reference positions of the standard knitting loop and the adjacent reference positions of the real-time knitting loop along the horizontal and vertical directions respectively to form the standard loop connection relationship and the real-time loop connection relationship.

[0048] It should be noted that the brightness values ​​of the qualified standard sample image and the real-time knitted fabric image in the reference color calibration image group are extracted separately; for each pixel position, the brightness difference values ​​of the pixels on both sides in the horizontal direction, vertical direction and two diagonal directions are obtained respectively, and the maximum value of the absolute value of the four brightness differences is taken as the edge response value, and the corresponding direction is determined as the brightness crossing direction; the Otsu's method is used to group all edge response values ​​to determine the edge segmentation value, and the pixel position where the edge response value reaches the edge segmentation value is determined as the edge position.

[0049] Connect adjacent edge positions in a direction perpendicular to the lightness crossing direction to form candidate yarn edges; edge positions that cannot be connected to other edge positions are not included in the candidate yarn edges; trace the closed contour along the candidate yarn edges, determine the position with the smallest longitudinal coordinate value in the closed contour as the top bending position, form the left side and right side from the top bending position along the two tracing directions of the closed contour, and determine the position where the left side and right side are reconnected at the bottom of the closed contour as the bottom overlay position to form the knitting loop contour.

[0050] When there is an inclusion relationship between multiple closed contours, the closed contour that surrounds other closed contours is determined as the knitting loop contour; the candidate yarn edges that cannot form a closed contour or intersect with the image boundary do not form a knitting loop contour; the average horizontal coordinate and the average vertical coordinate of each pixel position within the range of the knitting loop contour are obtained, and the position corresponding to the two average values ​​is determined as the knitting loop reference position, and the standard knitting loop reference position and the real-time knitting loop reference position are formed respectively.

[0051] Based on the correspondence between the real-time knitted fabric image and the fabric position, the image column direction is determined as the knitted fabric width direction, and the image row direction is determined as the knitted fabric travel direction; when two knitted loop outlines are connected to the edge of the same candidate yarn, the corresponding knitted loop reference position is connected, and the connection direction and connection spacing are recorded to form standard loop connection relationship and real-time loop connection relationship respectively.

[0052] S2.2 Analyze the repetition interval and arrangement of the standard coil connection relationship and the real-time coil connection relationship, determine the standard weave cycle and the real-time weave cycle, mark the weave phase of the standard knitting coil reference position and the real-time knitting coil reference position, and establish the standard weave grid and the real-time weave grid respectively.

[0053] It should be noted that the reference positions of standard knitting loops are arranged along the horizontal and vertical directions respectively; for each reference position of standard knitting loops, the front and rear connections of the horizontal row, the top and bottom connections of the vertical row, and the arrangement order of each connected object are recorded to form a connection status code.

[0054] Candidate repeating ranges are set in the horizontal and vertical directions according to the number of included positions from few to many. When the candidate repeating ranges can form two complete arrangement ranges, the connection status codes of the same relative positions in adjacent arrangement ranges are compared one by one. When all connection status codes are the same, the first candidate repeating range that meets the condition is determined as the standard repeating range in the corresponding direction. The standard repeating ranges in the horizontal and vertical directions are combined to determine the standard organization cycle. When two complete arrangement ranges cannot be formed, qualified standard sample images are re-acquired.

[0055] The number of row positions and column positions included in the standard weave cycle are used as the number of row positions and column positions for the candidate real-time cycle range. Real-time knitting coil reference positions are sequentially selected as candidate phase starting points in the real-time coil connection relationship. A corresponding number of real-time knitting coil reference positions are extracted from the candidate phase starting points along the row and column directions to form the candidate real-time cycle range. The connection status codes of the candidate real-time cycle range and the standard weave cycle are compared according to their relative arrangement positions in the standard weave cycle, and the number of different coded positions corresponding to each candidate phase starting point is recorded. The candidate phase starting point with the fewest different coded positions is determined as the real-time phase starting point. When multiple candidate phase starting points exist, the real-time phase starting point is determined according to the ascending order of the row and column numbers. The real-time weave cycle is then determined based on the real-time phase starting point and the candidate real-time cycle range.

[0056] Starting from the phase start point of the standard weaving cycle and the real-time weaving cycle, the weaving phase is marked according to the row number and column number within the cycle, respectively. The reference position of the knitting loop, the loop connection relationship, the weaving cycle and the weaving phase are associated to establish the standard weaving grid and the real-time weaving grid.

[0057] S2.3. According to the comparison of the standard knitting loop reference position in the standard tissue grid and the real-time knitting loop reference position in the real-time tissue grid, determine the position offset, spacing change and direction deflection, and merge the continuously changing real-time knitting loop reference positions along the horizontal and vertical directions to form local deformation.

[0058] It should be noted that the comparison relationship between the standard knitting loop reference position and the real-time knitting loop reference position is determined based on the knitting cycle number, row phase, and column phase in the standard knitting grid and the real-time knitting grid.

[0059] Obtain the coordinate difference of the corresponding position in the horizontal and vertical directions, and combine the two coordinate differences to form the position offset; obtain the connection spacing difference between the corresponding position and the adjacent positions in the horizontal and vertical directions, and form the horizontal spacing change and vertical spacing change respectively; obtain the angle difference between the corresponding standard connection direction and the real-time connection direction, and use the angle difference as the direction deflection.

[0060] Change direction codes are generated according to the positive, zero, or negative values ​​of position offset components, changes in horizontal and vertical spacing, and changes in direction deviation. The reference positions of adjacent real-time knitting loops are checked along the connection relationship of real-time loops. Positions with the same change direction code and directly connected are grouped into the same change range. The change range, corresponding position, and various change results are associated to form local deformation.

[0061] S2.4. Divide the continuous deformation range according to the real-time knitting loop reference position and change direction involved in the local deformation. Based on the position offset, spacing change and direction deflection of the real-time knitting loop reference position relative to the standard knitting loop reference position within the continuous deformation range, determine the correction position corresponding to the real-time knitting loop reference position.

[0062] It should be noted that the standard phase start point and the real-time phase start point are respectively used as the local coordinate start points, and the horizontal and vertical directions of the standard weave grid are used as the common local coordinate directions to transform the standard knitting loop reference position and the real-time knitting loop reference position into the common local coordinate range.

[0063] For each real-time knitting loop reference position in local deformation, the corresponding standard knitting loop reference position is found according to the weave cycle number, column phase, and column phase; the difference between the column coordinates of the standard knitting loop reference position and the column coordinates of the real-time knitting loop reference position, as well as the difference between the column coordinates of the standard knitting loop reference position and the column coordinates of the real-time knitting loop reference position, are obtained, and the two coordinate differences are combined to form the position correction amount.

[0064] The applicable continuous deformation range for the position correction amount is determined based on the changes in row spacing, column spacing, and directional deflection. This ensures that adjacent positions adjusted within the same continuous deformation range maintain their original arrangement order and correspond to the connection spacing and direction of the reference position of the corresponding standard knitting loop. Changes in row spacing, column spacing, and directional deflection are not repeatedly added as additional correction amounts. The coordinate sum between the real-time knitting loop reference position and the position correction amount is obtained, and the position corresponding to this coordinate sum is determined as the correction position.

[0065] When the image boundary position cannot determine the complete tissue cycle number, no correction position is formed, and the original image coordinates of the corresponding real-time knitting coil reference position are retained.

[0066] S2.5 Adjust the real-time knitting loop reference position to the corresponding correction position to form the registration grid position, and maintain the real-time loop connection relationship and the tissue phase arrangement order to establish the registration tissue grid.

[0067] It should be noted that the real-time knitting loop reference position that can determine the correction position is adjusted to the corresponding correction position to form a registration grid position, and the original image coordinates, weave cycle number, row phase and column phase of the real-time knitting loop reference position are retained.

[0068] Connect the registration grid positions according to the connection objects in the real-time coil connection relationship, redetermine the connection spacing and connection direction based on the registration grid positions, without adding, deleting or exchanging connection objects; associate the registration grid positions, original image coordinates, coil connection relationships, tissue cycle numbers and tissue phases to establish a registration tissue grid.

[0069] S2.6. According to the structure phase comparison, the registration grid position and the standard knitting loop reference position are compared to establish the correspondence between the same structure phase positions. The position of the registration grid position in the real-time knitted fabric image, the position of the standard knitting loop reference position in the qualified standard sample image, the structure phase and local deformation are recorded to form a structure phase correspondence record.

[0070] It should be noted that complete tissue cycles are extracted from both the standard tissue grid and the registered tissue grid. The effective correspondence range is determined by the number of complete tissue cycles present in both tissue grids. Incomplete tissue cycles at the image boundaries are not included in the effective correspondence range.

[0071] Within the effective correspondence range, the registration grid positions with the same organization cycle number, row phase, and column phase are established to correspond with the reference positions of standard knitting loops. When the organization phase appears repeatedly in different organization cycles, the corresponding positions are distinguished by the organization cycle number, so that each registration grid position corresponds to only one reference position of standard knitting loop.

[0072] Record the correction coordinates of the registration grid position, the original image coordinates of the corresponding real-time knitting loop reference position, the image coordinates of the standard knitting loop reference position in the qualified standard sample image, the organization cycle number, the organization phase and local deformation, and form an organization phase correspondence record.

[0073] Furthermore, refer to Figure 5 To verify the adaptability of the elastic registration of the tissue phase to local deformation of knitted fabrics, the reference position of the standard knitted loop in the standard tissue grid was used as the position reference. Position offset, row spacing variation, column spacing variation, and orientation deflection were applied to the real-time tissue grid. Fixed image coordinate comparison, rigid registration of the entire image, affine registration of the entire image, and the elastic registration of the tissue phase of this invention were then used for processing. As the orientation deflection of the real-time tissue grid relative to the standard tissue grid increased, the registration error of each processing method changed. Among them, the average normalized registration error corresponding to the elastic registration of the tissue phase of this invention remained in a relatively low range, and the error growth rate was smaller than that of other processing methods. This result shows that the present invention establishes a correspondence between the reference position of the standard knitted loop and the reference position of the real-time knitted loop according to the tissue cycle and tissue phase, and determines the position correction amount according to different continuous deformation ranges. This can adapt to the non-uniform stretching, compression, and orientation changes in different areas of the knitted fabric, and reduce the local position mismatch caused by using a uniform transformation of the entire image.

[0074] Figure 5 The fixed image coordinate comparison, rigid registration of the whole image, and affine registration of the whole image are all control processing methods set in this simulation experiment: the fixed image coordinate comparison does not adjust the position of the real-time knitting coil reference position, but directly compares the same image coordinate positions in the two images; the rigid registration of the whole image determines the uniform translation and rotation amount according to all valid corresponding positions, and makes overall adjustments to the real-time mesh; the affine registration of the whole image further uses uniform scale change and shear change parameters to adjust the real-time mesh, but the same set of affine parameters still applies to the whole image.

[0075] The present invention establishes the correspondence between the reference positions of knitting loops according to the knitting cycle number, the horizontal phase and the vertical phase, and determines the continuous deformation range according to the position offset, the change of the distance between adjacent positions and the change of direction; and forms position correction amounts for different continuous deformation ranges, so that the local position can be adjusted according to the actual deformation state of the corresponding area, instead of using the same set of overall transformation parameters.

[0076] Figure 5The directional deflection on the horizontal axis represents the degree of change in the orientation of the knitted loops in the real-time mesh relative to the corresponding orientation in the standard mesh. Increased directional deflection indicates a greater directional difference between the standard and real-time meshes, and consequently, a greater number of positional variations that the registration method needs to handle.

[0077] Figure 5 The average normalized registration error in the vertical axis is formed by the position-level registration error. For each valid corresponding position, the two-dimensional positional distance between the processed real-time knitted loop reference position and the corresponding standard knitted loop reference position is obtained. Then, the two-dimensional positional distance is scaled by using the spacing between adjacent knitted loop reference positions in the standard fabric grid. The average normalized registration error is obtained by averaging the scaled results of all valid corresponding positions under the same processing conditions. The smaller the average normalized registration error, the closer the processed real-time knitted loop reference position is to the corresponding standard fabric phase position.

[0078] S3. Based on the reference color calibration image group, identify the range of structural anomalies in the real-time knitted fabric image, and compare the real-time knitted fabric image with the qualified standard sample image at the same phase position to determine the original color deviation. Analyze the spatial correspondence and change correlation between the range of structural anomalies and the original color deviation to form a structural color deviation correlation map.

[0079] S3.1 According to the corresponding tissue phase record, extract the reference position of the standard knitting loop and the position of the registration mesh with the same tissue phase from the standard tissue mesh and the registration tissue mesh, compare the continuity of the knitting loop connection, the adjacent spacing and the opening shape of the corresponding position, and locate the structural difference position in the registration tissue mesh.

[0080] It should be noted that, according to the corresponding records of the organization phase, the reference position of the standard knitting loop and the registration grid position corresponding to the organization cycle number, the horizontal phase and the vertical phase are extracted, the horizontal connection object, the vertical connection object and the adjacent spacing of the corresponding position are read, and the opening width, opening height, opening direction and boundary closure status of the corresponding knitting loop are extracted from the qualified standard sample image and the real-time knitted fabric image.

[0081] For each tissue phase, extract the reference positions of standard knitting loops corresponding to all complete standard tissue cycles in the standard tissue grid; count the occurrence frequency of each row connection object, column connection object, and boundary closure state, and determine the state with the highest occurrence frequency as the standard connection state and standard closure state; when the occurrence frequencies are the same, determine the state corresponding to the standard tissue cycle with the smallest tissue cycle number as the standard state; obtain the minimum and maximum values ​​of adjacent spacing and opening width-to-height ratio in all complete standard tissue cycles to form the normal variation range of the corresponding parameters; obtain the directed angle of the opening direction relative to the standard row direction, and form the normal variation range of the opening direction based on the minimum and maximum values ​​of all directed angles; if the standard tissue grid cannot obtain two complete standard tissue cycles, re-acquire qualified standard sample images and establish a standard tissue grid.

[0082] When the horizontal or vertical connected objects or the boundary closure state of the registration grid position are inconsistent with the corresponding standard state, the connection difference is determined; when the adjacent spacing, opening aspect ratio, or opening direction of the registration grid position exceeds the corresponding normal variation range, the spacing difference or opening shape difference is determined respectively; when any of the connection difference, spacing difference, and opening shape difference is met, the corresponding registration grid position is determined as the structural difference position, and the real-time knitted fabric image position, weave phase, structural difference type, and corresponding difference result are recorded.

[0083] S3.2 Map the structural difference locations to the real-time knitted fabric image, merge adjacent structural difference locations along the horizontal and vertical directions, and merge recurring structural difference locations according to the weave cycle to determine the range of structural anomalies.

[0084] It should be noted that, according to the corresponding records of the organization phase, based on the real-time knitting loop reference position corresponding to the structural difference position, the structural difference position is restored to the original image coordinates in the real-time knitted fabric image, and the knitting loop areas that produce connection differences, spacing differences, or opening shape differences are marked.

[0085] Check the real-time coil connection relationship between structural difference locations along the horizontal and vertical directions; when two structural difference locations are directly adjacent and their corresponding knitting coil areas are connected or overlapped, they are classified into the same continuous structural difference area, and the area boundary and the included structural differences are determined.

[0086] Based on the real-time organizational cycle, the tissue phase arrangement and structural difference type of continuous structural difference regions are compared: continuous structural difference regions located in different organizational cycles but with the same tissue phase arrangement and structural difference type are classified into the same structural anomaly range; when regions are adjacent, the boundaries are merged, and when intervals occur, the boundaries of each region and the periodic repetition position are recorded; the continuous structural difference regions, region boundaries, tissue phase, structural difference type and periodic repetition position are associated to determine the structural anomaly range.

[0087] S3.3. According to the corresponding records of the weave phase, compare the lightness and chromaticity values ​​of the same weave phase positions in the real-time knitted fabric image and the qualified standard sample image after color unification, determine the lightness deviation, chromaticity deviation and comprehensive color difference of the same weave phase positions, and form the original color deviation.

[0088] It should be noted that, according to the corresponding organizational phase record, the position of the registration grid in the real-time knitted fabric image and the position of the corresponding standard knitted loop reference position in the qualified standard sample image are read. Taking the two corresponding positions as the center and the midline between the reference positions of adjacent knitted loops in the horizontal and vertical directions as the boundary, the loop color comparison area covering the knitted loops and loop openings of the same organizational phase is divided.

[0089] The lightness, red-green, and yellow-blue values ​​of the two coil color comparison areas after color unification are extracted respectively, and the color state of the corresponding tissue phase position is represented by the median of each color parameter. The difference in lightness value between the real-time knitted fabric image and the qualified standard sample image is determined as lightness deviation, the difference in the corresponding red-green value is determined as red-green deviation, and the difference in the corresponding yellow-blue value is determined as yellow-blue deviation. The square root of the sum of the squares of the three color deviations is used as the comprehensive color difference, and the magnitude and direction of each color deviation are retained.

[0090] The image positions of the real-time knitted fabric, the image positions of the qualified standard sample, the weave phase, the brightness deviation, the red-green tint deviation, the yellow-blue tint deviation, and the overall color difference are saved to form the original color deviation.

[0091] S3.4. Overlay the original color deviation onto the corresponding position in the real-time knitted fabric image, analyze the overlap, boundary correspondence, and synchronous change status of the structural anomaly range and the original color deviation, establish spatial correspondence and change correlation, and form a structural color deviation correlation map.

[0092] It should be noted that, based on the real-time knitted fabric image position recorded in the original color deviation, the brightness deviation, red-green hue deviation, yellow-blue hue deviation, and overall color difference are marked to the corresponding tissue phase position, so that the range of structural anomalies uses the same image position reference as the original color deviation.

[0093] For each tissue phase, the brightness, red-green, and yellow-blue values ​​of the corresponding positions of all complete standard tissue cycles in the standard tissue grid are extracted. The maximum value of the absolute value of the difference of each color parameter between adjacent standard tissue cycles is obtained, and the brightness change benchmark, red-green change benchmark, and yellow-blue change benchmark are formed respectively.

[0094] When the area of ​​structural anomaly and the original color deviation cover the same tissue phase position, it is recorded as an overlapping position; when the boundary of the area of ​​structural anomaly and the boundary of the original color deviation distribution pass through the same or directly adjacent tissue phase positions, it is recorded as a boundary corresponding position. Along the horizontal, vertical, and tissue cycle arrangement order, the color deviation difference between adjacent tissue phase positions is obtained; when the absolute value of any color deviation difference reaches the corresponding color change benchmark, and there are changes in connection, spacing, or opening morphology at the same or directly adjacent tissue phase positions, it is recorded as a synchronous change position.

[0095] By associating the range of structural anomalies, original color deviations, overlapping positions, corresponding boundary positions, synchronous change positions, and corresponding structural difference types, a structural color deviation correlation map is formed.

[0096] S4. Extract coil structure reference information and local color continuity information from the neighborhood of the structural anomaly range from the structural color deviation correlation map, reconstruct the counterfactual correction image, and compare it with the real-time knitted fabric image and the qualified standard sample image to separate the structure-induced color deviation from the actual production color deviation and form a true color difference distribution map.

[0097] S4.1 Extract the structural anomaly range from the structural color deviation correlation map, record the corresponding tissue phase, extract the standard knitting coil morphology with the same tissue phase as the structural anomaly range from the qualified standard sample image, and extract the knitting coil connection status around the structural anomaly range from the real-time knitted fabric image to form coil structure reference information.

[0098] It should be noted that the structural anomaly range, overlapping position, boundary corresponding position, synchronous change position, weave phase and structural difference type are read from the structural color deviation correlation map, and the standard knitting loop reference position corresponding to each real-time knitting loop reference position within the structural anomaly range is determined according to the weave phase corresponding record.

[0099] Extract the outline, opening shape, yarn direction and adjacent connection position of the knitted loops corresponding to the weave phase from the qualified standard sample image, and arrange the standard knitted loop shapes according to the weave cycle number, row phase and column phase; determine the knitted loops outside the structural anomaly range connected at the corresponding boundary position as boundary connection objects, and determine the connection differences, spacing differences or opening shape differences corresponding to the synchronously changing positions as the structural content to be reconstructed.

[0100] The reference positions of real-time knitting loops directly connected to the boundary connection objects are extracted along the boundary of the structural anomaly range. The connection objects, connection directions, connection spacing and weave phase are recorded. The standard knitting loop shape, boundary connection objects and the content of the structure to be reconstructed are associated to form loop structure reference information.

[0101] S4.2 Extract the brightness, chromaticity, and color change direction of the area around the structural anomaly and the corresponding tissue phase position from the real-time knitted fabric image and adjacent real-time knitted fabric images. Connect the color changes according to the fabric position correspondence in the reference color calibration image group to form local color continuity information.

[0102] It should be noted that, based on the correspondence of fabric positions in the reference color calibration image group, the direction of increasing the image row coordinates is determined as the fabric running direction, and the direction of increasing the image column coordinates is determined as the fabric width direction; according to the weave phase correspondence record, the original image coordinates of each weave phase position are converted into the fabric running direction position and the fabric width direction position, and the horizontal or vertical direction is not directly used as the fabric position direction.

[0103] Extract the knitted loop positions that are directly adjacent to the structural anomaly range and correspond to the tissue phase from outside the structural anomaly range, excluding overlapping and synchronously changing positions in the structural color shift correlation map; when the structural anomaly range extends to the boundary of the current real-time knitted fabric image, continue to extract the tissue phase positions that meet the conditions from the adjacent real-time knitted fabric images that cover the continuous fabric positions.

[0104] The color extraction area is divided with the midline between the reference positions of adjacent knitting loops around each tissue phase position as the boundary. The median of the brightness value, red-green value and yellow-blue value in the area is obtained and the three medians are used as the color state of the corresponding tissue phase position.

[0105] For each tissue phase position, the nearest positions with the same tissue phase on both sides and not within the range of structural anomalies are found along the fabric running direction and fabric width direction respectively; when both positions exist, the difference between the color parameters of the two positions and the position distance are obtained, and the ratio between the difference and the position distance is used as the local color change rate in the corresponding direction; when only one position exists, the difference between the color parameters of that position and the current tissue phase position and the position distance are obtained, and the ratio between the two is used as the local color change rate.

[0106] When the color parameters of the two sides change in opposite directions relative to the current tissue phase position, the current tissue phase position is marked as a color transition position, and no local color change rate is formed in the corresponding direction; when there is no available adjacent position in the corresponding direction, no color change rate is recorded in that direction. The fabric position, tissue phase, color state, local color change rate, color transition position, and connection order are associated to form local color continuity information.

[0107] S4.3. Reconstruct the knitting coil connection status and opening shape within the structural anomaly range according to the coil structure reference information, and continue the color change of the reconstructed area according to the local color continuity information to form a counterfactual correction image when the structural anomaly has not occurred.

[0108] It should be noted that, for each tissue phase position to be reconstructed within the structural anomaly range, the target reconstruction area is defined by the centerline between the reference positions of adjacent knitting loops in the horizontal and vertical directions, and the standard reconstruction area with the same tissue phase is extracted from the qualified standard sample image; the local coordinates of the area are established in the horizontal and vertical directions of the standard tissue grid and the registered tissue grid, respectively, and the horizontal and vertical position ratios of each pixel in the standard reconstruction area relative to the area boundary are obtained. Pixels with the same position ratio in the target reconstruction area are determined as mapping positions, and the standard knitting loop outline, opening shape, yarn direction and adjacent connection position are mapped accordingly; adjacent target reconstruction areas use a common centerline as the boundary to form a counterfactual structural range.

[0109] For each tissue phase, the color state corresponding to all complete standard tissue cycles in the qualified standard sample image is extracted, the comprehensive color difference between each color state and the median of the color state is obtained, and the maximum value of the comprehensive color difference and the maximum fitted color difference in the color correction relationship record is determined as the allowable color difference of the tissue phase.

[0110] For the tissue phase position to be reconstructed, color reference positions that are outside the structural anomaly range, have the same tissue phase, and are closest to the structural anomaly range are extracted along the fabric running direction and fabric width direction, respectively. Color transition positions, other structural anomaly ranges, and positions that do not form a local color change rate are excluded to form a set of color reference positions. The set of color reference positions should contain color reference positions from two different directions. If this condition is not met, the tissue phase position to be reconstructed is marked as an invalid counterfactual reconstruction position.

[0111] Based on the reconstructed coil connection status, find all connection paths from the color reference position to the phase position of the tissue to be reconstructed, obtain the number of coil connections contained in each connection path, and take the minimum value as the number of coil connections from the corresponding color reference position to the phase position of the tissue to be reconstructed; when there are multiple shortest connection paths, use the same number of coil connections.

[0112] The expression for calculating the counterfactual color value corresponding to the phase position of the tissue to be reconstructed is: ; The expression for calculating color carrying weight is: ; in, Phase position of the organization to be reconstructed The corresponding counterfactual color value, These represent brightness, red-green hue, and yellow-blue hue, respectively. Phase position with the tissue to be reconstructed The corresponding set of color reference positions For color reference position The actual color parameter value, For color reference position Corresponding color parameters along the fabric running direction The rate of local color change For color reference position Corresponding color parameters along the fabric width direction The rate of local color change Phase position of the organization to be reconstructed Coordinates of the fabric running direction along the fabric running direction. For color reference position Coordinates of the fabric running direction along the fabric running direction. Phase position of the organization to be reconstructed The width coordinate along the fabric width direction. For color reference position The width coordinate along the fabric width direction. For color reference position To the point of reconstructing the organizational phase position Number of coil connections passed through, For color reference position To the point of reconstructing the organizational phase position Color carries weight. For color reference position To the point of reconstructing the organizational phase position The number of coils connected.

[0113] For each color reference location in the color reference location set, candidate color values ​​are obtained based on the corresponding color parameter value, local color change rate, and positional difference. The maximum comprehensive color difference among these candidate color values ​​is also calculated. If the maximum comprehensive color difference among the candidate color values ​​does not exceed the allowable difference in tissue phase color, a counterfactual color value is generated according to the color inheritance weight. If the maximum comprehensive color difference among the candidate color values ​​exceeds the allowable difference in tissue phase color, the tissue phase location to be reconstructed is marked as an invalid counterfactual reconstruction location. If the color reference location set is empty or does not contain two color reference locations in different orientations, the color inheritance weight and counterfactual color value are not calculated.

[0114] When the counterfactual brightness value is below zero, it is taken as zero; when it exceeds one hundred, it is taken as one hundred. When the counterfactual red-green value and the counterfactual yellow-blue value exceed the corresponding color coverage range recorded in the color correction relationship, the corresponding lower limit or upper limit of color coverage is used respectively. The difference between the color parameters of each pixel in the standard reconstruction area and the median of the color parameters in that area is obtained. The sum of this difference and the counterfactual color value is used as the pixel color parameter of the corresponding mapped position in the target reconstruction area, thereby preserving the texture and brightness variation in the knitted loop area. The counterfactual structural range and pixel color parameters are written into the structural anomaly range, and the image content outside the structural anomaly range is preserved to form the counterfactual corrected image.

[0115] S4.4 Compare the brightness and chromaticity values ​​of the corresponding positions of structural anomalies in the real-time knitted fabric image and the counterfactual correction image, and determine the color difference between the real-time knitted fabric image and the counterfactual correction image as structure-induced color deviation.

[0116] It should be noted that, according to the corresponding records of the tissue phase, the coil color comparison areas with the same tissue phase are extracted from the real-time knitted fabric image and the counterfactual correction image, and the median values ​​of lightness, red-green hue, and yellow-blue hue of the two areas are obtained respectively.

[0117] The differences in lightness, red-green hue, and yellow-blue hue between the real-time knitted fabric image and the counterfactual corrected image are obtained and used as structure-induced lightness deviation, structure-induced red-green hue deviation, and structure-induced yellow-blue hue deviation, respectively. The sum of squares and the square root of the three structure-induced color deviations are obtained and used as the structure-induced comprehensive color difference.

[0118] Structure-induced color shift is determined when the overall color difference reaches the permissible difference in tissue phase color; if the overall color difference does not reach the permissible difference in tissue phase color, no structure-induced color shift is formed. Invalid locations from counterfactual reconstruction are not included in the independent determination of structure-induced color shift.

[0119] S4.5. According to the corresponding records of tissue phases, compare the lightness and chromaticity values ​​of the same tissue phase position in the counterfactual correction image and the qualified standard sample image, and determine the color difference that still exists after counterfactual correction as the true production color deviation.

[0120] It should be noted that, according to the corresponding organizational phase record, the coil color comparison areas with the same organizational phase are extracted from the counterfactual correction image and the qualified standard sample image, and the difference in lightness value, red-green value, and yellow-blue value between the two areas are obtained, which are respectively used as the actual production lightness deviation, actual production red-green value deviation, and actual production yellow-blue value deviation; the square root of the sum of the squares of the three actual production color deviations is obtained, and the sum of the squares is used as the actual production comprehensive color difference.

[0121] When the overall color difference in actual production reaches the allowable difference in organizational phase color, it is determined as actual production color deviation; when the overall color difference in actual production does not reach the allowable difference in organizational phase color, it does not constitute actual production color deviation.

[0122] The independent separation of color deviation is applicable under the condition that the color deviation in actual production has color continuity along the position of the continuous knitted fabric and can be characterized by the same phase color state outside the range of structural anomalies.

[0123] Independent coloring changes that exist only within the structural anomaly range and do not have color continuity outside the structural anomaly range are not considered as structurally induced color deviations or actual production color deviations that have been independently separated; locations where counterfactual reconstruction is invalid and locations that do not meet the applicable conditions for color continuity are marked as structural and production color deviation locations to be reviewed.

[0124] S4.6. Map the structure-induced color deviation and the actual production color deviation to the real-time knitted fabric image position. For positions where both structure-induced color deviation and actual production color deviation exist, retain the structure-induced color deviation and the actual production color deviation respectively, and form an actual color difference distribution map according to the color deviation range, color deviation direction and comprehensive color difference of the actual production color deviation.

[0125] It should be noted that, according to the corresponding records of the organization phase, the positions of the structure-induced color deviation, the actual production color deviation, and the color deviation to be verified in the structure and production are respectively mapped to the original image positions in the real-time knitted fabric image. When the same position corresponds to multiple results at the same time, they are recorded separately.

[0126] Check adjacent actual production color deviation positions along the real-time coil connection relationship. Positions that are directly connected and whose actual production brightness deviation, actual production red-green deviation, and actual production yellow-blue deviation are of the same positive and negative state are classified into the same color deviation range. When the connection relationship is interrupted or the positive and negative state of any actual production color deviation changes, the corresponding color deviation range is terminated.

[0127] Each color deviation range is defined as a color difference region. The minimum and maximum values ​​of the horizontal and vertical serial numbers within each color difference region are obtained. The region boundaries are determined based on the four serial number values. The color deviation direction and the actual production color difference are recorded to form an actual color difference distribution map. The color deviation positions of structures and production to be reviewed are recorded separately as regions to be reviewed and are not included in the color difference region.

[0128] Furthermore, refer to Figure 6To verify the effectiveness of counterfactual correction in separating structure-induced color deviation from actual production color deviation, knitted fabric images were constructed, including those with normal color states, structural anomalies, actual production color deviations, simultaneous existence of structural anomalies and actual production color deviations, and color change sources that could not be reliably distinguished. These images were then processed using direct standard sample comparison, tissue phase registration only, direct color substitution of standard samples, and the counterfactual correction method of this invention. Comparative results show that the counterfactual correction method of this invention has better overall performance in identifying actual production color deviations, eliminating structure-induced color deviations, determining the actual color difference range, and identifying locations requiring verification. This result demonstrates that this invention does not directly use the color of a qualified standard sample image to cover the structural anomaly range. Instead, it utilizes color reference positions outside the structural anomaly range that have tissue phase correspondence, combining local color change rates and color carrying weights to reconstruct the color state when the structural anomaly has not occurred. This reduces interference from structural anomalies while preserving the original production color changes of the real-time knitted fabric.

[0129] Figure 6 The four processing methods use the same real-time knitted fabric image and qualified standard sample image, only changing the processing method for the location of structural anomalies; direct standard sample comparison does not perform tissue phase elastic registration and counterfactual correction, directly comparing the color state of the same image coordinate position in the two images, and therefore may be affected by both tissue position misalignment and structural changes; only tissue phase registration compares the color state according to the tissue phase correspondence, which can reduce position mismatch, but does not reconstruct the color state when the structural anomaly has not occurred, and the apparent color change caused by the structural anomaly may still be identified as production color deviation.

[0130] The direct replacement of standard sample color involves replacing the color state within the range of structural anomalies with the color state of the corresponding tissue phase in the qualified standard sample image. This process can eliminate some of the apparent color changes caused by structural anomalies, but it does not utilize the color change trend outside the range of structural anomalies in real-time knitted fabrics, and therefore may cover the actual continuous production color changes.

[0131] This invention uses counterfactual correction to select color reference positions outside the structural anomaly range that have an organizational phase correspondence with the position to be corrected. It forms a local color change rate based on the color changes between adjacent color reference positions and determines the color carrying weight based on the positional relationship and color consistency between the color reference positions and the position to be corrected. The local color change rate is then extended to the structural anomaly range according to the color carrying weight, forming the counterfactual color value when the structural anomaly has not occurred. Finally, the real-time color state, the counterfactual color state, and the color state of the qualified standard sample are compared to distinguish between structure-induced color deviation, actual production color deviation, and the position of color deviation between structure and production to be verified.

[0132] Figure 6The accuracy of the true production color deviation is used to evaluate whether the locations identified as true production color deviations are accurate. This indicator represents the proportion of locations that are actually true production color deviations among all locations identified as true production color deviations, and can reflect the degree to which structure-induced color changes are incorrectly classified as true production color deviations.

[0133] The true production color deviation recall rate is used to evaluate whether the actual color deviations in production have been fully detected. This indicator represents the proportion of the true production color deviation locations that are correctly identified, and it, along with the true production color deviation precision rate, reflects the aspects of false detection and missed detection, respectively.

[0134] The non-false positive rate of structure-induced color deviation specifically evaluates whether color changes caused by structural anomalies are incorrectly identified as true production color deviations. This indicator represents the proportion of structure-induced color deviation locations that are not incorrectly classified as true production color deviations. Therefore, it differs from the evaluation object of the precision rate of true production color deviation: the precision rate of true production color deviation starts from the detection results, while the non-false positive rate of structure-induced color deviation starts from the location of structural anomalies.

[0135] The intersection-union ratio of the true color difference range is used to evaluate the degree of spatial overlap between the detected true color difference range and the set true production color difference range. The closer the detected range is to the set range, the higher the ratio of their intersection to their union, indicating that the boundary and influence range of the true production color difference are more accurately determined.

[0136] The identification rate of the location to be verified is used to evaluate the processing effect when the source of color change cannot be reliably distinguished. For locations where structural anomalies and color changes coexist, but there is a lack of corresponding color evidence outside the range of structural anomalies, this invention does not directly classify them as structurally induced color deviation or actual production color deviation, but rather identifies them as structural and production color deviation locations to be verified. The identification rate of the location to be verified reflects the degree to which the verification status of such locations is correctly preserved. Figure 6 All indicators are calculated based on the same batch of location-level color state true values ​​and corresponding processing results to ensure that all evaluation results have a consistent data basis.

[0137] S5. According to the fabric position correspondence in the reference color calibration image group, locate the fabric position corresponding to each color difference area in the real color difference distribution map, and associate the position continuity and color deviation change of the color difference area in the adjacent real-time knitted fabric image to form a color difference continuity trajectory. Based on the color difference continuity trajectory, confirm the continuous production color difference and distribution type, and generate a production color difference detection record.

[0138] S5.1 According to the fabric position correspondence in the reference color calibration image group, convert the image position of each color difference region in the real color difference distribution map into the fabric position range on the continuous knitted fabric, and record the start and end positions and color deviation direction of the fabric position range.

[0139] It should be noted that the color deviation range is extracted one by one from the real color difference distribution map, each color deviation range is determined as a color difference region, and a color difference region label is set; the real-time knitted fabric image position, weave phase, region boundary, color deviation direction and real production comprehensive color difference contained in the color difference region are read.

[0140] Based on the correspondence of fabric positions in the reference color calibration image group, the image row coordinates of each tissue phase position in the color difference area are converted into the fabric running direction position, and the image column coordinates are converted into the fabric width direction position; the minimum and maximum values ​​of the fabric running direction position are obtained, and the two positions are used as the fabric start position and fabric end position, respectively; the minimum and maximum values ​​of the fabric width direction position are obtained, and the two positions are used as the width direction boundary.

[0141] Transform the corresponding fabric coordinates according to the original connection order of the area boundary points to form the position boundary of the color difference area. Then, associate the color difference area identifier, fabric start and end positions, width direction boundary, position boundary, weave phase, color deviation direction and actual production comprehensive color difference to form the fabric position range.

[0142] S5.2. According to the fabric running direction, compare the fabric position range of the color difference area in adjacent real-time knitted fabric images, filter the color difference areas whose fabric position ranges can be continuously connected, and establish candidate continuity relationships.

[0143] It should be noted that the real-time knitted fabric images and each color difference region are arranged according to the fabric running direction. The start and end positions of the fabric and the width direction boundary of adjacent color difference regions are read respectively. When the interval between the fabric end position of the current color difference region and the fabric start position of the next color difference region does not exceed the fabric travel distance corresponding to one image row, and the width direction range of the two color difference regions overlaps or the width direction interval does not exceed the distance between adjacent positions in the width direction in the real-time organization grid, a candidate succession relationship is established.

[0144] Record the identifiers of preceding and succeeding color difference regions and their connection positions in the candidate succession relationships. When the same color difference region corresponds to multiple succeeding color difference regions, or multiple preceding color difference regions correspond to the same succeeding color difference region, retain each candidate succession relationship separately.

[0145] S5.3. Compare the color deviation direction, overall color difference and boundary changes of the color difference area in the candidate inheritance relationship, and associate the color difference areas with continuous connection of fabric position range and continuous change of color deviation direction and overall color difference in sequence to form a color difference inheritance trajectory.

[0146] It should be noted that for each candidate succession relationship, the color deviation direction of the preceding color difference area and the subsequent color difference area are compared with the actual production comprehensive color difference; when the positive and negative states of the actual production lightness deviation, actual production red-green hue deviation and actual production yellow-blue hue deviation of the two color difference areas are consistent, the color deviation direction is determined to be continuous.

[0147] Obtain the absolute value of the actual production overall color difference between two connecting positions, and read the color allowable difference of the corresponding tissue phase at the connecting positions; when the two connecting positions correspond to different tissue phases, obtain the maximum value of the two color allowable differences, and use this maximum value as the acceptance allowable difference; when the absolute value of the actual production overall color difference does not exceed the acceptance allowable difference, the overall color difference is determined to be continuous. When the color deviation direction is continuous and the overall color difference is continuous, the candidate acceptance relationship is retained.

[0148] Obtain the positional differences between the two width-direction boundaries of the subsequent color difference region and the corresponding width-direction boundaries of the preceding color difference region. When the two width-direction boundaries move outward from the color difference region, record the boundary change as expansion; when they move inward from the color difference region, record the boundary change as contraction; when they move along the same width direction, record the boundary change as offset. If the expansion, contraction, or offset conditions are not met, record the positional differences between the two width-direction boundaries respectively. Associate the boundary changes with the corresponding candidate succession relationships.

[0149] Color difference regions that are interconnected by retaining candidate inheritance relationships are grouped into the same directed association range. The arrangement order, boundary changes, bifurcation positions and merging positions of the color difference regions are recorded to form a color difference inheritance trajectory. Each color difference region is assigned to only one color difference inheritance trajectory. The duration and influence range of the trajectory are determined according to the union of the coverage range of all color difference regions within the trajectory.

[0150] S5.4. Check the fabric position continuity status and color deviation direction stability status of the color difference area in consecutive adjacent real-time knitted fabric images along the color difference continuity trajectory. The color difference area with continuous fabric position continuity and stable color deviation direction is identified as the continuous production color difference, and the color difference area with interrupted fabric position continuity and abrupt color deviation direction is excluded.

[0151] It should be noted that the minimum and maximum values ​​of the fabric starting position and ending position of all color difference areas in the color difference receiving trajectory are obtained, and the distance between the two positions is taken as the trajectory duration. The position difference of the fabric running direction in adjacent real-time weaving cycles for the same weaving phase is obtained, and the median of each position difference is taken as the fabric running direction length corresponding to a real-time weaving cycle.

[0152] When the length of the trajectory reaches the fabric running direction length corresponding to a real-time organization cycle, and the positive and negative states of the actual production brightness deviation, actual production red-green deviation, and actual production yellow-blue deviation within the trajectory have not reversed, the corresponding color difference bearing trajectory is determined as a continuous production color difference; when the fabric position bearing is interrupted or the positive and negative states of any actual production color deviation are reversed, the color difference bearing trajectory is disconnected at the corresponding position; the boundary position of the real-time knitted fabric image is only used to verify whether the fabric position is continuous and is not used as a criterion for determining continuous production color difference.

[0153] S5.5 Analyze the extension range of continuous production color difference along the horizontal and vertical directions, the overall color difference change according to the repeating state of the weave cycle and the direction of fabric movement, determine the distribution type of continuous production color difference, record the start and end positions of the fabric, the range of influence, the direction of color deviation, the overall color difference, the duration and distribution type, and generate a production color difference detection record.

[0154] It should be noted that, for each continuous production color difference, the number of horizontal and vertical positions covered by the continuous production color difference, the real-time organization cycle number, organization phase, width direction position, and actual production comprehensive color difference are counted. The distribution type is determined in the order of periodic color spots, whole-piece gradient color difference, local color spots, horizontal color blocks, vertical color stripes, and irregular color differences. If the condition of the first type is met, the subsequent type is not judged.

[0155] When the same organizational phase arrangement and color deviation direction are repeatedly observed in two complete real-time organizational cycles, the continuous production color difference is identified as a periodic color pattern; when it is not identified as a periodic color pattern, and the continuous production color difference continuously covers the starting boundary to the ending boundary from the width direction of the knitted fabric, and the actual production comprehensive color difference change direction arranged along the fabric running direction has not reversed, it is identified as a whole-piece gradient color difference.

[0156] If the color difference is not determined to be a periodic color pattern or a full-length gradient color difference, and the coverage area in both the horizontal and vertical directions does not exceed one real-time tissue cycle in the corresponding direction, it is determined to be a local color spot; if it is not a local color spot, and the number of horizontal positions is greater than the number of vertical positions, it is determined to be a horizontal color stripe, and the number of vertical positions is greater than the number of horizontal positions, it is determined to be a vertical color bar; if the number of horizontal positions is equal to the number of vertical positions and does not meet other type conditions, it is determined to be an irregular color difference.

[0157] The union of all color difference areas covering the fabric range in the color difference trajectory is determined as the influence range. The maximum value of the actual comprehensive color difference in production is obtained, and this maximum value is taken as the degree of color difference. The fabric start and end positions, influence range, color deviation direction, degree of color difference, duration, bifurcation position, merging position and distribution type are associated to generate a production color difference detection record.

[0158] Furthermore, refer to Figure 7To verify the tracking effect of the color difference tracking trajectory on the color difference area of ​​continuous knitted fabric, the range of fabric running direction and width direction boundary for continuously producing color difference were set in the continuous fabric coordinate system. The continuous knitted fabric was divided into multiple real-time knitted fabric images according to the image acquisition range, and processed by independent detection of single images and the color difference tracking trajectory of the present invention. Independent detection of single images only determines the color difference area within each real-time knitted fabric image, without utilizing the fabric position relationship and color change relationship between adjacent images. Therefore, at the image junction, there are likely to be missing boundaries, position jumps, or the same color difference area being recorded in segments.

[0159] This invention transforms color difference regions in different real-time knitted fabric images to a unified continuous fabric coordinate system. It also establishes a connection relationship between color difference regions by comprehensively considering the fabric running direction position, width range, color deviation direction, actual production color difference, and boundary changes. This allows the obtained color difference connection trajectory to remain continuous across image boundaries, thereby improving the accuracy of determining the duration and range of influence of continuous production color differences.

[0160] Figure 7 The lower and upper boundaries of the true value of continuous production color difference are the boundaries of the width direction of continuous production color difference, which are pre-set according to the continuous fabric coordinates before the simulation begins. The two true value boundaries together define the true influence range of continuous production color difference and are only used as a comparison reference for different detection methods. They are not the results obtained by independent detection of a single image or by the color difference trajectory calculation of this invention.

[0161] The lower boundary and upper boundary of the single image are independently detected by color difference detection of each real-time knitted fabric image. This process only retains the detection results within each image and does not use the continuous fabric position, color deviation direction and boundary changes of adjacent images to establish the color difference continuity relationship. Therefore, when the same continuous production color difference crosses the image boundary, the boundary may be missing, offset or discontinuous.

[0162] The lower boundary and upper boundary of the color difference receiving trajectory of this invention are formed by the receiving results of cross-image color difference regions. First, based on the correspondence of fabric positions in the reference color calibration image group, the color difference regions in different real-time knitted fabric images are converted to continuous fabric coordinates. Then, the fabric running direction interval, width direction overlap, color deviation direction, actual production comprehensive color difference, and boundary changes of adjacent color difference regions are compared to determine candidate receiving relationships. Color difference regions are connected according to candidate receiving relationships to form a color difference receiving trajectory, and the influence range boundary of continuous production color difference is determined based on the boundary changes of each color difference region in the trajectory.

[0163] Figure 7The horizontal axis represents the fabric running direction position after the organization cycle position in the real-time knitted fabric image is converted to the running direction position of the continuous knitted fabric, so that the color difference areas in different images can be connected under the same position reference; the vertical axis represents the position of the upper and lower boundaries of the color difference area in the width direction of the knitted fabric, which is used to indicate the expansion, contraction or positional shift of the color difference influence range during continuous production as the fabric runs.

[0164] Figure 7 The image boundary in the image represents the segmentation position of adjacent real-time knitted fabric images in the continuous fabric coordinate system. The image boundary is not the boundary of the chromatic difference region itself, but is used to observe whether different detection methods can maintain the continuity of the chromatic difference trajectory under image segmentation conditions.

[0165] In summary, this invention improves the accuracy of original color deviation positioning by: identifying the coil connection relationship and weave cycle in standard sample images and real-time knitted fabric images; establishing standard weave grids and real-time weave grids; and implementing elastic registration based on position offset, spacing change, and direction deflection to achieve precise correspondence between the same weave phase positions, avoiding interference from fabric stretching, tension fluctuations, and coil deformation in fixed coordinate comparisons; extracting coil structure reference information and local color continuity information from the neighborhood of structural anomalies to reconstruct a counterfactual correction image when structural anomalies have not occurred, and comparing the real-time knitted fabric image, the counterfactual correction image, and the qualified standard sample image respectively to separate structure-induced color deviation from actual production color deviation; and combining the color difference continuity trajectory to continuously locate and identify the distribution type of actual production color deviation, which can reduce misjudgment of color difference caused by structural defects and provide a more reliable detection basis for dyeing, yarn supply, and production process adjustment.

[0166] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for detecting color difference in knitted fabric production based on AI vision, characterized in that, include: Obtain the qualified standard sample image corresponding to the current production batch, use the encoder to trigger the industrial camera to collect real-time knitted fabric images of continuously moving knitted fabric, perform imaging correction and color unification, establish the correspondence between real-time knitted fabric images and fabric positions, and form a reference color calibration image group. Based on the reference color calibration image group, identify the coil connection relationship and weave period of qualified standard sample image and real-time knitted fabric image, establish standard weave grid and real-time weave grid respectively, determine local deformation by comparing standard weave grid and real-time weave grid, perform elastic registration based on local deformation, establish the correspondence between the same weave phase position, and form a weave phase correspondence record; Based on the benchmark color correction image group, the structural anomaly range in the real-time knitted fabric image is identified, and the real-time knitted fabric image is compared with the qualified standard sample image at the same phase position to determine the original color deviation. The spatial correspondence and change correlation between the structural anomaly range and the original color deviation are analyzed to form a structural color deviation correlation map. Extract coil structure reference information and local color continuity information from the neighborhood of structural anomaly range from the structural color deviation correlation map, reconstruct the counterfactual correction image, and compare it with real-time knitted fabric image and qualified standard sample image to separate the structure-induced color deviation from the actual production color deviation and form a true color difference distribution map. Based on the fabric position correspondence in the benchmark color calibration image group, locate the fabric position corresponding to each color difference area in the real color difference distribution map, and associate the position continuity and color deviation changes of the color difference area in the adjacent real-time knitted fabric images to form a color difference continuity trajectory. Based on the color difference continuity trajectory, confirm the continuous production color difference and distribution type, and generate a production color difference detection record.

2. The color difference detection method for knitted fabric production based on AI vision as described in claim 1, characterized in that, The specific steps for forming the reference color calibration image set are as follows: Read the current production batch identifier from the production task, retrieve the qualified standard sample image corresponding to the current production batch identifier, and obtain the dark field image, white field image, color correction relationship, and calibration relationship between encoder pulse and fabric travel distance formed by the calibration of the inspection station. The trigger pulses output by the encoder are used to control the industrial camera to acquire continuously moving knitted fabric line by line. The fabric position corresponding to each image line is determined according to the calibration relationship between the encoder pulses and the fabric travel distance. The continuous image lines are then stitched together to form a real-time knitted fabric image. By using dark field and white field images to correct the fixed noise and illumination differences between qualified standard sample images and real-time knitted fabric images, color expression is unified according to color correction relationships, a correspondence between real-time knitted fabric images and fabric positions is established, and the qualified standard sample images, real-time knitted fabric images, and the correspondence between real-time knitted fabric images and fabric positions are associated to form a reference color calibration image group.

3. The color difference detection method for knitted fabric production based on AI vision as described in claim 2, characterized in that, The process involves identifying the coil connection relationships and weave cycles in the qualified standard sample image and the real-time knitted fabric image, establishing a standard weave mesh and a real-time weave mesh respectively, and determining local deformation by comparing the standard weave mesh and the real-time weave mesh. The specific steps are as follows: Locate the reference position of the standard knitting loop in the qualified standard sample image in the reference color calibration image group, locate the reference position of the real-time knitting loop in the real-time knitted fabric image, and connect the adjacent reference positions of the standard knitting loop and the adjacent reference positions of the real-time knitting loop along the horizontal and vertical directions respectively to form the standard loop connection relationship and the real-time loop connection relationship. Analyze the repetition interval and arrangement of the standard and real-time loop connection relationships, determine the standard and real-time weave cycles, mark the weave phase of the standard and real-time knitting loop reference positions, and establish the standard and real-time weave grids respectively. By comparing the reference positions of standard knitting loops in the standard tissue grid with the reference positions of real-time knitting loops in the real-time tissue grid, the position offset, spacing change and direction deflection are determined, and the continuously changing reference positions of real-time knitting loops along the horizontal and vertical directions are merged to form local deformation.

4. The color difference detection method for knitted fabric production based on AI vision as described in claim 3, characterized in that, The specific steps for forming the tissue phase correspondence record are as follows: The continuous deformation range is divided according to the real-time knitting loop reference position and change direction involved in the local deformation. Based on the position offset, spacing change and direction deflection of the real-time knitting loop reference position relative to the standard knitting loop reference position within the continuous deformation range, the correction position corresponding to the real-time knitting loop reference position is determined. Adjust the real-time knitting loop reference position to the corresponding correction position to form the registration grid position, and maintain the real-time loop connection relationship and the tissue phase arrangement order to establish the registration tissue grid; By comparing the registration grid position with the reference position of the standard knitting loop, a correspondence between the same organizational phase positions is established. The positions of the registration grid position in the real-time knitted fabric image, the positions of the reference positions of the standard knitting loops in the qualified standard sample image, the organizational phase, and local deformation are recorded to form an organizational phase correspondence record.

5. The color difference detection method for knitted fabric production based on AI vision as described in claim 4, characterized in that, The specific steps for identifying the range of structural anomalies in real-time knitted fabric images are as follows: According to the tissue phase correspondence record, extract the reference position of the standard knitting loop and the position of the registration mesh with the same tissue phase from the standard tissue mesh and the registration tissue mesh, compare the continuity of the knitting loop connection, the adjacent spacing and the opening shape of the corresponding positions, and locate the structural difference position in the registration tissue mesh. The structural difference locations are mapped to real-time knitted fabric images, adjacent structural difference locations are merged along the horizontal and vertical directions, and repeated structural difference locations are merged according to the weave cycle to determine the range of structural anomalies.

6. The color difference detection method for knitted fabric production based on AI vision as described in claim 1 or 5, characterized in that, The specific steps for forming the structural color offset correlation map are as follows: According to the corresponding records of the tissue phase, the lightness and chromaticity values ​​of the same tissue phase positions in the real-time knitted fabric image and the qualified standard sample image are compared after color unification. The lightness deviation, chromaticity deviation and comprehensive color difference of the same tissue phase positions are determined to form the original color deviation. The original color deviation is superimposed on the corresponding position in the real-time knitted fabric image. The overlap, boundary correspondence and synchronous change of the structural anomaly range and the original color deviation are analyzed to establish spatial correspondence and change correlation, forming a structural color deviation correlation map.

7. The color difference detection method for knitted fabric production based on AI vision as described in claim 6, characterized in that, The specific steps for reconstructing the counterfactual corrected image are as follows: The structural anomaly range is extracted from the structural color deviation correlation map. According to the corresponding record of the tissue phase, the standard knitting coil morphology with the same tissue phase as the structural anomaly range is extracted from the qualified standard sample image. The connection status of the knitting coil around the structural anomaly range is extracted from the real-time knitted fabric image to form coil structure reference information. From real-time knitted fabric images and adjacent real-time knitted fabric images, extract the brightness values, chromaticity values ​​and color change directions around the structural anomaly range and the corresponding tissue phase position, and connect the color changes according to the fabric position correspondence in the reference color calibration image group to form local color continuity information. The connection status and opening shape of the knitted coils within the structural anomaly range are reconstructed based on the coil structure reference information, and the color change of the reconstructed area is continued according to the local color continuity information to form a counterfactual correction image when the structural anomaly has not occurred.

8. The color difference detection method for knitted fabric production based on AI vision as described in claim 7, characterized in that, The specific steps for forming a true color difference distribution map are as follows: By comparing the brightness and chromaticity values ​​of the corresponding positions of structural anomalies in the real-time knitted fabric image and the counterfactual correction image, the color difference between the real-time knitted fabric image and the counterfactual correction image is identified as structure-induced color deviation. According to the tissue phase correspondence record, compare the lightness and chromaticity values ​​of the same tissue phase position in the counterfactual corrected image and the qualified standard sample image, and determine the color difference that still exists after counterfactual correction as the actual production color deviation; The structure-induced color deviation and the actual production color deviation are mapped to the position of the real-time knitted fabric image. For positions where both structure-induced color deviation and actual production color deviation exist, the structure-induced color deviation and the actual production color deviation are retained respectively. A true color difference distribution map is formed according to the color deviation range, color deviation direction and comprehensive color difference of the actual production color deviation.

9. The color difference detection method for knitted fabric production based on AI vision as described in claim 8, characterized in that, The specific steps for forming the color difference bearing trajectory are as follows: According to the correspondence of fabric positions in the reference color calibration image group, the image positions of each color difference region in the real color difference distribution map are converted into the fabric position range on the continuous knitted fabric, and the start and end positions and color deviation direction of the fabric position range are recorded. According to the fabric running direction, compare the fabric position range of the color difference area in adjacent real-time knitted fabric images, filter the color difference areas whose fabric position ranges can be continuously connected, and establish candidate continuity relationships. By comparing the color deviation direction, overall color difference, and boundary changes of the color difference areas in the candidate inheritance relationship, color difference areas with continuous connection of fabric location range and continuous changes in color deviation direction and overall color difference are sequentially associated to form a color difference inheritance trajectory.

10. The color difference detection method for knitted fabric production based on AI vision as described in claim 9, characterized in that, The specific steps for generating the production color difference detection record are as follows: The color difference region is checked along the color difference continuation trajectory to examine the fabric position continuation status and color deviation direction stability status of the color difference region in consecutive adjacent real-time knitted fabric images. Color difference regions with continuous fabric position continuation and stable color deviation direction are identified as continuous production color differences, and color difference regions with interrupted fabric position continuation and abrupt color deviation direction are excluded. Analyze the extension range of continuous production color difference along the horizontal and vertical directions, the repetition state of the weave cycle, and the comprehensive color difference change along the fabric running direction to determine the distribution type of continuous production color difference. Record the fabric start and end positions, influence range, color deviation direction, comprehensive color difference, duration, and distribution type to generate a production color difference detection record.