Printing and dyeing quality detection method based on artificial intelligence

Through the printing and dyeing quality detection method based on artificial intelligence, the problem of the existing technology being difficult to describe the printing and dyeing quality of complex patterns is solved, and high-precision detection and cost control are achieved.

CN120013892AInactive Publication Date: 2025-05-16QIQIHAR UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510085543.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-05-16
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is difficult to quantitatively describe the printing and dyeing quality of complex patterns, resulting in high production costs and ineffective control of ready-made garments.

Method used

Using artificial intelligence-based printing and dyeing quality detection method, we use the image of the printing and dyeing fabric to determine the relative position relationship of the printing and dyeing patterns, set up a mask for finite element division, obtain the defect position and area, and calculate the image quality parameters.

Benefits of technology

It realizes high-precision printing and dyeing quality inspection of complex patterns, can quantitatively describe printing and dyeing quality, reduce the production cost of garments, and meet cost control requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013892A_ABST
    Figure CN120013892A_ABST
Patent Text Reader

Abstract

The invention discloses a printing and dyeing quality detection method based on artificial intelligence, and the method comprises the steps: obtaining an image of printing and dyeing cloth, and carrying out the preprocessing of the image of the printing and dyeing cloth, so as to obtain an edge line of a printing and dyeing pattern in the image of the printing and dyeing cloth; based on the edge line of the printing and dyeing pattern, determining the relative position relation of the printing and dyeing pattern; on the basis of the relative position relation of the printing and dyeing patterns, the printing and dyeing patterns with the overlapping relation are obtained, and overlapping patterns are obtained; respectively setting masks for all the printing and dyeing patterns in the overlapped pattern, and carrying out finite element division on the masks to obtain finite element images; acquiring a defect position and a defect area in the finite element image to obtain printing and dyeing defect information; and obtaining image quality parameters of the printed and dyed cloth based on the printing and dyeing defect information. The problem that high-precision quantitative description of complex patterns in printed and dyed cloth is difficult is solved, so that high-precision quality analysis is realized during detection of printing and dyeing quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and specifically, relates to a printing and dyeing quality detection method based on artificial intelligence. Background Art

[0002] In the field of modern clothing production, consumers have put forward higher requirements for clothing patterns. Clothing patterns have begun to develop in the direction of higher artistry. In terms of clothing image expression, the complexity of lines, colors and overall pattern expression is gradually increasing. Traditional printing and dyeing patterns are highly singular. The method of scanning the printing and dyeing patterns as a whole and then finding printing and dyeing defects from the scanning results is no longer suitable for the current garment printing and dyeing quality inspection work. In addition, the traditional inspection method cannot quantitatively describe the printing and dyeing quality of garments. Once a printing and dyeing defect is found, it will be scrapped regardless of the size of the defect, resulting in high garment production costs, which no longer meets the cost control requirements put forward by current garment manufacturers.

[0003] Therefore, how to achieve quantitative determination of printing and dyeing quality based on artificial intelligence technology has become a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0004] In order to solve the problem in the prior art that it is difficult to quantitatively describe the printing and dyeing quality under the background of the increasing complexity of clothing patterns, this application discloses an artificial intelligence-based printing and dyeing quality detection method, which can adapt to the high-precision detection of the printing and dyeing quality of highly complex patterns through quantitative description of the printing and dyeing quality, and meet the cost control requirements put forward by current garment production enterprises. Specifically:

[0005] A printing and dyeing quality detection method based on artificial intelligence, the method comprising:

[0006] Acquire an image of a printed and dyed fabric, and pre-process the image of the printed and dyed fabric to obtain an edge line of a printed and dyed pattern in the image of the printed and dyed fabric;

[0007] Determining the relative position relationship of the printing and dyeing pattern based on the edge line of the printing and dyeing pattern;

[0008] Based on the relative positional relationship of the printing and dyeing patterns, the printing and dyeing patterns having an overlapping relationship are acquired to obtain an overlapping pattern;

[0009] Setting masks for all the printing and dyeing patterns in the overlapping pattern respectively, and performing finite element division on the masks to obtain finite element images;

[0010] Acquire the defect position and defect area in the finite element image to obtain printing and dyeing defect information;

[0011] Based on the printing and dyeing defect information, image quality parameters of the printed and dyed fabric are obtained.

[0012] Optionally, the acquiring an image of a printed and dyed fabric and preprocessing the image of the printed and dyed fabric to acquire an edge line of a printed and dyed pattern in the image of the printed and dyed fabric includes:

[0013] grayscale the image of the printed and dyed fabric to obtain a grayscale image;

[0014] Performing noise reduction processing on the grayscale image to obtain a noise-reduced image;

[0015] Performing contrast enhancement processing on the noise reduction image to obtain a high-contrast image;

[0016] Based on the high contrast image, obtaining pixel values ​​of all pixels in the high contrast image;

[0017] Obtaining the pixel value gradient of the pixel point and the n×n pixel points around it, the pixel point whose pixel value gradient is not less than the preset pixel value gradient is the edge line pixel point;

[0018] Obtaining pixel values ​​and coordinates of the edge line pixel points, determining the adjacent relationship of the edge line pixel points based on the coordinates of the edge line pixel points, and obtaining adjacent pixel points;

[0019] Obtaining the gradient of the adjacent pixel points, and connecting the adjacent pixel points when the gradient of the adjacent pixel points is not lower than the gradient of the preset adjacent pixel points;

[0020] All the adjacent pixel points are traversed to obtain the edge line of the printing and dyeing pattern.

[0021] Optionally, determining the relative position relationship of the printing and dyeing pattern based on the edge line of the printing and dyeing pattern includes:

[0022] Obtaining the geometric center of the printing and dyeing pattern formed by the edge line of the printing and dyeing pattern;

[0023] Establishing a plane coordinate system with the geometric center as the origin to obtain an image coordinate system;

[0024] Based on any point on the edge line of the printing and dyeing pattern, obtaining a line connecting the image coordinate system and any point on the edge line of the printing and dyeing pattern, and obtaining the number of intersections between the edge line of the printing and dyeing pattern and the line;

[0025] Based on the number of intersections, the positional relationship of the printing and dyeing pattern is determined.

[0026] Optionally, determining the positional relationship of the printing and dyeing pattern based on the number of intersections includes:

[0027] Obtaining the maximum and minimum values ​​of the horizontal coordinates of the edge line of the printing and dyeing pattern in the image coordinate system, connecting the origin of the image coordinate system and the coordinate points corresponding to the maximum and minimum values ​​of the horizontal coordinates to obtain two constrained rays;

[0028] Between the two constraint rays, m rays are evenly arranged to obtain determination rays, and the angle between adjacent determination rays is θ;

[0029] Acquire the number of intersections of the constraint ray, the determination ray and the constraint ray, and establish a corresponding relationship between the number of intersections of the constraint ray and the determination ray;

[0030] Obtaining and comparing the numbers of intersections of adjacent determination rays, and obtaining adjacent determination rays with different numbers of intersections;

[0031] Obtaining the determination ray having the number of adjacent intersections, and obtaining the intersections of the determination curve and the edge line of the printing and dyeing pattern to obtain range intersections;

[0032] Connecting adjacent intersection points of the ranges to obtain a closed figure, where the closed figure is the judgment area;

[0033] Obtaining the number of intersections on different determination rays in the determination area, if the number of intersections on the determination rays is different, the printing and dyeing patterns corresponding to the edge lines of the printing and dyeing patterns are not in a tangent or intersecting relationship;

[0034] The position of the printing and dyeing pattern is determined to obtain the relative position relationship of the printing and dyeing pattern.

[0035] Optionally, the acquiring the printing and dyeing patterns with overlapping relationships based on the relative positional relationship of the printing and dyeing patterns to obtain overlapping patterns includes:

[0036] The relative position relationship of the printing and dyeing patterns is obtained by including, tangent to or intersecting the printing and dyeing patterns, so as to obtain patterns with an interactive relationship;

[0037] Marking the edge lines of the printing and dyeing patterns in the patterns having an interactive relationship respectively to obtain the marked lines of the printing and dyeing patterns;

[0038] Based on the marking lines of the printing and dyeing patterns, the patterns with interactive relationships are marked respectively to obtain overlapping patterns.

[0039] Optionally, the step of respectively setting masks for all the printing and dyeing patterns in the overlapping pattern and performing finite element division on the masks to obtain a finite element image includes:

[0040] Acquire all the printing and dyeing patterns in the overlapping pattern, set masks for all the printing and dyeing patterns respectively, and obtain an image mask; acquire the length and width of the image mask;

[0041] Based on the length and width of the image mask, the side length of the square grid during the finite element division is obtained. The equation for the side length of the square grid is:

[0042]

[0043] Wherein, l represents the side length of the square grid, a represents the length of the image mask, b represents the width of the image mask, and m represents the number of portions into which the width of the image mask is divided. represents the floor function, represents the ceiling function;

[0044] Based on the side length of the square grid, the mask is divided into finite elements to obtain a finite element image.

[0045] Optionally, acquiring the defect position and defect area in the finite element image to obtain printing and dyeing defect information includes:

[0046] Based on the printing and dyeing pattern, obtaining a defect type of the finite element image;

[0047] Based on the printing and dyeing pattern, obtaining the defect position corresponding to the defect type;

[0048] Based on the defect position, obtaining the position of the defect position in the finite element image;

[0049] The area of ​​the defect position and the defect type are acquired to obtain the printing and dyeing defect information.

[0050] Optionally, the acquiring the area of ​​the defect position and the defect type to obtain the defect information includes:

[0051] Acquire edge lines of all the printing and dyeing patterns of the printing and dyeing pattern;

[0052] Obtaining edge lines of all the printing and dyeing patterns and comparing them with edge lines of standard printing and dyeing patterns to obtain additional edge lines;

[0053] The enclosed area of ​​the multiple edge lines is obtained, and the enclosed area is calculated based on the finite element image, and the equation of the enclosed area is:

[0054]

[0055] Among them, S rrepresents the enclosed area, p represents the number of complete square grids of the finite element image in the enclosed area, l represents the side length of the square grid, S ai represents the incomplete square grid area of ​​the finite element image in the enclosed area, i represents the index of the incomplete square grid, and j represents the total number of incomplete square grid indexes;

[0056] Based on the enclosed area of ​​the multi-increase edge line and the defect type, the defect information is obtained, and the determination equation of the defect information is:

[0057]

[0058] Where T represents the type of defect, e is the horizontal / vertical index of all coordinates on the defect edge, f is the total horizontal / vertical index of all coordinates on the defect edge, g is the horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, h is the total horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, x is the total horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, te is the horizontal coordinate on the defect edge, x Te is the horizontal coordinate of the printing and dyeing pattern, y te is the ordinate on the defect edge, y Te is the ordinate of the printing and dyeing pattern, D T Indicates defect information.

[0059] Optionally, obtaining the image quality grade of the printed and dyed fabric based on the printing and dyeing defect information includes:

[0060] Based on the defect information, obtaining a defect impact weight corresponding to the defect information;

[0061] Determining an image quality value of the printed and dyed fabric based on the defect impact weight;

[0062] The image quality grade of the printed and dyed fabric is obtained based on the image quality value of the printed and dyed fabric and a preset image quality value interval of the printed and dyed fabric.

[0063] Optionally, determining the image quality value of the printed and dyed fabric based on the defect impact weight includes:

[0064] Based on the defect impact weight and the defect information, an image quality value of the overlapping pattern is obtained, and the image quality value equation of the overlapping pattern is:

[0065]

[0066] Among them, D Tc represents the defect information of the cth defect, Q s Indicates the image quality value of the mask where the defect is located, f crepresents the impact weight of the cth defect, S rc represents the enclosed area corresponding to the cth defect, S represents the corresponding mask area, c represents the index of the printing and dyeing fabric defect, and d represents the total index of the printing and dyeing fabric defect;

[0067] Based on the importance weights of all the overlapping patterns in the image of the printed fabric, the image quality value of the printed fabric is obtained. The image quality value equation of the printed fabric is:

[0068]

[0069] Among them, Q represents the image quality value of printed and dyed fabrics, Q su represents the image quality value of the mask where the u-th defect is located, u represents the index of the mask in the image of the printed and dyed fabric, v represents the total index of the mask in the image of the printed and dyed fabric, and Z u Represents the importance weight of overlapping patterns in the image of printed fabric.

[0070] The beneficial effects of this application include:

[0071] 1. Achieve proper processing of complex patterns. In this application, all edge lines in the image of the printed and dyed fabric are obtained, and then the positional relationship between the edge lines is determined, thereby determining the relative positions of all patterns in the printed and dyed pattern, thereby determining the possible intersection, tangency and inclusion relationship between the patterns, and then setting masks for the patterns that may overlap, respectively, to achieve mask coverage of different sub-region patterns in the entire printed and dyed pattern, and to achieve decomposition analysis of the entire printed and dyed pattern.

[0072] 2. Improved accuracy of assignment of printing and dyeing patterns. In printing and dyeing patterns, different sub-regions in the pattern have different effects on the integrity, data performance, etc. of the printing and dyeing pattern. In the technical solution of this application, the printing and dyeing pattern is decomposed based on mask processing, and then the area of ​​the defective area in each mask, the importance weight of the mask where the defective area is located in the printing and dyeing pattern and other parameters are obtained respectively, and all sub-region patterns in the printing and dyeing pattern are assigned, which improves the scientificity of the assignment of printing and dyeing patterns, thereby improving the accuracy of the assignment of printing and dyeing patterns.

[0073] 3. A quantitative description of printing and dyeing quality is achieved. Based on the acquisition and calculation of parameters such as defect location, defect importance weight, defect proportion, etc., and based on the corresponding artificial intelligence algorithm, a quantitative description of printing and dyeing quality is achieved, and based on the quantitative description results, the quality of the printing and dyeing pattern is determined more accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments of the present application or the prior art. Obviously, the following description is only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific implementation methods, they are used to explain the present disclosure, but do not constitute a limitation to the present disclosure. In the drawings:

[0075] Figure 1 A flow chart of a printing and dyeing quality detection method based on artificial intelligence provided in an embodiment of the present application;

[0076] Figure 2 A schematic diagram of a coordinate pattern for an edge line of a printing and dyeing pattern provided in an embodiment of the present application;

[0077] Figure 3 A schematic diagram of the intersection of a printing and dyeing pattern provided in an embodiment of the present application. DETAILED DESCRIPTION

[0078] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0079] At present, consumers have put forward higher requirements for the artistry of printing and dyeing patterns on clothes produced by garment enterprises. This artistry is reflected in two aspects. The first is for abstract patterns. Such consumers have a higher demand and preference for patterns with lines and ribbon textures. For garment enterprises, considering the wearing effect of clothes, they more widely set patterns with ribbon textures rather than simply setting narrow lines. Among them, there may be different relative position relationships in the patterns, such as intersection, tangency, continuous color gradient or discontinuity in the patterns; the second is partial to realistic or completely realistic patterns. Such patterns include portraits of people and animals, or portraits of people and animals after slightly abstract processing. There are often more image encirclement relationships in such patterns. Of course, it also involves the intersection, tangency, continuous color gradient or discontinuity of the images.

[0080] In the traditional printing and dyeing quality inspection process based on artificial intelligence, template matching algorithms, feature extraction and matching algorithms, deep learning algorithms, etc. have been widely used. However, these algorithms all require a large amount of sample materials, and then train the printing and dyeing quality recognition model based on deep learning and sample materials. At the same time, in the processing of various sample materials, it is also necessary to mark and set the printing and dyeing problems. The problem with this type of algorithm is that, on the one hand, a large amount of computing resources are consumed in the training and application of the model, and on the other hand, the training accuracy of the model depends on the accuracy of the marking of the printing and dyeing problems in the sample, which can easily lead to a decrease in the accuracy of the printing and dyeing quality recognition model due to marking deviations.

[0081] In the technical solution of the present application, for the quality inspection of printing and dyeing patterns, there is no need to train the printing and dyeing quality inspection model based on the samples that have been obtained. Instead, parameters such as the printing and dyeing defect area and the importance weight of the printing and dyeing defects in the printing and dyeing pattern are directly obtained to determine the image quality value of the printed and dyed fabric, and the printing and dyeing quality is determined based on the image quality value of the printed and dyed fabric to achieve a quantitative description of the printing and dyeing quality. In this case, it is also possible to determine whether the printed and dyed fabric is scrapped based on the image quality value of the printed and dyed fabric, so that garment companies can effectively control costs.

[0082] This application discloses a printing and dyeing quality detection method based on artificial intelligence to achieve quantitative description and analysis of the image quality of printed and dyed fabrics, thereby ensuring more accurate quality recognition accuracy for printed and dyed patterns. Specifically:

[0083] like Figure 1 As shown, it is a flow chart of a printing and dyeing quality detection method based on artificial intelligence provided in an embodiment of the present application, including:

[0084] S110, acquiring an image of a printed and dyed fabric, and preprocessing the image of the printed and dyed fabric to acquire an edge line of a printed and dyed pattern in the image of the printed and dyed fabric;

[0085] S120, determining the relative position relationship of the printing and dyeing pattern based on the edge line of the printing and dyeing pattern;

[0086] S130, based on the relative position relationship of the printing and dyeing patterns, acquiring the printing and dyeing patterns with overlapping relationship to obtain overlapping patterns;

[0087] S140, respectively setting masks for all the printing and dyeing patterns in the overlapping pattern, and performing finite element division on the masks to obtain a finite element image;

[0088] S150, obtaining the defect position and defect area in the finite element image to obtain printing and dyeing defect information; S160, obtaining the image quality parameters of the printed and dyed fabric based on the printing and dyeing defect information.

[0089] The purpose of the above steps is to perform image processing on the obtained printed and dyed fabric, then determine the edge line in the pattern, determine the relative position of the edge line, analyze the relative position between different sub-region patterns based on the edge line, set masks for different patterns at the same time, and perform finite element processing on the mask to obtain a finite element image, thereby obtaining the defect position and defect area according to the finite element image, and then further determine the importance weight of the defect based on the defect position, and perform printing and dyeing quality inspection based on the defect weight and defect area. Among them, the reason for determining the defect weight based on the defect position is that in some printing and dyeing patterns, although they are considered to be defects in terms of printing and dyeing quality performance, such defects will not affect the overall performance of the pattern in the entire pattern. For example, the highlight performance of the eyes in the figure portrait, the defect performance is a small defect in the highlight part, which is obviously a defect, but it has no effect on the overall performance, so the weight is very low. For example, a black printing spot appears on the face of the figure portrait. Although the size is very small, it will have a great impact on the overall performance of the pattern, so the weight must be very large.

[0090] Below, all the technical solutions in the above steps will be described separately, specifically:

[0091] As described in step S110, the purpose is to pre-process the image of the printed and dyed fabric, thereby eliminating all possible image information in the image that may affect the accuracy of image analysis in subsequent processing and recognition of the image, and after obtaining an accurate pre-processed image, obtain the edge line of the printed and dyed pattern. Specifically:

[0092] S111, grayscale processing is performed on the image of the printed and dyed fabric to obtain a grayscale image.

[0093] The purpose of this step is to convert the color image into a grayscale image after graying the image of the printed and dyed fabric. On the one hand, it can make it easier to perform noise reduction in subsequent processing, and on the other hand, it can better improve the accuracy of edge determination in the calculation of pixel values.

[0094] Among them, for the obtained printed and dyed fabric image, the pixel values ​​of all the pixels therein are obtained, and then processed according to the corresponding processing rules to obtain a grayscale image.

[0095] In the processing of the image, all the pixels in the image are comprehensively analyzed to obtain the pixels where the sub-region images are tangent or have an interactive area, and then the pixels in the area are marked.

[0096] In some embodiments, the pixel value difference between different sub-region images is analyzed, and a difference threshold is set. When it is found that the pixel value difference between two sub-region images is less than the set difference threshold, the pixel values ​​of the pixels of the two sub-region images are binarized, and the pixel values ​​of such regions in the grayscale image are the same, which makes the image processing more complex and difficult. However, this method is only applicable to images without gradient colors, and the pixel value differences of the sub-region patterns in the image are relatively large.

[0097] S112: Perform noise reduction processing on the grayscale image to obtain a noise-reduced image.

[0098] The purpose of this step is that the obtained grayscale image will obviously contain multiple noise points, which can easily lead to image defect recognition in subsequent quality inspections. In order to improve the quality inspection accuracy of the image, the influence of the noise points needs to be eliminated.

[0099] Among them, during the shooting process of the printing and dyeing pattern, the quality control of the photographed printing and dyeing pattern is achieved by adjusting the shooting camera, including lowering the ISO value, increasing the exposure time, etc., thereby ensuring that the image of the printed and dyed fabric obtained has a higher quality.

[0100] In some embodiments, a plurality of printed and dyed images are acquired and compared to determine the existing noise points, thereby ensuring that the acquired images of the printed and dyed fabric have higher quality.

[0101] Among them, for the grayscale image, the wavelet denoising method is used to convert the grayscale image into a spatial frequency map, and then based on the processing of the spatial frequency map, the noise points in the spatial frequency map are determined and the noise points are removed.

[0102] In some embodiments, denoising processing may be performed using software or plug-ins, such as Adobe Photoshop, Adobe Lightroom, Dfine from Nik Collection, Denoise from Topaz Labs, and the like.

[0103] S113: Perform contrast enhancement processing on the noise reduction image to obtain a high-contrast image.

[0104] The purpose of this step is to determine the edge lines in the image of the printed and dyed fabric after the denoised image has been obtained. However, in the artificial intelligence detection algorithm, it is difficult to directly identify the obtained grayscale graphics. Therefore, it is necessary to highlight the edge lines of the printed and dyed group by improving the contrast.

[0105] Among them, based on the grayscale image in the grayscale image, the pixel values ​​of all pixels therein are processed, and the difference between adjacent pixels is analyzed to obtain an area with a larger difference. At this time, the area can be considered as part of the edge line, and the value of the edge line is set to 0, thereby obtaining a high-contrast image.

[0106] In some embodiments, the difference between adjacent pixel points is calculated, and the area of ​​the edge line can be obtained. The pixel value of the area is then set to the average of the two adjacent pixel values, thereby enhancing the edge line. The image of the adjacent area is also processed with pixels to obtain a high-contrast image.

[0107] In some embodiments, contrast adjustment may be performed using currently available software or plug-ins, such as Adobe Photoshop, Adobe Lightroom, and the like.

[0108] S114. Based on the high-contrast image, obtain pixel values ​​of all pixels in the high-contrast image.

[0109] The purpose of this step is to obtain the pixel values ​​of all pixels based on the high-contrast image. In addition to highlighting the edge line on the image, the pixel value of the edge line area is also very different from the pixel values ​​on both sides of the edge line, which can realize the recognition of the edge line pixel value.

[0110] The pixel arrangement pattern in the high contrast image is obtained, and the pixel values ​​of all the pixels therein are obtained, thereby obtaining all the pixel values ​​of the image.

[0111] Among them, all pixel value processing methods are also based on recording the pixel value acquisition method, so as to obtain the corresponding relationship between the pixel point and the corresponding pixel value.

[0112] In some embodiments, for high contrast images, all pixel values ​​therein may be binarized to obtain black and white images. However, the disadvantage of this method is that for gradient images, image information loss is prone to occur, and edge lines therein are also prone to loss, unless all contour lines are set to black during contrast processing, but this processing method is also difficult to ensure the preservation of all image information.

[0113] S115 , obtaining a pixel value gradient of the pixel point and n×n pixel points around it, wherein the pixel point whose pixel value gradient is not lower than a preset pixel value gradient is the edge line pixel point.

[0114] The purpose of this step is to ensure higher processing efficiency of edge line pixels and improve recognition accuracy of edge line pixels by calculating pixel value gradients in the process of obtaining edge lines.

[0115] In the pixel-based scanning mode, any pixel is the center of a pixel matrix, the pixel matrix has n×n pixels, and the entire printing and dyeing pattern is processed based on the center of the matrix.

[0116] Among them, the pixel value at the center of the matrix and the pixel value gradient of the surrounding pixels are calculated, and a pixel value gradient threshold is set. Only when the pixel value exceeds the threshold, the pixel point can be considered as a pixel point of the edge line. When the pixel value is lower than the threshold, the pixel point is considered as a pixel point of the non-edge line.

[0117] In some embodiments, the edge line pixels that have been obtained are directly connected to obtain the edge line.

[0118] S116: Obtain pixel values ​​and coordinates of the edge line pixel points, determine the adjacent relationship of the edge line pixel points based on the coordinates of the edge line pixel points, and obtain adjacent pixel points.

[0119] The purpose of this step is to connect the edge lines completely based on the contour points. However, in some complex patterns, there are discontinuous edge lines, or there are multiple edge lines that appear to be an integrated structure on the surface, but are not actually an integrated structure. Figure 2 , which is a schematic diagram of a coordinate pattern for the edge line of a printing and dyeing pattern provided in an embodiment of the present application, wherein: Figure 2 (a) is a schematic diagram of the edge lines of only the outermost printing and dyeing pattern. Based on this step, the connection relationship of the edge lines can be analyzed and determined to fully comply with the specific setting plan of the printing and dyeing pattern.

[0120] Among them, for the pixel points that have been obtained, the coordinates of such pixel points are obtained, and for this parameter, it can be obtained based on the plane coordinate system directly set for the image.

[0121] Among them, based on the coordinates that have been obtained, the distance between the coordinate points can be calculated, and for the distance parameters that have been obtained, the adjacent relationship between the pixel points can be obtained by calculating the distance value.

[0122] In some embodiments, the determination is made directly based on the positional relationship between the printing and dyeing patterns, that is, the determination is made based on the spatial arrangement relationship of all pixels in the printing and dyeing patterns.

[0123] S117, obtaining the gradient of the adjacent pixel points, and connecting the adjacent pixel points when the gradient of the adjacent pixel points is not lower than the gradient of the preset adjacent pixel points.

[0124] The purpose of this step is that for the pixels that have been obtained and have adjacent relationships, it is not possible to directly assume that these pixels have a connection relationship, such as Figure 2 (b) is a schematic diagram of all edge lines of the obtained printing and dyeing pattern. It can be found that a single edge line is not connected to other edge lines. If adjacent pixel points are directly connected, it will be considered that a pattern with all edge lines connected is obtained, which is obviously wrong. Therefore, by further verifying the pixel values ​​of adjacent pixel points, the connection relationship of the edge lines can be determined.

[0125] Among them, the pixel value gradient of all adjacent pixel points is calculated, and the gradient of preset adjacent pixel points is set, and the calculated value is compared with the preset value. Only when it is not lower than the threshold, it can be considered that the two adjacent pixel points can be connected and serve as part of the edge line. At this time, they can be connected.

[0126] In some embodiments, considering that the contour line is composed of a large number of pixels, and in terms of the performance of the printed image, if the edge line is not connected, the distance between the two pixels is much larger than the distance between the adjacent pixels on the edge line. Therefore, the method used is to simultaneously calculate the distance between a certain pixel and its two adjacent pixels, and when it is found that one of the two values ​​is much larger than the other, the two adjacent pixels corresponding to the value with the smaller distance are the pixels on the edge line, and they can be connected, and the other pixel is in another pattern or another part of the pattern area.

[0127] In some embodiments, the gradient of adjacent pixel points and the spacing between adjacent pixel points are compared simultaneously and separately with the gradient of preset adjacent pixel points and the spacing between preset adjacent pixel points. Only when both parameters are not lower than the preset values, can it be considered that the two adjacent pixel points can be directly connected and are on the same edge line.

[0128] S118, traversing all the adjacent pixel points to obtain the edge line of the printing and dyeing pattern.

[0129] The purpose of this step is that there are a large number of pixels in the printing and dyeing pattern. By traversing the pixels on all edge lines, the adjacent pixels that can be connected are confirmed, and then the corresponding edge lines can be obtained.

[0130] Among them, all adjacent pixel points are obtained, and based on the method disclosed in step S117, all adjacent pixel points on the edge line that can be directly connected are selected, and after the connection, the edge line of the printing and dyeing pattern can be obtained.

[0131] Among them, the adjacent pixel points mentioned in this step refer to the pixel points that may appear on the edge line, rather than all the pixel points with adjacent relationships in the entire printing and dyeing pattern. Therefore, by adopting this method, it is possible to confirm the pixel points on the edge line and confirm whether such pixel points have a connection relationship, thereby obtaining a specific edge line relationship.

[0132] As described in step S120, the purpose of this step is that, since the spatial relationship of the images of each sub-region in the printing and dyeing pattern is actually displayed based on the edge line, in the specific processing, the relative position relationship of the printing and dyeing pattern is determined by obtaining the edge line of the printing and dyeing pattern. Specifically:

[0133] S121, obtaining the geometric center of the printing and dyeing pattern formed by the edge line of the printing and dyeing pattern.

[0134] The purpose of this step is to determine the printing pattern surrounded by the edge lines and determine the newly obtained pattern. The image obtained in this way is actually likely to be different from the image of the printed fabric. In this case, it is easier to obtain the geometric center of the pattern.

[0135] The coordinates of all the edge lines that have been obtained are acquired, and the geometric center of the printing and dyeing pattern is obtained based on the coordinate values.

[0136] In some embodiments, the coordinate values ​​of the directly obtained printing and dyeing pattern are obtained, and the geometric center is determined based on the coordinate values. However, in this method, there are too many coordinate points, which requires a high amount of data calculation of the computing system, consumes a lot of computing resources, and increases the computing delay, which reduces the efficiency of quality inspection of the printing and dyeing pattern.

[0137] S122, establishing a plane coordinate system with the geometric center as the origin to obtain an image coordinate system.

[0138] The purpose of this step is to ensure that the printed image is in the middle area of ​​the plane coordinate system to the greatest extent when the plane coordinate system is established based on the geometric center, so as to have a better processing effect in the subsequent technical implementation.

[0139] Based on the obtained geometric center, this point is set as the origin of the plane coordinate system, thereby ensuring that the established plane coordinate system is located in the central area of ​​the printing and dyeing pattern. Figure 3 As shown, it is a schematic diagram of the intersection of a printing and dyeing pattern provided in an embodiment of the present application, such as Figure 3 As shown in (a), corresponding judgment rays are set for all images in the printing and dyeing pattern on the right side of the image. For the entire printing and dyeing pattern, corresponding judgment rays need to be set for different printing and dyeing patterns therein, and the entire coordinate system includes all edge lines.

[0140] S123, based on any point on the edge line of the printing and dyeing pattern, obtaining a line connecting the image coordinate system and any point on the edge line of the printing and dyeing pattern, and obtaining the number of intersections between the edge line of the printing and dyeing pattern and the line.

[0141] The purpose of this step is that, since edge lines are usually highly complex and there are a large number of edge lines in the entire printing and dyeing pattern, based on the intersections of edge lines and other rays, the subsequent positional relationship of the printing and dyeing pattern can be confirmed based on the number of intersections.

[0142] For the edge line that has been obtained, a point is randomly selected from the edge line, and a connecting line is established between the point and the origin of the image coordinate system, and the connecting line is extended to obtain the number of intersections between the edge line and the connecting line.

[0143] In some embodiments, rays are directly drawn out from the image coordinate system, and the intersection points between all rays and edge lines are obtained. That is to say, it is not a method of obtaining connecting points on edge lines and then obtaining connecting lines, but directly based on setting rays and then obtaining intersection points. For each ray, the number of intersection points on the ray is obtained to determine the intersection points between such rays and edge lines.

[0144] S124. Determine the positional relationship of the printing and dyeing pattern based on the number of intersections.

[0145] The purpose of this step is to determine the positional relationship between the printing and dyeing patterns based on the number of intersections between the edge lines and the rays, and the correlation between the intersections, for the edge lines that have been obtained. Specifically:

[0146] S1241. Obtain the maximum and minimum values ​​of the horizontal coordinates of the edge line of the printing and dyeing pattern in the image coordinate system, connect the origin of the image coordinate system, and the coordinate points corresponding to the maximum and minimum values ​​of the horizontal coordinates, and obtain two constrained rays.

[0147] The purpose of this step is to find the two most edge points within the edge line range of the current printing and dyeing pattern based on the determination of the horizontal axis maximum and minimum values ​​of the edge line of the printing and dyeing pattern, and set the rays with these two points as the points of the rays. In this case, it can be ensured that the two rays obtained limit the spatial range of the edge line to determine the limitation of the edge line range.

[0148] Among them, the horizontal coordinate of the edge line is obtained, and then all the horizontal coordinates are analyzed, and the maximum and minimum values ​​of the horizontal coordinates are found. When these two parameters are obtained, the coordinate points corresponding to the maximum and minimum values ​​of the horizontal coordinates are used as edge points of the edge line, and then the edge points and the origin of the image coordinate system are connected to obtain rays.

[0149] In the determination of the maximum and minimum values ​​of the horizontal coordinates of the edge line, a single edge line is set as the analysis object, so as to obtain the edge points for each edge line, and thus obtain the limited range. Specifically, a corresponding constraint ray is set for each edge line, so as to determine the spatial range of the edge line based on the constraint ray.

[0150] In some embodiments, after the edge point of the edge line is determined, a tangent is set for the edge point, and then the intersection of the two tangents is obtained. The intersection is obviously the endpoint of the ray, and the two tangents are the constraint rays.

[0151] In some embodiments, the printing and dyeing pattern is decomposed based on the density of edge lines to obtain different decomposition areas of the printing and dyeing pattern, and the edge points in the different decomposition areas are analyzed, and then the constraint rays are set based on the edge points in the different decomposition areas.

[0152] In some embodiments, a constraining ray is set for each sub-region graphic, thereby determining a range defined by the constraining ray of each sub-region image.

[0153] S1242. Evenly set m rays between the two constraint rays to obtain determination rays, wherein the angle between adjacent determination rays is θ.

[0154] The purpose of this step is to determine the spatial position relationship of the edge lines in the printing and dyeing pattern. Obviously, it is necessary to determine it based on the number of intersections of multiple rays. At the same time, in order to obtain the interval relationship and range of each printing and dyeing pattern, it is obviously necessary to set multiple rays therein. Based on the uniform setting of the rays, the spatial position relationship of different patterns can be analyzed.

[0155] Here, the angle between the two constrained rays is obtained, and the number of other rays between the two constrained rays is set, so as to obtain the angle between these rays, which is set to θ.

[0156] In some embodiments, a ray is randomly set between the two constrained rays. When the number of intersections between the newly set ray and the edge line increases significantly, it is determined whether the intersection between the ray and the edge line is the same as the edge line intersected by the constrained ray. If not, the coordinates of the edge line are determined for the intersection area between the newly added ray and the edge line, and compared with the coordinates of the edge line of the constrained ray to determine the spatial position relationship between the two printing and dyeing patterns. However, this method consumes a lot of computing resources in data processing, and the effect is relatively poor.

[0157] S1243: Obtain the number of intersections of the constraint ray, the determination ray, and the constraint ray, and establish a corresponding relationship between the number of intersections of the constraint ray and the determination ray.

[0158] The purpose of this step is that for edge lines, the corresponding printing and dyeing patterns may contain different spatial position relationships. In this case, the number of intersections between the rays and the edge lines is obviously different. Therefore, by determining the number of intersections, the spatial position relationship of the printing and dyeing patterns can be better analyzed.

[0159] Among them, the intersection points of the set ray and the edge line are determined, and the number of intersection points on the ray is determined.

[0160] Among them, for all the set rays, the rays are marked or marked, the number of intersections on each ray is obtained, and the number of intersections and the mark or label are associated with information, so as to construct a corresponding relationship between all the rays themselves and the number of intersections. Obviously, all rays include constraint rays and judgment rays.

[0161] Among them, based on the marking and identification of all rays, the spatial positions of the rays are set, so as to establish a ray sequence. Based on the ray sequence, the adjacent relationship between the rays can be better analyzed.

[0162] S1244: Obtain and compare the numbers of intersections of adjacent determination rays to obtain adjacent determination rays with different numbers of intersections.

[0163] The purpose of this step is to obtain the number of intersections of adjacent judgment rays, and then compare the number of intersections of adjacent judgment rays. Based on this method, the type of edge lines intersected by the rays can be determined, that is, whether they belong to different edge lines, and the positional relationship between different edge lines.

[0164] The number of intersections between all the determination curves and the edge lines is obtained, and the number of intersections between adjacent determination rays is obtained, and the corresponding determination rays are determined.

[0165] After the number of intersection points is determined, the determination rays corresponding to the number of intersection points are analyzed, and it is analyzed whether the obtained determination rays are adjacent.

[0166] In some embodiments, if the number of intersections between adjacent determination rays changes, the number of intersections of the adjacent determination rays on the other side are compared, and the determination rays with the same number of intersections are set into the same set. Then, based on the spacing between the determination rays and the constraint rays, the determination rays are classified into a set of determination rays in which the number of intersections changes. The intersections of such determination rays come from different edge lines.

[0167] In some embodiments, for a determination ray with multiple intersection points, the uniqueness of the edge line is determined. The uniqueness of the edge line refers to whether the edge lines are the same edge line.

[0168] S1245, obtaining the determination ray having the number of adjacent intersections, and obtaining the intersections of the determination curve and the edge line of the printing and dyeing pattern to obtain range intersections.

[0169] The purpose of this step is to analyze the image of the sub-area of ​​the intersection obtained in the printing and dyeing pattern, which may have multiple printing and dyeing patterns. Therefore, in the specific processing, it is necessary to determine the spatial relationship between different printing and dyeing patterns. Based on the area division, the spatial position relationship of different printing and dyeing patterns in the divided area is confirmed.

[0170] Among them, for the intersection points that have been obtained, the coordinates of the intersection points are obtained, and the maximum values ​​of the horizontal and vertical coordinates of the intersection points are analyzed respectively, and then the coordinate points that can be used as the intersection points of the range are screened out.

[0171] In some embodiments, the intersection points obviously belong to the same edge line, and there may be a situation where there are multiple intersection points between the ray and one side of the edge line. In this case, the multiple intersection points on the same side of the edge line are all used as range intersection points.

[0172] S1246. Connect adjacent intersection points of the range to obtain a closed figure, where the closed figure is the determination area.

[0173] The purpose of this step is to connect all the intersections in the range when the range intersections have been obtained, so as to obtain a closed image. At this time, based on the closed figure, different figures in the closed figure can be determined, and the range intersections can be determined based on the closed figure to simplify the spatial relationship distribution analysis process of the printing and dyeing pattern.

[0174] Among them, the adjacent intersection points in the range intersection are obtained, the adjacent intersection points are determined, and then they are connected to obtain the judgment area. Figure 3 As shown in (b), polygon ABCDE is a judgment area in the printing and dyeing pattern, and based on the judgment area, the subsequent spatial distribution relationship of the printing and dyeing pattern is determined.

[0175] In some embodiments, based on the horizontal and vertical coordinate analysis, the intersection points in the internal space of the printing and dyeing pattern are obtained. In addition to the intersection points in this type of internal space, all the intersection points are connected by adjacent intersection points to obtain a polygon, which is the judgment area.

[0176] In some embodiments, if it is found that the edge of the obtained judgment area is tangent to or intersects with the edge line therein, the position of the printing and dyeing pattern therein is adjusted to ensure that the obtained judgment area can include all edge lines within the range.

[0177] In some embodiments, the judgment area of ​​the printing and dyeing pattern is set accordingly. For the judgment nodes therein, for the polygon ABCDE that has been obtained, the rays OA and OD are used as limiting rays, and all rays in the internal space of these two rays are judgment rays. The number of intersections on different judgment rays is analyzed respectively, and it is found that the number of rays OA to OD is 2, 3, 4, 5, 4, 3 and 1 respectively. Among them, there is an edge line that is the outermost edge line of the pattern, so each data is reduced by 1, and the number of intersections of the internal graphics is 1, 2, 3, 4, 3, 1 respectively. Based on the change in the number of intersections, it can be determined that when the number of intersections is 3, the judgment ray is in a tangent state with the internal pattern, and when the number of intersections is 4, it is in an intersecting state. Of course, for the technical solution of the present application, the attached Figure 3 (b) is only a schematic diagram. In practice, more determination rays will be set therein to obtain more intersection number data to determine the positional relationship of the pattern.

[0178] S1247, obtaining the number of intersections on different determination rays in the determination area, if the number of intersections on the determination rays is different, the printing and dyeing patterns corresponding to the edge lines of the printing and dyeing patterns are not in a tangent or intersecting relationship.

[0179] The purpose of this step is to consider that in the positional relationship analysis of the printing and dyeing patterns, the number of intersections of the judgment rays is the least in the two outermost areas of the position, and the number of intersections in the middle part is more. At the same time, the number of intersections can also represent the positional relationship between the two printing and dyeing patterns. Therefore, based on this step, the positional relationship is determined.

[0180] Here, the number of intersections in the judgment area is obtained, and the judgment setting where the intersections are located is determined.

[0181] The number of intersections on different determination rays in the determination area is obtained and sorted. The two determination rays with the smallest number of intersections are obviously the outermost determination rays of the printing and dyeing pattern.

[0182] Among them, after obtaining the outermost judgment ray, the judgment ray of the inner space of the outermost judgment ray is further obtained. When the number of intersections on the judgment rays is the same, it is considered that the two printing and dyeing patterns are in an inclusion relationship; when there are only two types of intersections on the judgment rays, and the difference between the two numbers of intersections is 1, and there is only one judgment ray with fewer intersections, it is considered that the two printing and dyeing patterns are tangent; when there are only two types of intersections on the judgment rays, and the difference between the two numbers of intersections is 1, and there are only two judgment rays with fewer intersections, it is considered that the two printing and dyeing patterns intersect.

[0183] S1248, determining the position of the printing and dyeing pattern to obtain the relative position relationship of the printing and dyeing pattern.

[0184] The purpose of this step is to determine the relative position relationship between the printing and dyeing patterns based on step S1247. In this case, the specific performance of different printing and dyeing patterns can be determined to lay the foundation for subsequent processing procedures.

[0185] All the printing and dyeing patterns in the image of the entire printed and dyed fabric are processed, so as to determine the relative position relationship of all the printing and dyeing patterns therein.

[0186] As described in step S130, the purpose of this step is to determine all the relationships in the printing and dyeing pattern based on the above steps, and then mark the patterns with interactive relationships by marking the images and edge lines, so as to lay the foundation for subsequent quality analysis. Specifically:

[0187] S131, acquiring the printing and dyeing patterns whose relative positional relationship is tangent or intersecting, to obtain patterns with an interactive relationship.

[0188] The purpose of this step is that for printing and dyeing patterns, for printing and dyeing patterns that are tangent, contained or intersected, the relative positions in this type of printing and dyeing patterns are special. By determining the relative positions, the printing and dyeing defects in different areas can be determined in the printing and dyeing quality analysis, thereby achieving quantitative description.

[0189] The relative positions between the printing and dyeing patterns are determined, and all the printing and dyeing patterns that are contained, tangent or intersecting are selected.

[0190] Here, the positional relationship of the edge lines of the printing and dyeing pattern is set, so that in the obtained printing and dyeing pattern, the spatial positional relationship of the printing and dyeing pattern is described.

[0191] In some embodiments, edge lines in the printing and dyeing patterns having a containment relationship or a tangent relationship are described, so that for the obtained printing and dyeing patterns, the relative position relationship of the printing and dyeing patterns can be described therein.

[0192] S132, marking the edge lines of the printing and dyeing patterns in the patterns having an interactive relationship respectively to obtain marked lines of the printing and dyeing patterns.

[0193] The purpose of this step is to determine the edge lines of the obtained printing and dyeing patterns with interactive relationships, and to mark such edge lines. Based on the marked lines, the relative position relationship between different edge lines can be determined, and further, the relationship between the printing and dyeing patterns can be explained, such as one pattern is located on the surface of another pattern.

[0194] Therein, patterns with interactive relationships are obtained, and then edge lines of such patterns are determined, thereby marking the edge lines.

[0195] S133, based on the marking lines of the printing and dyeing patterns, marking the patterns with interactive relationships respectively to obtain overlapping patterns.

[0196] The purpose of this step is to determine the relative positions between the printing and dyeing patterns based on the obtained marked lines, such as inclusion, tangency, intersection, etc., and also to determine the superposition relationship of the printing and dyeing patterns therein, so that the influence weight can be determined based on this overlapping relationship, and the relative position relationship between all the printing and dyeing patterns in the image of the entire printed and dyed fabric can be obtained.

[0197] Among them, for the image of the entire printed and dyed fabric, the patterns with interactive relationships are determined, so that in the subsequent specific analysis, the patterns with interactive relationships are decomposed to obtain the relative position relationship of the printed and dyed patterns.

[0198] Among them, for the printing and dyeing patterns with interactive relationships, all the patterns with interactive relationships are separated to obtain different overlapping patterns respectively.

[0199] In some embodiments, when processing the printed and dyed fabric, all the overlapping pattern parts therein are decomposed to obtain a plurality of decomposed regions of the printed and dyed pattern, and the decomposed image corresponding to each printed and dyed region is the corresponding overlapping pattern.

[0200] As described in step S140, the purpose of this step is to set a mask for the printing and dyeing pattern, and the mask of each printing and dyeing pattern is set separately, so as to determine the position of the printing and dyeing defect and the corresponding layer. In addition, considering that the printing and dyeing defects and the area of ​​the printing and dyeing pattern need to be analyzed in the printing and dyeing quality inspection, by setting a square grid, it is easier to calculate these two areas, so as to improve the calculation speed and accuracy of the area. Specifically:

[0201] S141, acquiring all the printing and dyeing patterns in the overlapping pattern, and setting masks for all the printing and dyeing patterns respectively to obtain image masks.

[0202] The purpose of this step is to set masks for all areas included in the printing and dyeing patterns respectively. In this case, based on the form of the mask setting, the printing and dyeing patterns can be distinguished, which makes it easier to determine the subsequent printing and dyeing defect locations. Based on the layout type of the mask, the mask can also be set according to the weight of the printing and dyeing defects.

[0203] Among them, for the overlapped pattern that has been obtained, the edge lines or the marked lines in the overlapped pattern are obtained, and based on the connection relationship between the edge lines or the marked lines, a closed figure is obtained based on the connection relationship.

[0204] Wherein, all closed figures in the overlapping pattern are obtained, and different masks are set for all the closed figures respectively.

[0205] In some embodiments, a corresponding weight value is set for the set mask, thereby facilitating subsequent weight determination.

[0206] In some embodiments, each overlapping figure in the printing and dyeing pattern is an open figure. In this case, adjacent endpoints are connected according to the edge line endpoints in the overlapping pattern to obtain a closed figure.

[0207] In some embodiments, overlapping patterns are obtained by decomposing printing and dyeing patterns. In this case, the cutting edges can be directly connected. At this time, all the patterns obtained belong to closed images, and masks can be set for the obtained closed patterns respectively.

[0208] S142: Obtain the length and width of the image mask.

[0209] The purpose of this step is to determine the length and width of the mask. Based on the determination of these two parameters, the finite element grid in the eye mask can be better divided. In the subsequent grid edge length processing, the side length of the square grid is determined.

[0210] The process of determining the length and width of the mask is based on the coordinates in the overlapped image that have been obtained, so that the length and width parameters in the overlapped image are obtained based on the coordinates.

[0211] Among them, for overlapping graphics with an intersecting relationship, all the printing and dyeing patterns formed therein are measured and processed respectively to obtain the length and width of all the printing and dyeing patterns that constitute the overlapping image.

[0212] In some embodiments, the determination is made based on the already set marking lines to obtain all the printing patterns in the overlapping patterns.

[0213] S143. Based on the length and width of the image mask, obtain the side length of the square grid during the finite element division. The equation for the side length of the square grid is:

[0214]

[0215] Wherein, l represents the side length of the square grid, a represents the length of the image mask, b represents the width of the image mask, and n represents the number of portions into which the width of the image mask is divided. represents the floor function, Represents the ceiling function.

[0216] The purpose of this step is to set corresponding masks for all the printing and dyeing patterns in the overlapping patterns, and to set different finite element grids for different masks, so that the area calculation can be performed using the finite element grids that have been set. In addition, considering that the printing and dyeing patterns themselves are irregular, the set grids need to be guaranteed to be square, otherwise the area of ​​the graphics in the edge area will be difficult to confirm.

[0217] Among them, since the length and width of the setting area of ​​different parts of the mask in the overlapping pattern are not special, even if the grid side length is determined in one direction, the grid set in the other direction cannot be in a state of coincidence with the two ends of the longest line. Therefore, a reasonable method is needed to determine the normal grid side length. Specifically:

[0218] For the obtained image mask, the length and width of the mask are a and b respectively. Assuming that the width is taken as the basis and the width is evenly decomposed into m parts, the calculation equation for the initial value of the side length of the obtained square grid is:

[0219]

[0220] Where l' is the initial value of the side length of the square grid.

[0221] When obtaining the side length of the finite element mesh, the set m value cannot guarantee that the mesh can perfectly coincide with the endpoints of the long side. Therefore, the long side is processed by upward evidence acquisition. Specifically:

[0222]

[0223] Among them, m c represents the number of decompositions of the long side, Represents the ceiling function.

[0224] After obtaining the number of long side decompositions, it is necessary to readjust the short side decomposition to determine the new side length, which is:

[0225]

[0226] For all the new edge lengths obtained, further analysis is required. However, in the case of equation (3), the finite element mesh cannot guarantee perfect coincidence with the endpoints of the short edges. In order to simplify the calculation, the length of the short edge can also be adjusted, and the adjusted width parameter is:

[0227]

[0228] In the processing of this process, since the overall impact on the width parameter and the length parameter is small, in this case, the error value generated can be used as the allowable deviation.

[0229] After obtaining the adjusted width parameter, it is necessary to further analyze the number of divisions for the short axis, because it is necessary to ensure that it can be divided evenly. Therefore, in the specific processing process, it is necessary to round down. The division equation is:

[0230]

[0231] in, Represents the floor function.

[0232] After obtaining the adjusted width parameter and the number of divisions corresponding to the parameter, the side length of the square grid can be obtained as:

[0233]

[0234] Wherein, for the printing and dyeing patterns in the obtained overlapping patterns, the normal grid side length in the printing and dyeing patterns is determined based on the analysis of the length and width of the printing and dyeing patterns.

[0235] S144. Based on the side length of the square grid, perform finite element division on the mask to obtain a finite element image.

[0236] The purpose of this step is to set a finite element grid on the printed pattern with a mask after determining the side length of the square grid. In the subsequent area calculation, the area calculation can be performed directly based on the side length of the square grid that has been set, thereby improving the speed and accuracy of area calculation.

[0237] Herein, based on the masks that have been set, and the lengths and widths corresponding to different masks, the side lengths of the square grids in different masks are determined respectively, so that the finite element grids are set separately and independently based on the grids.

[0238] As described in step S150, the purpose of this step is to obtain the area with printing and dyeing defects in the printing and dyeing pattern based on the finite element image, and at the same time, calculate the area of ​​such defects. In addition, for different positions of the printing and dyeing pattern, determine the importance of the current printing and dyeing defects, so as to obtain the weight of the currently detected defects, and calculate based on these two parameters. Specifically:

[0239] S151. Based on the printing and dyeing pattern, obtain the defect type of the finite element image.

[0240] The purpose of this step is to determine the type of defects in the printing and dyeing pattern, so as to determine the importance of the defects in the printing and dyeing pattern currently being detected, and thus determine the defect weights therein based on the scheme.

[0241] Among them, the defect type in the printing and dyeing pattern is determined based on the defect manifestation, and common ones include: printing and dyeing omissions, abnormal interruptions in line patterns, excessive color difference in printing and dyeing colors, etc., and the resulting defects are recorded.

[0242] In some embodiments, for the existing defect type, the position of the current defect type in the printing and dyeing image is obtained, the obtained defect type and the printing and dyeing position are integrated to determine the defect importance of the current area, and the obtained defect importance is set as the defect type. The equation for defect importance is:

[0243]

[0244] Among them, I t represents the importance of the defect, T represents the type of defect, e represents the horizontal / vertical index of all coordinates on the defect edge, f represents the total horizontal / vertical index of all coordinates on the defect edge, g represents the horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, h represents the total horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, x represents the total horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, te is the horizontal coordinate on the defect edge, x Te is the horizontal coordinate of the printing and dyeing pattern, y te is the ordinate on the defect edge, y Te It is the vertical coordinate of the printing and dyeing pattern.

[0245] In some embodiments, the causes of the obtained printing and dyeing defects are analyzed. For example, if a certain ribbon printing and dyeing pattern is found to have a straight discontinuous area and a shadow exists on the fabric part, it can be determined that the area is caused because the fabric was not completely straight during the printing and dyeing process.

[0246] S152: Based on the printing and dyeing pattern, obtain the defect position corresponding to the defect type.

[0247] The purpose of this step is to determine the position of the printing defect in the printing pattern based on the obtained printing defect, thereby determining the importance of the defect based on the position parameter to achieve a quantitative description of the importance parameter of the defect itself.

[0248] Among them, for all defect information in the printing and dyeing pattern, all edge coordinates of the defect are obtained, and then determined based on equation (7).

[0249] S153. Based on the defect position, obtain the position of the defect position in the finite element image.

[0250] The purpose of this step is to obtain defect information based on the printing and dyeing pattern itself. However, the information obtained based on this method cannot determine the position of the printing and dyeing defect in the finite element image, which can easily lead to the mismatch between the defect information and the defect area. Therefore, by adopting this method, high-precision overlap of these two types of information can be achieved.

[0251] The obtained finite element image also has coordinate points, so the coordinates of the defect area and the defect position can be overwritten with the coordinates in the finite element image.

[0252] Among them, for the coordinates of all defective areas, the adjacent coordinate relationship is obtained, and the adjacent coordinate points are directly connected. Then, in the final printing and dyeing defect image, the area is easier to calculate than the irregular figure caused by the direct defect.

[0253] S154, acquiring the area of ​​the defect position to obtain the printing and dyeing defect information.

[0254] The purpose of this step is to calculate the location of the defect and obtain the defect type at the same time. Under the joint action of these two parameters, the printing and dyeing defect information is obtained, thereby obtaining the final result.

[0255] Wherein, step S154 specifically includes:

[0256] S1541, obtaining edge lines of all the printing and dyeing patterns.

[0257] The purpose of this step is to obtain the edge lines of all printing and dyeing patterns. When printing and dyeing defects occur, the edge lines in the image are obviously increased compared with the normal image, so as to identify the defects based on the obtained edge lines.

[0258] Wherein, all edge lines in the printing and dyeing pattern are identified, thereby obtaining all edge lines therein.

[0259] In some embodiments, for all edge lines in the printing and dyeing pattern, the printing and dyeing pattern is decomposed into intervals according to the density of the edge lines, and the number of edge lines in each interval is identified respectively.

[0260] S1542, obtaining edge lines of all the printing and dyeing patterns and comparing them with edge lines of standard printing and dyeing patterns to obtain additional edge lines.

[0261] The purpose of this step is to obtain the additional edge lines in the detected printing and dyeing pattern by comparing the number and positional relationship of the edge lines. Such additional edge lines are obviously the edge lines with printing and dyeing defects. In other words, printing and dyeing defects can be determined based on this method.

[0262] Wherein, all edge lines in the standard printing and dyeing pattern are obtained, and the edge lines in the standard pattern are compared with the edge lines of the printing and dyeing pattern to be detected, so as to determine all the multiple edge lines therein.

[0263] The multiple edge lines are compared, so that all printing and dyeing defects therein are obtained based on the multiple edge lines.

[0264] S1543, obtaining the enclosed area of ​​the multiple edge lines, and calculating the enclosed area based on the finite element image, wherein the equation of the enclosed area is:

[0265]

[0266] Among them, S r represents the enclosed area, p represents the number of complete square grids of the finite element image in the enclosed area, l represents the side length of the square grid, S ai represents the incomplete square grid area of ​​the finite element image in the enclosed area, i represents the index of the incomplete square grid, and j represents the total number of incomplete square grid indexes.

[0267] The purpose of this step is to determine the area of ​​the defects that have been obtained, so as to quantitatively describe the impact range of the printing and dyeing defects.

[0268] Among them, for the printing and dyeing defects that have been obtained, finite element division has been achieved. In this case, the area can be determined directly based on the finite element grid.

[0269] Among them, based on the multiple edge lines that have been obtained, the edges of the printing and dyeing defects are determined, and in the set mask, such areas will also be masked. In determining the area, the area is calculated based on the mask determination of the defect position.

[0270] S1544: Based on the enclosed area of ​​the multiple edge lines and the defect type, the printing and dyeing defect is obtained. The equation of the printing and dyeing defect is:

[0271]

[0272] Where T represents the type of defect, e is the horizontal / vertical index of all coordinates on the defect edge, f is the total horizontal / vertical index of all coordinates on the defect edge, g is the horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, h is the total horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, x is the total horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, te is the horizontal coordinate on the defect edge, x Te is the horizontal coordinate of the printing and dyeing pattern, y te is the ordinate on the defect edge, y Te It is the vertical coordinate of the printing and dyeing pattern.

[0273] The purpose of this step is to integrate the already obtained multi-edge line enclosed area and defect type, and then combine these two parameters to obtain the printing and dyeing defect results, thereby achieving a quantitative description of the printing and dyeing defects.

[0274] As described in step S160, the purpose of this step is to classify the image quality of the printed and dyed fabric based on the obtained printing and dyeing defect information, so as to achieve a more accurate determination of the image of the printed and dyed fabric. Specifically:

[0275] S161. Based on the defect information, obtain a defect impact weight corresponding to the defect information.

[0276] The purpose of this step is that, in the technical solution of the present application, all printing and dyeing defects are taken into account in different ways because they have different effects on the visual perception of the entire printing and dyeing image. Therefore, in the specific processing, by setting defect impact weights based on defect information, different types of defect information can be assigned different importance values, that is, influence weights can be obtained.

[0277] A weight is set for each type of defect information, and the weight is set based on a specific rule, such as decomposing the defect information into different levels according to the value of the defect information, and setting a weight value for each level.

[0278] In some embodiments, corresponding weights are set based on defect types in defect information to achieve correspondence between defect types and weights of the printing and dyeing pattern.

[0279] In some embodiments, the corresponding weight is set based on the position of the printing defect in the printing pattern.

[0280] S162: Determine the image quality value of the printed and dyed fabric based on the defect impact weight.

[0281] The purpose of this step is to calculate all the image quality values ​​in the specific parameters of the printing and dyeing pattern, so as to quantitatively describe the defects of the printing and dyeing pattern. Specifically:

[0282] S1621. Based on the defect impact weight and the defect information, obtain an image quality value of the overlapping pattern. The image quality value equation of the overlapping pattern is:

[0283]

[0284] Among them, D Tc represents the defect information of the cth defect, Q s Indicates the image quality value of the mask where the defect is located, f c represents the impact weight of the cth defect, S rc represents the enclosed area corresponding to the cth defect, S represents the corresponding area, c represents the index of the printing and dyeing fabric defect, and d represents the total index of the printing and dyeing fabric defect.

[0285] The purpose of this step is to calculate the defects of the printing and dyeing pattern, in which there are multiple overlapping patterns. In fact, each overlapping pattern has a different impact on the appearance of the printing and dyeing pattern. Therefore, the quality analysis of the entire printing and dyeing pattern needs to be based on the specific analysis of different overlapping patterns before it can be applied to the subsequent calculation process.

[0286] Among them, for the image quality value of the overlapping pattern, the mask area in the denominator refers to the sum of the mask areas of the normal image and the defective image, and the numerator represents all printing and dyeing defects in the area of ​​the mask area sum, and corresponding weights are also set for the printing and dyeing defects.

[0287] S1622, based on the importance weights of all the overlapping patterns in the image of the printed and dyed fabric, obtaining the image quality value of the printed and dyed fabric, the image quality value equation of the printed and dyed fabric is:

[0288]

[0289] Among them, Q represents the image quality value of printed and dyed fabrics, Q su represents the image quality value of the mask where the u-th defect is located, u represents the index of the mask in the image of the printed and dyed fabric, v represents the total index of the mask in the image of the printed and dyed fabric, and Z u Represents the importance weight of overlapping patterns in the image of printed fabric.

[0290] The purpose of this step is to quantitatively analyze the image quality of the entire printed fabric based on the weights of all overlapping patterns in the images of all printed fabrics and in combination with the image quality of the overlapping patterns.

[0291] Among them, according to the complexity of the edge lines in the overlapping pattern, the corresponding importance weight is automatically generated. For example, the ratio of the number of edge lines in the overlapping pattern and all the edges in the printing and dyeing pattern is calculated, and the obtained ratio is the importance weight.

[0292] In some embodiments, a judgment relationship of "importance weight - edge line number interval - edge line number" is established, that is: the obtained edge line number of the overlapping pattern and the edge line number interval are compared, and based on the interval, the importance weight corresponding to the interval is determined, thereby obtaining the importance weight.

[0293] In some embodiments, the importance weight is directly obtained by determining information such as the position of overlapping patterns.

[0294] The importance weights corresponding to all overlapping patterns and the image quality values ​​of the overlapping patterns corresponding to the importance weights are obtained, thereby obtaining the image quality value results for the printed and dyed fabrics.

[0295] S163: Obtain the image quality grade of the printed and dyed fabric based on the image quality value of the printed and dyed fabric and a preset image quality value interval of the printed and dyed fabric.

[0296] The purpose of this step is to determine the grade of the image quality of the printed and dyed fabric by comparing the obtained image quality value of the printed and dyed fabric with the value in the set quality value interval.

[0297] Among them, the image quality value level interval of the printed and dyed fabric is set based on the parameter setting.

[0298] Among them, in the setting of the preset image quality value range of the printed and dyed fabric, other instructions based on the quality value range are also set, including whether the fabric needs to be scrapped, whether the fabric needs to be re-printed and dyed, and the subsequent processing technology of the fabric.

[0299] The image quality value of the printed and dyed fabric obtained by calculation is compared with a preset image quality value interval of the printed and dyed fabric, and when the image quality value falls within the corresponding interval, subsequent processing measures for the fabric are determined.

[0300] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to computer program instructions, and the aforementioned computer program can be stored in a non-volatile storage medium. When the computer program is executed, it executes the steps of the above method embodiments. Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the embodiment of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a non-volatile storage medium and includes a number of instructions for enabling an electronic device (which can be a personal computer, a server, a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention.

[0301] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A printing and dyeing quality detection method based on artificial intelligence, characterized in that: The method comprises: Acquire an image of a printed and dyed fabric, and pre-process the image of the printed and dyed fabric to obtain an edge line of a printed and dyed pattern in the image of the printed and dyed fabric; Determining the relative position relationship of the printing and dyeing pattern based on the edge line of the printing and dyeing pattern; Based on the relative positional relationship of the printing and dyeing patterns, the printing and dyeing patterns having an overlapping relationship are acquired to obtain an overlapping pattern; Setting masks for all the printing and dyeing patterns in the overlapping pattern respectively, and performing finite element division on the masks to obtain finite element images; Acquire the defect position and defect area in the finite element image to obtain printing and dyeing defect information; Based on the printing and dyeing defect information, image quality parameters of the printed and dyed fabric are obtained.

2. The artificial intelligence-based printing and dyeing quality detection method according to claim 1 is characterized in that: The step of acquiring an image of a printed fabric and preprocessing the image of the printed fabric to acquire an edge line of a printed pattern in the image of the printed fabric includes: grayscale the image of the printed and dyed fabric to obtain a grayscale image; Performing noise reduction processing on the grayscale image to obtain a noise-reduced image; Performing contrast enhancement processing on the noise reduction image to obtain a high-contrast image; Based on the high contrast image, obtaining pixel values ​​of all pixels in the high contrast image; Obtaining the pixel value gradient of the pixel point and the n×n pixel points around it, the pixel point whose pixel value gradient is not less than the preset pixel value gradient is the edge line pixel point; Obtaining pixel values ​​and coordinates of the edge line pixel points, determining the adjacent relationship of the edge line pixel points based on the coordinates of the edge line pixel points, and obtaining adjacent pixel points; Obtaining the gradient of the adjacent pixel points, and connecting the adjacent pixel points when the gradient of the adjacent pixel points is not lower than the gradient of the preset adjacent pixel points; All the adjacent pixel points are traversed to obtain the edge line of the printing and dyeing pattern.

3. The artificial intelligence-based printing and dyeing quality detection method according to claim 1 is characterized in that: The determining the relative position relationship of the printing and dyeing pattern based on the edge line of the printing and dyeing pattern comprises: Obtaining the geometric center of the printing and dyeing pattern formed by the edge line of the printing and dyeing pattern; Establishing a plane coordinate system with the geometric center as the origin to obtain an image coordinate system; Based on any point on the edge line of the printing and dyeing pattern, obtaining a line connecting the image coordinate system and any point on the edge line of the printing and dyeing pattern, and obtaining the number of intersections between the edge line of the printing and dyeing pattern and the line; Based on the number of intersections, the positional relationship of the printing and dyeing pattern is determined.

4. The artificial intelligence-based printing and dyeing quality detection method according to claim 3 is characterized in that: Determining the positional relationship of the printing and dyeing pattern based on the number of intersections includes: Obtaining the maximum and minimum values ​​of the horizontal coordinates of the edge line of the printing and dyeing pattern in the image coordinate system, connecting the origin of the image coordinate system and the coordinate points corresponding to the maximum and minimum values ​​of the horizontal coordinates to obtain two constrained rays; Between the two constraint rays, m rays are evenly arranged to obtain determination rays, and the angle between adjacent determination rays is θ; Acquire the number of intersections of the constraint ray, the determination ray and the constraint ray, and establish a corresponding relationship between the number of intersections of the constraint ray and the determination ray; Obtaining and comparing the numbers of intersections of adjacent determination rays, and obtaining adjacent determination rays with different numbers of intersections; Obtaining the determination ray having the number of adjacent intersection points, and obtaining the intersection points of the determination curve and the edge line of the printing and dyeing pattern to obtain the range intersection points; Connecting adjacent intersection points of the ranges to obtain a closed figure, where the closed figure is the judgment area; Obtaining the number of intersections on different determination rays in the determination area, if the number of intersections on the determination rays is different, the printing and dyeing patterns corresponding to the edge lines of the printing and dyeing patterns are not in a tangent or intersecting relationship; The position of the printing and dyeing pattern is determined to obtain the relative position relationship of the printing and dyeing pattern.

5. The artificial intelligence-based printing and dyeing quality detection method according to claim 1 is characterized in that: The method of acquiring the printing and dyeing patterns with overlapping relationships based on the relative positional relationship of the printing and dyeing patterns to obtain overlapping patterns includes: The relative position relationship of the printing and dyeing patterns is obtained by including, tangent to or intersecting the printing and dyeing patterns, so as to obtain patterns with an interactive relationship; Marking the edge lines of the printing and dyeing patterns in the patterns having an interactive relationship respectively to obtain the marked lines of the printing and dyeing patterns; Based on the marking lines of the printing and dyeing patterns, the patterns with interactive relationships are marked respectively to obtain overlapping patterns.

6. The artificial intelligence-based printing and dyeing quality detection method according to claim 1 is characterized in that: The step of respectively setting masks for all the printing and dyeing patterns in the overlapping pattern and performing finite element division on the masks to obtain a finite element image comprises: Acquire all the printing and dyeing patterns in the overlapping pattern, set masks for all the printing and dyeing patterns respectively, and obtain an image mask; acquire the length and width of the image mask; Based on the length and width of the image mask, the side length of the square grid during the finite element division is obtained. The equation for the side length of the square grid is: Wherein, l represents the side length of the square grid, a represents the length of the image mask, b represents the width of the image mask, and m represents the number of portions into which the width of the image mask is divided. represents the floor function, represents the ceiling function; Based on the side length of the square grid, the mask is divided into finite elements to obtain a finite element image.

7. The artificial intelligence-based printing and dyeing quality detection method according to claim 1 is characterized in that: The step of acquiring the defect position and defect area in the finite element image to obtain printing and dyeing defect information includes: Based on the printing and dyeing pattern, obtaining a defect type of the finite element image; Based on the printing and dyeing pattern, obtaining the defect position corresponding to the defect type; Based on the defect position, obtaining the position of the defect position in the finite element image; The area of ​​the defect position and the defect type are acquired to obtain the printing and dyeing defect information.

8. The artificial intelligence-based printing and dyeing quality detection method according to claim 7 is characterized in that: The acquiring the area of ​​the defect position and the defect type to obtain the defect information includes: Acquire edge lines of all the printing and dyeing patterns of the printing and dyeing pattern; Obtaining edge lines of all the printing and dyeing patterns and comparing them with edge lines of standard printing and dyeing patterns to obtain additional edge lines; The enclosed area of ​​the multiple edge lines is obtained, and the enclosed area is calculated based on the finite element image, and the equation of the enclosed area is: Among them, S r represents the enclosed area, p represents the number of complete square grids of the finite element image in the enclosed area, l represents the side length of the square grid, S ai represents the incomplete square grid area of ​​the finite element image in the enclosed area, i represents the index of the incomplete square grid, and j represents the total number of incomplete square grid indexes; Based on the enclosed area of ​​the multi-increase edge line and the defect type, the defect information is obtained, and the determination equation of the defect information is: Where T represents the type of defect, e is the horizontal / vertical index of all coordinates on the defect edge, f is the total horizontal / vertical index of all coordinates on the defect edge, g is the horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, h is the total horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, x is the total horizontal / vertical index of the horizontal / vertical coordinate of the printing and dyeing pattern, te is the horizontal coordinate on the defect edge, x Te is the horizontal coordinate of the printing and dyeing pattern, y te is the ordinate on the defect edge, y Te is the ordinate of the printing and dyeing pattern, D T Indicates defect information.

9. The method for detecting printing and dyeing quality based on artificial intelligence according to claim 1, characterized in that: The step of obtaining the image quality grade of the printed and dyed fabric based on the printing and dyeing defect information includes: Based on the defect information, obtaining a defect impact weight corresponding to the defect information; Determining an image quality value of the printed and dyed fabric based on the defect impact weight; The image quality grade of the printed and dyed fabric is obtained based on the image quality value of the printed and dyed fabric and a preset image quality value interval of the printed and dyed fabric.

10. The artificial intelligence-based printing and dyeing quality detection method according to claim 9, characterized in that: The step of determining the image quality value of the printed and dyed fabric based on the defect impact weight comprises: Based on the defect impact weight and the defect information, an image quality value of the overlapping pattern is obtained, and the image quality value equation of the overlapping pattern is: Among them, D Tc represents the defect information of the cth defect, Q s Indicates the image quality value of the mask where the defect is located, f c represents the impact weight of the cth defect, S rc represents the enclosed area corresponding to the cth defect, S represents the corresponding mask area, c represents the index of the printing and dyeing fabric defect, and d represents the total index of the printing and dyeing fabric defect; Based on the importance weights of all the overlapping patterns in the image of the printed fabric, the image quality value of the printed fabric is obtained. The image quality value equation of the printed fabric is: Among them, Q represents the image quality value of printed and dyed fabrics, Q su represents the image quality value of the mask where the u-th defect is located, u represents the index of the mask in the image of the printed and dyed fabric, v represents the total index of the mask in the image of the printed and dyed fabric, and Z u Represents the importance weight of overlapping patterns in the image of printed fabric.