Textile color difference detection method and system based on image data

Through the textile chromatic aberration detection method based on image data, the spatial area projection segmentation algorithm and texture feature point analysis are used to solve the problems of inefficient and insufficient accuracy of traditional detection methods, and efficient and accurate chromatic aberration detection is achieved, which is suitable for large-scale production environments.

CN120031847AInactive Publication Date: 2025-05-23GUANNAN COUNTY DONGHONG CLOTHING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510156938.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-05-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The color difference detection of traditional textiles relies on manual intuitive comparison, which has subjective judgment errors and is inefficient, making it difficult to meet the needs of modern production for rapid detection and high precision.

Method used

The textile color difference detection method based on image data is used to segment the textile images by a spatial area projection segmentation algorithm, texture feature points are extracted, local color difference and overall color difference are calculated, and the color difference degree of textiles is evaluated based on these data.

Benefits of technology

It significantly improves the efficiency and accuracy of textile color difference detection, reduces manual intervention, and realizes an efficient and continuous color difference detection process. It is suitable for large-scale production environments, reduces defective rates, and improves production efficiency and customer satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031847A_ABST
    Figure CN120031847A_ABST
Patent Text Reader

Abstract

The invention discloses a textile color difference detection method and system based on image data, and relates to the technical field of image processing, and the method comprises the steps: obtaining a to-be-detected textile image, and carrying out the region segmentation of the textile image based on a spatial region projection segmentation algorithm, and obtaining a plurality of textile regions; extracting and analyzing texture feature points of each textile area, and calculating to obtain a local chromatic aberration degree and an overall chromatic aberration degree; and evaluating the chromatic aberration degree of the textile by combining the local chromatic aberration degree and the overall chromatic aberration degree, and marking a textile grayscale image with chromatic aberration based on a chromatic aberration degree evaluation result. According to the invention, through automatic image processing and region segmentation technologies, the efficiency and precision of textile color difference detection are significantly improved; meanwhile, each textile area can be independently and meticulously analyzed through accurate area segmentation, so that local and overall chromatic aberration changes can be more accurately captured, and a solid foundation is provided for quality control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and more specifically, to a method and system for detecting color difference of textiles based on image data. Background Art

[0002] Textiles refer to products processed through textile processing, and can also be called sheet materials formed by interweaving raw materials such as threads, yarns, and silk through a loom. According to their uses, textiles are mainly divided into three categories: clothing, decoration, and industrial use. The birth of textiles has gone through a series of complex and delicate technological processes such as spinning, weaving, finishing, and dyeing. These links are interconnected and jointly endow textiles with specific physical and chemical properties, such as excellent strength, comfortable softness, long-lasting color fastness, and special functions such as waterproof, fireproof, and antibacterial, meeting the diverse performance requirements of textiles in different fields.

[0003] In this crucial link of textile dyeing, due to the influence of various factors during the dyeing process, such as dye concentration, temperature control, and time control, it may lead to the phenomenon of uneven surface color and color difference of textiles. This color difference problem not only affects the aesthetics of the product, but also may affect the user experience and satisfaction of customers. Therefore, textile color difference detection has become a crucial part of quality control in the textile industry. Through scientific and rigorous color difference detection, the high consistency of textile colors can be ensured, thus meeting the strict requirements of the market and customers.

[0004] In traditional textile color difference detection, it mainly relies on manual visual comparison of the color differences between the textiles to be detected and the standard samples. However, this method depends on human subjective judgment and is inevitably affected by various complex factors such as the eyesight of the color discrimination personnel, accumulated experience, and even the physical and mental state on the day, which may lead to significant errors in the detection results. Especially when facing minute color differences or fine discrimination of samples with similar colors, the accuracy of manual discrimination is particularly insufficient. In addition, the process of manual discrimination has a large labor intensity and low efficiency, and it is difficult to meet the requirements of rapid detection and high precision in modern production.

[0005] Regarding the problems in the related art, no effective solutions have been proposed yet. Summary of the Invention

[0006] Regarding the problems in the related art, the present invention proposes a method and system for detecting color difference of textiles based on image data to overcome the above-mentioned technical problems existing in the existing related technologies.

[0007] To this end, the specific technical solutions adopted by the present invention are as follows: According to one aspect of the present invention, there is provided a method for detecting color difference of textiles based on image data, the method comprising the following steps: S1. Acquire a textile image to be detected, and perform region segmentation on the textile image based on a spatial region projection segmentation algorithm to obtain a number of textile regions; specifically, the method includes: determining an optimal projection direction and setting a corresponding projection axis according to the detection result; Based on the set projection axis, the preprocessed textile image is projected, and the cumulative value of pixel intensity in each projection direction is calculated to obtain a projection array; threshold processing is performed on the projection array to identify grayscale change points; The peak detection algorithm is used to identify the peak points in the projection array; based on the grayscale change points and the peak points, segmentation lines are drawn in the preprocessed textile image to obtain several textile regions; S2, extracting and analyzing the texture feature points of each textile area, and calculating the local color difference and the overall color difference; S3. Evaluate the color difference degree of the textile by combining the local color difference degree and the overall color difference degree, and mark the textile grayscale image with color difference based on the color difference degree evaluation result.

[0008] Furthermore, obtaining a textile image to be detected and performing region segmentation on the textile image based on a spatial region projection segmentation algorithm to obtain a number of textile regions includes the following steps: S11, obtaining a textile image to be detected, and preprocessing the obtained textile image; S12, extracting a region contour from the preprocessed textile image using an edge detection algorithm; S13, based on the extracted region contour, using Hough transform algorithm to detect the preprocessed textile image; S14. According to the detection result, the preprocessed textile image is segmented in combination with a spatial region projection segmentation algorithm to obtain a number of textile regions.

[0009] Further, extracting the region contour from the preprocessed textile image using an edge detection algorithm comprises the following steps: S121, calculating the preprocessed textile image using a gradient formula to obtain gradient information of each pixel; S122, using the Sobel operator formula to calculate the preprocessed textile image to obtain a gradient vector of each pixel; S123, performing non-maximum suppression processing on the gradient information and the gradient vector, and performing threshold processing on the gradient information and the gradient amplitude of the gradient vector after the non-maximum suppression processing in combination with the Otsu method, to screen out edge points; S124 . Based on the screened edge points, the gradient information is used as a benchmark and the gradient vector is used as a reference to repair the edge in the gradient information to obtain a region contour.

[0010] Further, based on the grayscale change points and the peak points, drawing segmentation lines in the preprocessed textile image to obtain a number of textile regions includes the following steps: Based on the grayscale change point and the peak point, determine and analyze the positions of the grayscale change point and the peak point in the projection array to obtain the segmentation point; Reversely map the segmentation points from the projection array coordinates to the textile image coordinates to obtain the segmentation point positions corresponding to the segmentation points in the preprocessed textile image; According to the obtained segmentation point positions, the segmentation points are connected using the shortest path algorithm to construct a preliminary segmentation line; The preliminary segmentation line is refined, and the refined preliminary segmentation line is optimized by combining image processing technology to obtain the segmentation line; The obtained segmentation lines are applied to the preprocessed textile image to divide the textile area and obtain the textile area segmentation result.

[0011] Furthermore, extracting and analyzing the texture feature points of each textile region and calculating the local color difference and the overall color difference include the following steps: S21, extracting texture feature points of each textile region using a gray level co-occurrence matrix algorithm, where the texture feature points include main texture feature points and fine texture feature points; S22, selecting a texture feature point in each textile region as a reference point, calculating the grayscale difference between the reference point and an adjacent texture feature point, and obtaining a local color difference; S23, calculating the average gray value of the texture feature points of each textile region, and obtaining the overall color difference of the textile image based on the ratio between the average gray values.

[0012] Further, selecting the texture feature points in each textile area as reference points, calculating the grayscale difference between the reference points and the adjacent texture feature points, and obtaining the local color difference comprises the following steps: S221, according to the direction of the main texture feature point, select the main texture feature point in each textile area as a reference point, calculate the grayscale difference between the reference point and the adjacent feature point, and obtain a horizontal local color difference sequence; S222, selecting fine texture feature points in each textile region as reference points according to the directions of the fine texture feature points, calculating the grayscale difference between the reference points and adjacent feature points, and obtaining a vertical local color difference sequence; S223, statistically analyzing the horizontal local color difference degree sequence and the vertical local color difference degree sequence to calculate the local color difference degree.

[0013] Further, calculating the average grayscale value of the texture feature points of each textile region, and obtaining the overall color difference of the textile image based on the ratio between the average grayscale values ​​includes the following steps: S231, calculating the average grayscale value of the main texture feature points and the average grayscale value of the fine texture feature points based on each textile region; S232, traversing each textile region, sampling the grayscale values ​​of the main texture feature points and the fine texture feature points in each textile region, and calculating the average value of the main texture feature points and the average value of the fine texture feature points; S233, calculating the average grayscale difference of the main texture feature points between adjacent textile regions according to the arrangement order of the textile regions in the textile image, to obtain a horizontal overall color difference sequence; S234, calculating the average grayscale difference of fine texture feature points between adjacent textile regions to obtain a vertical overall color difference sequence; S235 , obtaining the overall color difference degree according to the ratio of the corresponding grayscale values ​​in the horizontal local color difference degree sequence and the vertical local color difference degree sequence.

[0014] Furthermore, the overall color difference calculation formula is: ; In the formula, M Indicates the overall color difference; tanh represents the hyperbolic tangent function; d The length representing the gray value ratio; i Indicates the number of gray values; f m Indicates the gray value ratio m Gray value; f n Indicates the gray value ratio n Gray value; f m-1 Indicates the gray value ratio m -1 grayscale value.

[0015] Furthermore, combining the local color difference with the overall color difference to evaluate the color difference of the textile, and marking the textile grayscale image with color difference based on the color difference evaluation result includes the following steps: S31, combining the local color difference degree and the overall color difference degree by using a weighted algorithm to calculate the overall color difference degree; S32, comparing the overall color difference degree with a preset threshold value to evaluate the color difference degree of the textile; S33. Based on the evaluation result of the color difference degree of the textile, mark the area where the color difference exists in the textile image.

[0016] According to another aspect of the present invention, there is also provided a textile color difference detection system based on image data, the system comprising an image acquisition and segmentation module, a texture extraction and color difference calculation module and a color difference evaluation and marking module; An image acquisition and segmentation module is used to acquire a textile image to be detected, and perform region segmentation on the textile image based on a spatial region projection segmentation algorithm to obtain a number of textile regions; Texture extraction and color difference calculation module, used to extract and analyze the texture feature points of each textile area, and calculate the local color difference and the overall color difference; The color difference evaluation and marking module is used to evaluate the color difference degree of textiles by combining local color difference and overall color difference, and mark the textile grayscale images with color difference based on the color difference evaluation results.

[0017] The beneficial effects of the present invention are: 1. The present invention significantly improves the efficiency and accuracy of textile color difference detection through automated image processing and region segmentation technology, reduces manual intervention, and realizes an efficient and continuous color difference detection process, which is suitable for large-scale production environments; at the same time, precise region segmentation ensures that each textile region can be analyzed independently and carefully, thereby more accurately capturing local and overall color difference changes, providing a solid foundation for quality control.

[0018] 2. The present invention realizes the objective quantification of color difference evaluation by introducing the calculation of local color difference and overall color difference, which not only reduces the error of subjective judgment, but also makes the detection result more intuitive and accurate, providing a scientific basis for the continuous improvement of product quality; in addition, the rapid feedback mechanism based on the evaluation results can quickly identify textiles with color difference and immediately trigger the corresponding processing flow, effectively reducing the defective rate and improving production efficiency and customer satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 is a flow chart of a method for detecting color difference of textiles based on image data according to an embodiment of the present invention; Figure 2 The diagram is a principle block diagram of a textile color difference detection system based on image data according to an embodiment of the present invention.

[0021] In the figure: 1. Image acquisition and segmentation module; 2. Texture extraction and color difference calculation module; 3. Color difference evaluation and marking module. DETAILED DESCRIPTION

[0022] To further illustrate each embodiment, the present invention provides drawings, which are part of the disclosure of the present invention and are mainly used to illustrate the embodiments. They can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, ordinary technicians in this field should be able to understand other possible implementation methods and advantages of the present invention.

[0023] According to an embodiment of the present invention, a method and system for detecting color difference of textiles based on image data are provided.

[0024] The present invention is further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to the textile color difference detection method based on image data according to an embodiment of the present invention, the method comprises the following steps: S1. Acquire a textile image to be detected, and perform region segmentation on the textile image based on a spatial region projection segmentation algorithm to obtain a number of textile regions; specifically, the method includes: determining an optimal projection direction and setting a corresponding projection axis according to the detection result; Based on the set projection axis, the preprocessed textile image is projected, and the cumulative value of pixel intensity in each projection direction is calculated to obtain a projection array; threshold processing is performed on the projection array to identify grayscale change points; The peak detection algorithm is used to identify the peak points in the projection array; based on the grayscale change points and the peak points, segmentation lines are drawn in the preprocessed textile image to obtain several textile areas.

[0025] Specifically, obtaining a textile image to be detected, and performing region segmentation on the textile image based on a spatial region projection segmentation algorithm to obtain a number of textile regions includes the following steps: S11, obtaining a textile image to be detected, and preprocessing the obtained textile image.

[0026] S12. Extracting region contours from the preprocessed textile image using an edge detection algorithm.

[0027] Specifically, extracting the region contour from the preprocessed textile image using an edge detection algorithm includes the following steps: S121, using a gradient formula to calculate the preprocessed textile image to obtain gradient information of each pixel.

[0028] It should be noted that the gradient formula is: ; In the formula,P ( x , y ) represents the gradient strength; ( x , y ) represents the coordinates of any point in the textile image; S 1 Represents the horizontal gradient Sobel operator; S 2 Represents the vertical gradient Sobel operator.

[0029] S122. Calculate the preprocessed textile image using the Sobel operator formula to obtain a gradient vector for each pixel.

[0030] It should be noted that the Sobel operator formula is: ; ; In the formula, K x Indicates the gradient bias x Direction vector; K y Indicates the gradient bias y Direction vector; f ( x , y ) means in ( x , y ) at the point where x Represents the horizontal coordinate of any point in the textile image; y Represents the ordinate of any point in the textile image.

[0031] In addition, the formula for the gradient direction is: ; In the formula, θ ( x , y ) represents the gradient direction; ( x , y ) represents the coordinates of any point in the textile image; K x Indicates the gradient bias x Direction vector; K y Indicates the gradient bias yDirection vector.

[0032] The amplitude formula is: ; In the formula, P ( x , y,θ ) represents the gradient intensity after adding the new gradient direction; x represents the abscissa of any point in the textile image; y represents the ordinate of any point in the textile image; θ represents the direction angle; K x represents the gradient partial x direction vector; K y represents the gradient partial y direction vector.

[0033] S123. Perform non-maximum suppression on the gradient information and gradient vectors, and combine the Otsu method to perform thresholding on the gradient amplitudes of the gradient information and gradient vectors after non-maximum suppression to screen out edge points.

[0034] S124. Based on the screened edge points, use the gradient information as a reference and the gradient vectors as a reference to repair the edges in the gradient information to obtain the region contour.

[0035] S13. Based on the extracted region contour, use the Hough transform algorithm to detect the preprocessed textile image.

[0036] S14. According to the detection results, combine the spatial region projection segmentation algorithm to segment the preprocessed textile image to obtain several textile regions.

[0037] Specifically, based on the gray change points and peak points, drawing segmentation lines in the preprocessed textile image to obtain several textile regions includes the following steps: Based on the gray change points and peak points, determine and analyze the positions of the gray change points and peak points in the projection array to obtain segmentation points; Inverse map the segmentation points from the projection array coordinates to the textile image coordinates to obtain the corresponding segmentation point positions of the segmentation points in the preprocessed textile image; According to the obtained segmentation point positions, use the shortest path algorithm to connect the segmentation points to construct a preliminary segmentation line; Refine the preliminary segmentation line, and combine image processing techniques to optimize the refined preliminary segmentation line to obtain the segmentation line; The obtained segmentation lines are applied to the preprocessed textile image to divide the textile area and obtain the textile area segmentation result.

[0038] S2. Extract and analyze the texture feature points of each textile area, and calculate the local color difference and the overall color difference.

[0039] Specifically, extracting and analyzing the texture feature points of each textile area and calculating the local color difference and the overall color difference include the following steps: S21. Using a gray level co-occurrence matrix algorithm to extract texture feature points of each textile region, the texture feature points include main texture feature points and fine texture feature points.

[0040] S22, selecting a texture feature point in each textile region as a reference point, calculating a grayscale difference between the reference point and an adjacent texture feature point, and obtaining a local color difference.

[0041] Specifically, selecting a texture feature point in each textile region as a reference point, calculating the grayscale difference between the reference point and an adjacent texture feature point, and obtaining the local color difference comprises the following steps: S221, according to the direction of the main texture feature point, select the main texture feature point in each textile area as a reference point, calculate the grayscale difference between the reference point and the adjacent feature point, and obtain a horizontal local color difference sequence; S222, selecting fine texture feature points in each textile region as reference points according to the directions of the fine texture feature points, calculating the grayscale difference between the reference points and adjacent feature points, and obtaining a vertical local color difference sequence; S223, statistically analyzing the horizontal local color difference degree sequence and the vertical local color difference degree sequence to calculate the local color difference degree.

[0042] S23, calculating the average gray value of the texture feature points of each textile region, and obtaining the overall color difference of the textile image based on the ratio between the average gray values.

[0043] Specifically, calculating the average grayscale value of the texture feature points of each textile region and obtaining the overall color difference of the textile image based on the ratio between the average grayscale values ​​includes the following steps: S231, calculating the average grayscale value of the main texture feature points and the average grayscale value of the fine texture feature points based on each textile region; S232, traversing each textile region, sampling the grayscale values ​​of the main texture feature points and the fine texture feature points in each textile region, and calculating the average value of the main texture feature points and the average value of the fine texture feature points; S233. Calculate the average gray - level difference of the main texture feature points between adjacent textile regions according to the arrangement order of the textile regions in the textile image, and obtain the horizontal overall color - difference sequence; S234. Calculate the average gray - level difference of the fine texture feature points between adjacent textile regions, and obtain the vertical overall color - difference sequence; S235. Obtain the overall color - difference degree according to the ratio of the corresponding gray - level values in the horizontal local color - difference degree sequence and the vertical local color - difference degree sequence.

[0044] Specifically, the formula for calculating the overall color - difference degree is: ; In the formula, M represents the overall color - difference degree; tanh represents the hyperbolic tangent function; d represents the length of the gray - level value ratio; i represents the number of gray - level values; f m represents the m th gray - level value in the gray - level value ratio; f n represents the n th gray - level value in the gray - level value ratio; f m-1 represents the m th gray - level value in the gray - level value ratio;

[0045] S3. Combine the local color - difference degree and the overall color - difference degree to evaluate the color - difference degree of the textile, and mark the textile gray - level image with color - difference based on the evaluation result of the color - difference degree.

[0046] Specifically, combining the local color - difference degree and the overall color - difference degree to evaluate the color - difference degree of the textile, and marking the textile gray - level image with color - difference based on the evaluation result of the color - difference degree includes the following steps: S31. Use the weighted algorithm to combine the local color - difference degree and the overall color - difference degree, and calculate the overall color - difference degree.

[0047] It should be added that the formula for calculating the overall color - difference degree by using the weighted algorithm to combine the local color - difference degree and the overall color - difference degree is: ; In the formula, C represents the overall color - difference degree; ω 1 represents the weight coefficient of the local color - difference degree; c1 Indicates the local chromatic aberration; ω 2 Represents the weight coefficient of the overall color difference; c 2 Indicates the overall color difference.

[0048] S32, comparing the overall color difference degree with a preset threshold value to evaluate the color difference degree of the textile.

[0049] It should be noted that if the overall color difference exceeds the preset threshold, it is considered that the textile has a color difference problem.

[0050] S33. Based on the evaluation result of the color difference degree of the textile, mark the area where the color difference exists in the textile image.

[0051] It should be noted that for textile areas that exceed the preset threshold, they are marked on the grayscale image. The marking method may include but is not limited to highlighting, drawing bounding boxes, annotating text descriptions, etc.; while marking, relevant color difference information is recorded, such as the color difference value, the location and size of the exceeding area, etc., for subsequent analysis and processing.

[0052] like Figure 2 As shown, according to another embodiment of the present invention, a textile color difference detection system based on image data is also provided, the system comprising an image acquisition and segmentation module 1, a texture extraction and color difference calculation module 2 and a color difference evaluation and marking module 3; The image acquisition and segmentation module 1 is used to acquire the textile image to be detected, and perform region segmentation on the textile image based on the spatial region projection segmentation algorithm to obtain a plurality of textile regions; Texture extraction and color difference calculation module 2, used to extract and analyze the texture feature points of each textile area, and calculate the local color difference and the overall color difference; The color difference evaluation and marking module 3 is used to evaluate the color difference degree of the textile by combining the local color difference degree and the overall color difference degree, and mark the textile grayscale image with color difference based on the color difference degree evaluation result.

[0053] In summary, with the help of the above technical solution of the present invention, through automated image processing and region segmentation technology, the efficiency and accuracy of textile color difference detection are significantly improved, manual intervention is reduced, and an efficient and continuous color difference detection process is realized, which is suitable for large-scale production environments; at the same time, accurate region segmentation ensures that each textile region can be analyzed independently and carefully, so as to more accurately capture the local and overall color difference changes, providing a solid foundation for quality control. By introducing the calculation of local color difference and overall color difference, the objective quantification of color difference evaluation is realized, which not only reduces the error of subjective judgment, but also makes the detection results more intuitive and accurate, providing a scientific basis for the continuous improvement of product quality; in addition, based on the rapid feedback mechanism of the evaluation results, textiles with color difference can be quickly identified and the corresponding processing flow can be immediately triggered, effectively reducing the defective rate and improving production efficiency and customer satisfaction.

[0054] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A textile color difference detection method based on image data, characterized in that: include: S1. Acquire a textile image to be detected, and perform region segmentation on the textile image based on a spatial region projection segmentation algorithm to obtain a number of textile regions; Specifically including: determining the optimal projection direction and setting the corresponding projection axis according to the detection results; Based on the set projection axis, the preprocessed textile image is projected, and the cumulative value of pixel intensity in each projection direction is calculated to obtain a projection array; threshold processing is performed on the projection array to identify grayscale change points; The peak detection algorithm is used to identify the peak points in the projection array; based on the grayscale change points and the peak points, segmentation lines are drawn in the preprocessed textile image to obtain several textile regions; S2, extracting and analyzing the texture feature points of each textile area, and calculating the local color difference and the overall color difference; S3. Evaluate the color difference degree of the textile by combining the local color difference degree and the overall color difference degree, and mark the textile grayscale image with color difference based on the color difference degree evaluation result.

2. A textile color difference detection method based on image data according to claim 1, characterized in that: The step of acquiring a textile image to be detected and performing region segmentation on the textile image based on a spatial region projection segmentation algorithm to obtain a plurality of textile regions comprises the following steps: S11, obtaining a textile image to be detected, and preprocessing the obtained textile image; S12, extracting a region contour from the preprocessed textile image using an edge detection algorithm; S13, based on the extracted region contour, using Hough transform algorithm to detect the preprocessed textile image; S14. According to the detection result, the preprocessed textile image is segmented in combination with a spatial region projection segmentation algorithm to obtain a number of textile regions.

3. The method for detecting color difference of textiles based on image data according to claim 2, characterized in that: The method of extracting the region contour from the preprocessed textile image using an edge detection algorithm comprises the following steps: S121, calculating the preprocessed textile image using a gradient formula to obtain gradient information of each pixel; S122, using the Sobel operator formula to calculate the preprocessed textile image to obtain a gradient vector of each pixel; S123, performing non-maximum suppression processing on the gradient information and the gradient vector, and performing threshold processing on the gradient information and the gradient amplitude of the gradient vector after the non-maximum suppression processing in combination with the Otsu method, to screen out edge points; S124 . Based on the screened edge points, the gradient information is used as a benchmark and the gradient vector is used as a reference to repair the edge in the gradient information to obtain a region contour.

4. The method for detecting color difference of textiles based on image data according to claim 2, characterized in that: The method of drawing segmentation lines in the preprocessed textile image based on the grayscale change points and the peak points to obtain a plurality of textile regions comprises the following steps: Based on the grayscale change point and the peak point, determine and analyze the positions of the grayscale change point and the peak point in the projection array to obtain the segmentation point; Reversely map the segmentation points from the projection array coordinates to the textile image coordinates to obtain the segmentation point positions corresponding to the segmentation points in the preprocessed textile image; According to the obtained segmentation point positions, the segmentation points are connected using the shortest path algorithm to construct a preliminary segmentation line; The preliminary segmentation line is refined, and the refined preliminary segmentation line is optimized by combining image processing technology to obtain the segmentation line; The obtained segmentation lines are applied to the preprocessed textile image to divide the textile area and obtain the textile area segmentation result.

5. The method for detecting color difference of textiles based on image data according to claim 1, characterized in that: The extraction and analysis of the texture feature points of each textile region and the calculation of the local color difference and the overall color difference comprise the following steps: S21, extracting texture feature points of each textile region using a gray level co-occurrence matrix algorithm, wherein the texture feature points include main texture feature points and fine texture feature points; S22, selecting a texture feature point in each textile region as a reference point, calculating the grayscale difference between the reference point and an adjacent texture feature point, and obtaining a local color difference; S23, calculating the average gray value of the texture feature points of each textile region, and obtaining the overall color difference of the textile image based on the ratio between the average gray values.

6. A textile color difference detection method based on image data according to claim 5, characterized in that: The method of selecting a texture feature point in each textile region as a reference point, calculating the grayscale difference between the reference point and an adjacent texture feature point, and obtaining the local color difference comprises the following steps: S221, according to the direction of the main texture feature point, select the main texture feature point in each textile area as a reference point, calculate the grayscale difference between the reference point and the adjacent feature point, and obtain a horizontal local color difference sequence; S222, selecting fine texture feature points in each textile region as reference points according to the directions of the fine texture feature points, calculating the grayscale difference between the reference points and adjacent feature points, and obtaining a vertical local color difference sequence; S223, statistically analyzing the horizontal local color difference degree sequence and the vertical local color difference degree sequence to calculate the local color difference degree.

7. The method for detecting color difference of textiles based on image data according to claim 5, characterized in that: The step of calculating the average grayscale value of the texture feature points of each textile region and obtaining the overall color difference of the textile image based on the ratio between the average grayscale values ​​comprises the following steps: S231, calculating the average grayscale value of the main texture feature points and the average grayscale value of the fine texture feature points based on each textile region; S232, traversing each textile region, sampling the grayscale values ​​of the main texture feature points and the fine texture feature points in each textile region, and calculating the average value of the main texture feature points and the average value of the fine texture feature points; S233, calculating the average grayscale difference of the main texture feature points between adjacent textile regions according to the arrangement order of the textile regions in the textile image, to obtain a horizontal overall color difference sequence; S234, calculating the average grayscale difference of fine texture feature points between adjacent textile regions to obtain a vertical overall color difference sequence; S235 , obtaining the overall color difference degree according to the ratio of the corresponding grayscale values ​​in the horizontal local color difference degree sequence and the vertical local color difference degree sequence.

8. The method for detecting color difference of textiles based on image data according to claim 7, characterized in that: The overall color difference calculation formula is: ; In the formula, M Indicates the overall color difference; tanh represents the hyperbolic tangent function; d The length representing the gray value ratio; i Indicates the number of gray values; f m Indicates the gray value ratio m Gray value; f n Indicates the gray value ratio n Gray value; f m-1 Indicates the gray value ratio m -1 grayscale value.

9. The method for detecting color difference of textiles based on image data according to claim 1, characterized in that: The method of evaluating the color difference degree of the textile by combining the local color difference degree with the overall color difference degree, and marking the textile grayscale image with color difference based on the color difference degree evaluation result comprises the following steps: S31, combining the local color difference degree and the overall color difference degree by using a weighted algorithm to calculate the overall color difference degree; S32, comparing the overall color difference degree with a preset threshold value to evaluate the color difference degree of the textile; S33. Based on the evaluation result of the color difference degree of the textile, mark the area where the color difference exists in the textile image.

10. A textile color difference detection system based on image data, used to implement the textile color difference detection method based on image data according to any one of claims 1 to 9, characterized in that: The system includes an image acquisition and segmentation module, a texture extraction and color difference calculation module, and a color difference evaluation and marking module; The image acquisition and segmentation module is used to acquire the textile image to be detected, and perform region segmentation on the textile image based on a spatial region projection segmentation algorithm to obtain a plurality of textile regions; The texture extraction and color difference calculation module is used to extract and analyze the texture feature points of each textile area, and calculate the local color difference and the overall color difference; The color difference evaluation and marking module is used to evaluate the color difference degree of the textile by combining the local color difference degree and the overall color difference degree, and mark the textile grayscale image with color difference based on the color difference degree evaluation result.