A method for calculating similarity of colored spun fabric images

By using local and global feature representation methods in the similarity calculation of colored textile images, combined with feature-level fusion strategies, the problems of low efficiency and inconsistent evaluation results in the existing technology are solved, and efficient and objective similarity of colored textile images is achieved. Sexual measurement improves production efficiency and quality.

CN114863140BActive Publication Date: 2024-10-29WUHAN LIZHAOYUAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210192597.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-01
Publication Date
2024-10-29
Estimated Expiration
2042-03-01

AI Technical Summary

Technical Problem

The existing technology lacks a scientific and effective method for calculating the similarity of dyed fabric images, resulting in low production efficiency and difficulty in ensuring quality. Moreover, the existing evaluation indicators ignore the perceptual characteristics of the human eye, resulting in evaluation results that are inconsistent with subjective feelings, and the calculation is complex. And it takes a long time.

Method used

A method for calculating the similarity of color textile images is proposed. By characterizing multi-channel color images locally and globally, a similarity evaluation index system is constructed. The LBP feature, gray level co-occurrence matrix and gradient direction spectrum are used to calculate the feature vector. Combined with the features level fusion strategy to achieve objective and real-time similarity measurement.

Benefits of technology

It significantly improves the efficiency of sample production of color-spun products, improves the consistency between evaluation results and human eye perception, reduces the time complexity of the algorithm, and adapts to the market demand for small batches, multiple varieties, and fast delivery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114863140B_ABST
    Figure CN114863140B_ABST
Patent Text Reader

Abstract

The invention discloses a method for similarity of colored textile images, comprising: preparing colored textile samples and constructing a database of images to be tested; selecting two images to be tested, arranging three channels of each image into a variety of three-dimensional dot arrays in different ways, and projecting them into a spatial rectangular coordinate system; respectively calculating local binary pattern features of 3×3 neighborhoods of the center of each space dot array in the normal vector direction of an xy plane, a yz plane and an xz plane, and constructing a cross-channel LBP multidimensional feature map of the image; constructing a local feature vector of the image; calculating a gradient directional spectrum of three components of hue H, saturation S and lightness V; calculating the third-order moment feature of each gradient directional spectrum, and constructing a global feature vector of the image; normalizing the feature vector, and calculating the local feature difference and the global feature difference of the two images by using the vector Euclidean distance; performing weighted summation on the local feature difference and the global feature difference, and converting them into a percentage form to obtain the overall similarity of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of textile industry production and application, and particularly relates to a method for calculating the similarity of colored textile images. Background Art

[0002] Color-dyed fabrics are made by mixing dyed fibers of different color components according to different mass ratios to form colored spun yarns, and then spinning them. Color-dyed yarns can show a variety of colors on the same yarn. The fabrics produced by the color-spinning process are not only rich in color layers, but also have a hazy three-dimensional effect and a unique color mixing effect, which are deeply loved and sought after by market consumers. In the sample production process of color-spun fabrics, customers usually provide standard samples, and the factory is responsible for processing and producing with its own raw materials according to the corresponding quality, style, design, color, specification, quantity and other requirements. In the production process, due to the lack of scientific and effective similarity judgment methods, enterprises usually need to conduct repeated trial spinning and rely on manual visual comparison to determine whether the style and color of the sample and the standard sample are consistent. This overly complex and subjective judgment method significantly affects the efficiency of sample production of color-spun products and the quality of the products, and it is difficult to adapt to the current market demand for small batches, multiple varieties and fast delivery. Therefore, based on digital image processing technology, an objective and efficient similarity evaluation index system is established for the color-spun fabric images with complex texture background and color rendering effects. It can provide effective guidance for the sample production process of color-spun products, and has important theoretical research value and broad application prospects.

[0003] At present, many full-reference image quality evaluation indicators have been proposed at home and abroad to measure the image similarity, such as Peak Signal-to-Noise Ratio (PSNR), Structural Similarity (SSIM), etc. These evaluation indicators measure the similarity by calculating the statistical differences of corresponding pixels between the images to be tested. However, the perception mechanism of the human visual system (HVS) for images is based on the combination of macroscopic perception and detail perception of the image, and is not sensitive to the differences and offsets of pixels within a smaller range. Therefore, the above-mentioned evaluation indicators ignore the perceptual characteristics of the human eye, and in actual applications, the similarity evaluation results often do not match the subjective feelings.

[0004] In addition, in the process of high-resolution image comparison, there is a problem of data redundancy in the similarity comparison and judgment of pixel information. Not only is the calculation process complex and time-consuming, but the increase of interference information will also significantly affect the accuracy of the evaluation effect. Therefore, using different feature operators to characterize different characteristics of the image and extracting the corresponding feature vectors as the basis for judging the similarity between the images to be tested can not only effectively improve the efficiency of the calculation and reduce the time complexity of the algorithm, but also can compare the characteristics of the image from different angles (texture and color, local and global, spatial domain and frequency domain, etc.), so that the evaluation results are consistent with human eye perception. Thanks to the continuous development of computer vision and digital image processing technology, using different algorithms to characterize and analyze images has become a research hotspot in recent years and is widely used in image processing tasks such as retrieval, classification, and recognition.

[0005] It should be pointed out that in the above image processing tasks, in order to achieve a high retrieval classification accuracy or recognition rate, it is usually necessary to design a corresponding classifier (such as support vector machine, neural network, etc.) based on feature extraction and conduct large-scale training for specific sample data sets. Therefore, this type of method not only has high requirements for equipment configuration, but also cannot be applied to the discrimination of different samples in real time and flexibly.

[0006] At the same time, dyed fabrics use dyed fibers as the basic carrier of color. During the fiber mixing process, dyed fibers of different components will stack and aggregate on the surface of the yarn, and interweave with each other as the fabric structure changes, making the morphology and distribution of the color units random. Due to factors such as the hairiness on the surface of the fabric and the undulation of the yarn, the uneven distribution of dyed fibers of different colors in the dyed yarn, and the different interweaving structures of the yarn, the surface of the dyed fabric often has uneven light reflection and a large number of mixed transition colors. In the digital imaging process, it presents a complex and random appearance color style and texture details. For such dyed fabric images with complex content, a single feature is not enough to fully and effectively represent the relevant information in the image. Therefore, how to establish a multi-dimensional and multi-angle representation algorithm for dyed fabric images and judge their similarity through a simple and fast similarity measurement method has become the key and difficulty of optimizing the sample production process of dyed products. Summary of the invention

[0007] In view of the above status and problems, the present invention takes colored textile fabrics (including woven fabrics and knitted fabrics) as specific application objects and proposes a method for calculating the similarity of colored textile fabric images. The method characterizes and measures the similarity of multi-channel colored textile fabric color images from local and global perspectives, constructs a similarity evaluation index system, and can objectively, real-timely and effectively determine the similarity between the incoming sample and the test sample, thereby significantly improving the incoming sample production efficiency of colored textile products.

[0008] The purpose of the present invention is to solve the problem described in the background technology and to propose a method for calculating the similarity of colored woven fabric images.

[0009] The technical solution of the present invention is a method for calculating the similarity of colored spun fabrics, which specifically comprises the following steps:

[0010] Step 1, using dyed fibers of different colors to mix to form colored spun yarn, preparing colored spun fabric samples with different weaving methods, different color ratios, different tissue structures and other difference factors, and constructing a database of images to be tested;

[0011] Step 2, selecting two images to be tested from the database, arranging the R, G, and B channels of each image into a variety of three-dimensional dot matrices in different ways, and projecting them into a spatial rectangular coordinate system;

[0012] Step 3, respectively calculate the local binary pattern (LBP) features of the 3×3 neighborhood of each space lattice center in the normal vector direction of the xy plane, yz plane and xz plane in the spatial rectangular coordinate system, and construct a cross-channel LBP multi-dimensional feature map of the image;

[0013] Step 4: Treat each dimension of the feature map as a pseudo grayscale image, and use the Gray Level Co-occurrence Matrix (GLCM) to calculate its four spatial correlation characteristics (angular second-order moment, contrast, correlation, and entropy) in four directions (0°, 45°, 90°, and 135°) to construct the local feature vector of the image;

[0014] Step 5, convert the image to be tested obtained in step 2 into the HSV color space, and calculate the gradient direction spectra of its three components of hue H, saturation S, and lightness V respectively;

[0015] Step 6, calculate the third-order moment feature of each gradient direction spectrum and construct the global feature vector of the image;

[0016] Step 7, normalize the feature vectors of the two images obtained in step 4 and step 6 to [0, 1], and use the vector Euclidean distance to calculate the local feature difference and global feature difference of the two images respectively;

[0017] Step 8: Using the feature-level fusion strategy, perform weighted summation of local feature differences and global feature differences, convert them into percentage form, and obtain the overall similarity of the images.

[0018] It should be noted that in step 1, the samples prepared include woven fabrics and knitted fabrics obtained by different weaving methods. In the process of collecting sample images, it is necessary to shoot in exactly the same environmental conditions (such as environmental humidity, light source, shooting angle, field of view, etc.), and the parameters of the camera (such as lens focal length, aperture size, white balance, etc.) are all kept consistent.

[0019] It should be noted that in step 2, the R, G, and B channels of the image are arranged in different orders in space to form a variety of three-dimensional dot matrices. In the actual calculation process, only the dot matrices of the three arrangements of [R, G, B], [R, B, G], and [G, R, B] need to be calculated. Other arrangements can be obtained by the above three rotations, so there is no need to calculate.

[0020] It should be noted that in step 3, in the spatial rectangular coordinate system, the m×n local image area is represented as a 3×m×n cube in the dot matrix composed of three channels. In the process of calculating the features, it is necessary to traverse each pixel in the dot matrix and calculate the LBP features of its 3×3 neighborhood along the normal vector direction of the xy plane, yz plane and xz plane respectively to form a cross-channel LBP feature. The calculation method is shown in Equation 1 and Equation 2. In the formula, p represents the value of the pixel in the channel, p i represents the neighborhood value of the i-th point, N represents the number of neighborhood pixels, and x and y represent the horizontal and vertical coordinates of point p.

[0021]

[0022] in:

[0023]

[0024] After the calculation is completed, the cross-channel LBP features of the three dot matrices [R, G, B], [R, B, G], and [G, R, B] are combined into a multidimensional feature map for the next step of calculation.

[0025] It should be noted that in step 4, each dimension of the multi-bit feature map is regarded as a pseudo grayscale image, its grayscale co-occurrence matrix is ​​calculated, and its grayscale spatial characteristics (angular second-order moment, contrast, correlation, entropy) are extracted from four directions (0°, 45°, 90°, 135°) as the local feature vector of the image as a whole. The calculation method is shown in equations 3 to 6:

[0026]

[0027]

[0028]

[0029]

[0030] Among them, ASM represents the second-order angular moment, CON represents contrast, COR represents correlation, EBT represents entropy, G(i,j) represents the spatial position of the pixel value in the gray-level co-occurrence matrix, i and j are the index coordinates of the pixel point, k represents the gray level (usually 255), and the intermediate variable U i , U j , S i , S j The definitions of are shown in equations 7 to 8 respectively:

[0031]

[0032]

[0033]

[0034]

[0035] It should be noted that in step 5, the image to be tested needs to be converted from the RGB space to the HSV color space, and the gradient direction angle of each pixel point is calculated in the three component channels of hue H, saturation S, and lightness V to construct the gradient direction spectrum. The calculation method is shown in equations 11 to 13. In the equations, I represents the component channel of the image, x and y represent the horizontal and vertical coordinates of the pixel point respectively, and G h (x,y),G v (x, y) represents the horizontal gradient and vertical gradient at the pixel point respectively, and θ(x, y) represents the gradient direction angle at the pixel point.

[0036] θ(x,y)=arctan(G h (x,y) / G v (x,y)) Formula 11

[0037] in:

[0038] G h (x,y)=I(x+1,y)-I(x-1,y) Formula 12

[0039] G v (x,y)=I(x,y+1)-I(x,y-1) Formula 13

[0040] It should be noted that in step 6, the calculation method of the third-order moment characteristic of the gradient directional spectrum is shown in equations 14 and 15. In the equations, C1, C2, and C3 represent the third-order moment, P i,j Represents the value at the midpoint (i, j) of the gradient direction spectrum, and m and n represent the length and width of the gradient direction spectrum respectively.

[0041]

[0042]

[0043]

[0044] It should be noted that in step 7, in order to eliminate the impact of the dimension between the local features and the global features of the image on the results, all the obtained features are normalized to [0, 1] by using standard deviation, and their similarity is measured using Euclidean distance.

[0045] It should be noted that in step 8, the similarity measurement results of local features and global features are the results measured by feature operators of local and global properties in different color spaces, respectively, and there is ideal independence between the two. At the same time, the present invention adopts a feature-level fusion strategy to fuse the measurement results of the two features and convert them into a percentage form to obtain the overall similarity of the image. The fusion method is shown in Formula 17. In the formula, DIST Local 、DIST Global They represent the Euclidean distance between the normalized local feature component and the full-color feature component of the image, ω represents the feature weight, and SIM represents the overall similarity.

[0046] DIST total =ω×DIST Local +(1-ω)×DIST Global Formula 17

[0047] SIM=[1-DIST total ]×100% Formula 18

[0048] The present invention takes the similarity discrimination of colored textile fabrics as a specific application object, collects images of colored textile fabric samples under the same environmental conditions and shooting parameter settings, and constructs a database of sample images to be tested; for two images to be tested, the three channels of R, G and B are respectively combined into three three-dimensional dot matrices in the form of [R, G, B], [R, B, G] and [G, R, B], and projected into a spatial rectangular coordinate system; on this basis, the LBP features of the 3×3 neighborhood of the center of each spatial dot matrix in the normal vector direction of the xy plane, yz plane and xz plane in the spatial rectangular coordinate system are respectively calculated to construct a cross-channel LBP multidimensional feature map of the image; then, each dimension of the feature map is regarded as a pseudo grayscale image, and its respective grayscale co-occurrence matrix is ​​used to calculate The local feature vector of the image is constructed by using the angular second-order moment, contrast, correlation, and entropy eigenvalues ​​in the four directions of 0°, 45°, 90°, and 135°; in addition, the image to be tested is converted into the HSV color space, and the gradient direction spectra of the three components of its hue H, saturation S, and lightness V are calculated respectively; the global feature vector of the image is constructed by using the third-order moment features of each gradient direction spectrum; the feature vectors obtained from the two images are normalized, and the local feature differences and global feature differences of the two images are calculated respectively using the vector Euclidean distance, and they are fused and converted into percentage form using the feature-level fusion strategy, thereby realizing the quantitative analysis and evaluation of the similarity of color-spun fabric images, which has important guiding significance for the sample production process of color-spun products. Since the technical solution of the present invention has important application prospects and value, protecting the technical solution of the present invention will be of great significance for my country's related industries to compete for international leading positions. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 This is the technical flow chart.

[0050] Figure 2 These are some sample pictures of colored textile fabrics: (a) three-color plain woven fabric; (b) three-color twill woven fabric; (c) three-color satin woven fabric; (d) four-color plain woven fabric; (e) four-color twill woven fabric; (f) four-color satin woven fabric; (g) yellow and white mixed color knitted fabric; (h) red and white mixed color knitted fabric; (i) blue and white mixed color knitted fabric.

[0051] Figure 3 There are three types of spatial lattice arrangements.

[0052] Figure 4 It is a cross-channel 3×3 neighborhood partitioning method for the [R, G, B] matrix. DETAILED DESCRIPTION

[0053] When the technical solution of the present invention is specifically implemented, those skilled in the art can use relevant data and computer software technology to run. In conjunction with the accompanying drawings, a specific description of the embodiments of the present invention is provided as follows.

[0054] like Figure 1 As shown in the figure, the embodiment provides a method for calculating the similarity of color-spun fabrics, and establishes an objective quantitative analysis and evaluation model for the quality assessment of color-spun product customization in the textile industry, which can provide effective guidance for the sample production and processing of color-spun products. The embodiment uses color-spun fabric samples provided by enterprise A, covering two different weaving methods, woven fabrics and knitted fabrics, as well as fabrics obtained by mixing dyed fibers with different color matching schemes. Some sample images are shown in Figure 1. Figure 2 As shown. The algorithm computing equipment is Super Micro 7048GR-TR, Windows 10 operating system, Intel (R) Xeon (R) E5-2678V3*2CPU, 128G memory, NVIDIA Tesla M40*4 computing card; the algorithm development environment is MATLAB R2016a and Python3.6. It should be noted that the present invention is not limited to the application support of the above samples and software platforms, and is also applicable to any corresponding data and software platform that can implement the method of the present invention.

[0055] The embodiment mainly includes the following steps:

[0056] 1) Collect sample images and build a database of sample images to be tested

[0057] As shown above, 90 color-spun fabric samples are used in the embodiment, wherein all color-spun yarns are ring-spun. The samples cover different color schemes, different organizational structures and other difference factors. The prepared samples cover two fabrics obtained by different weaving methods, woven fabrics and knitted fabrics. In the woven fabric samples, the organizational structure types include classic plain, twill and satin structures, and are respectively mixed by three or four components of dyed fibers of different colors. According to the color scheme and organizational structure, the woven fabric samples are divided into 6 categories, which are respectively referred to as: three-color plain, three-color twill, three-color satin, four-color plain, four-color twill, and four-color satin. In the knitted fabric samples, the organizational structure type is a classic weft-knitted plain knitted fabric, which is prepared as color-spun yarn and woven by mixing two by two of the original white fiber and three primary color fibers (yellow, red, and blue). According to the color scheme, the knitted fabric samples are divided into 3 categories, which are respectively referred to as: yellow-white fabric, red-white fabric, and blue-white fabric. All samples (a total of 9 categories) need to be shot in exactly the same environmental conditions (such as environmental humidity, light source, shooting angle, field of view, etc.) during the image acquisition process, and the camera parameters (such as lens focal length, aperture size, white balance, etc.) are all kept consistent. After the acquisition is completed, all image data are preprocessed, cropped and scaled to a resolution of 1024×1024 in the same way to ensure that the image details are basically consistent. The input data of the method of the present invention is complete.

[0058] 2) Construct a three-dimensional dot matrix in the RGB space and project it into the spatial rectangular coordinate system

[0059] In the embodiment, only three dot matrices of [R, G, B], [R, B, G], and [G, R, B] need to be calculated, such as Figure 3 Other arrangements can be obtained by the above three rotations, so no calculation is required.

[0060] 3) Calculate the cross-channel LBP multi-dimensional feature map of the image to be tested

[0061] In the embodiment, when calculating the cross-channel LBP multi-dimensional feature map, it is necessary to traverse each pixel in the dot matrix and calculate the LBP features of its 3×3 neighborhood along the normal vector direction of the xy plane, yz plane and xz plane respectively. The cross-channel 3×3 neighborhood division method of the [R, G, B] dot matrix is ​​as follows: Figure 4 As shown, in Figure 4 In the spatial rectangular coordinate system, the 3×3 area of ​​the three channels of R, G, and B is located in the reverse direction along the y-axis. All the pixels from top to bottom and from left to right are named R1~R9, G1~G9, B1~B9. The three 3×3 areas on the right are the calculation areas of the cross-channel LBP features. The calculation method of the LBP feature is shown in Equation 1 and Equation 2. In the formula, p represents the value of the pixel in the channel, p i represents the neighborhood value of the i-th point, N represents the number of neighborhood pixels, and x and y represent the horizontal and vertical coordinates of point p.

[0062]

[0063] in:

[0064]

[0065] After the calculation is completed, the cross-channel LBP features of the three dot matrices [R, G, B], [R, B, G], and [G, R, B] are combined into a multidimensional feature map for the next step of calculation.

[0066] 4) Use the gray-level co-occurrence matrix to calculate the feature map and obtain the local feature vector of the image

[0067] In the embodiment, each dimension of the multi-bit feature map is regarded as a pseudo grayscale image, its grayscale co-occurrence matrix is ​​calculated, and its grayscale spatial characteristics (angular second-order moment ASM, contrast CON, correlation COR, entropy EBT) are extracted from four directions (0°, 45°, 90°, 135°) as the local feature vector of the image as a whole. The calculation method is shown in Formulas 3 to 6:

[0068]

[0069]

[0070]

[0071]

[0072] Among them, ASM represents the second-order angular moment, CON represents contrast, COR represents correlation, EBT represents entropy, G(i,j) represents the spatial position of the pixel value in the gray-level co-occurrence matrix, i and j are the index coordinates of the pixel point, k represents the gray level (usually 255), and the intermediate variable U i , U j , S i , S j The definitions of are shown in equations 7 to 8 respectively:

[0073]

[0074]

[0075]

[0076]

[0077] 5) Convert the image to be tested into HSV color space and calculate the gradient direction spectrum of its three components

[0078] In the embodiment, the image to be tested needs to be converted from the RGB space to the HSV color space, and the gradient direction angle of each pixel is calculated in the three component channels of hue H, saturation S, and lightness V to construct a gradient direction spectrum. The calculation method is shown in equations 11 to 13. In the equations, I represents the component channel of the image, x, y represent the horizontal and vertical coordinates of the pixel, respectively, and G h (x,y),G v (x, y) represents the horizontal gradient and vertical gradient at the pixel point respectively, and θ(x, y) represents the gradient direction angle at the pixel point.

[0079] θ(x,y)=arctan(G h (x,y) / G v (x,y)) Formula 11

[0080] in:

[0081] G h (x,y)=I(x+1,y)-I(x-1,y) Formula 12

[0082] G v (x,y)=I(x,y+1)-I(x,y-1) Formula 13

[0083] 6) Calculate the third-order moment characteristics of the gradient direction spectrum to obtain the global feature vector of the image

[0084] In the embodiment, the calculation method of the third-order moment characteristic of the gradient directional spectrum is shown in Formulas 14 and 15. In the formula, C1, C2, and C3 represent the third-order moment respectively, and P i,j Represents the value at the midpoint (i, j) of the gradient direction spectrum, and m and n represent the length and width of the gradient direction spectrum respectively.

[0085]

[0086]

[0087]

[0088] 6) Use Euclidean distance to measure the two features of the image and normalize them

[0089] In the embodiment, in order to eliminate the influence of the dimension between the local features and the global features of the image on the results, all the obtained features are normalized to [0, 1] by using standard deviation, and their similarity is measured by using Euclidean distance.

[0090] 7) Use the feature-level fusion strategy to fuse the measurement results of the two features to obtain the image similarity

[0091] In the embodiment, the similarity measurement results of local features and global features are the results measured by feature operators of local and global properties in different color spaces, respectively, and there is ideal independence between the two. At the same time, the present invention adopts a feature-level fusion strategy to fuse the measurement results of the two features and convert them into a percentage form to obtain the overall similarity of the image. The fusion method is shown in Formula 17. In the formula, DIST Local 、DIST Global They represent the Euclidean distance between the normalized local feature component and the full-color feature component of the image, ω represents the feature weight, and SIM represents the overall similarity.

[0092] DIST total =ω×DIST Local +(1-ω)×DIST Global Formula 17

[0093] SIM=[1-DIST total ]×100% Formula 18

[0094] In the fusion process, the weight values ​​of the measurement results of the two features are optimized. 42 images of each of the 9 types of color textile sample images are randomly selected as the optimization experimental sample set for weight optimization experiments. The experimental process is described as follows: DIST LocalThe weight ω is set to the range of [0,1], and the value is taken at an interval of 0.1 each time, and the analog discrimination of each type of sample is calculated in turn. Suppose there are two types of fabric samples A and B with different "clipped" effects, and the definition of their category separability is shown in Formula 19. In the formula, F A,B represents the average inter-class distance between fabric samples of type A and fabric samples of type B, F A and F B They represent the average intra-class distances of fabric samples of type A and type B, respectively. m and n represent the number of fabric samples of type A and type B, respectively. Respectively represent the number of pairwise combinations of type A and type B fabric samples.

[0095]

[0096] The average class separable ratio and its dispersion coefficient of the 9 types of samples under the corresponding weights are shown in Table 1. The parameter optimization results show that when the weight ω is 0.3, the average value of the class separable ratio between the 9 types of color-woven fabric samples reaches 20.16, which is better than the experimental group results under other weights. At the same time, the dispersion coefficient of the pairwise comparison results between all classes is 0.42, which is at a medium level during the optimization process, indicating that the ability of the similarity calculation method constructed by the present invention to distinguish these 9 types of samples under this weight is stable. Therefore, the present invention sets the weight ratio (ω: 1-ω) of the local and global feature components to 0.3:0.7.

[0097] Table 1 Average class separability ratio and dispersion coefficient of 9 types of samples

[0098]

[0099]

[0100] In order to prove the effectiveness and generalization of the method of the present invention, a comparative experiment is constructed using the similarity calculation method of the present invention and four commonly used image features (LBP, HOG, color histogram, color moment) and two image quality evaluation indicators (PSNR, SSIM). In the experiment, the PSNR, SSIM indicators and LBP features and HOG features are calculated in the grayscale channel of the image, and the color histogram and color moment features are calculated for the three components H, S, and V of the image (consistent with the present invention). The feature measurement method uniformly adopts the normalized Euclidean distance measure, and calculates the class separability ratio between various samples based on it. The comparative experimental results are shown in Table 2. The experimental results show that compared with the above evaluation indicators, the method of the present invention has better class discrimination.

[0101] Table 2 Comparative experimental results

[0102]

[0103] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.

Claims

1. A method for calculating the similarity of colored spun fabric images, characterized in that: The steps include: Step 1, using dyed fibers of different colors to mix to form colored spun yarn, preparing colored spun fabric samples with different weaving methods, different color ratios, and different organizational structure difference factors, and constructing a database of images to be tested; Step 2, selecting two images to be tested from the database, arranging the R, G, and B channels of each image into a variety of three-dimensional dot matrices in different ways, and projecting them into a spatial rectangular coordinate system; Step 3, respectively calculate the local binary pattern LBP features of the 3×3 neighborhood of each space lattice center in the normal vector direction of the xy plane, yz plane and xz plane in the spatial rectangular coordinate system, and construct a cross-channel LBP multi-dimensional feature map of the image; Step 4, each dimension of the feature map is regarded as a pseudo grayscale image, and the gray level co-occurrence matrix GLCM is used to calculate its four spatial correlation characteristics in four directions to construct the local feature vector of the image, where the four directions are 0°, 45°, 90° and 135°, and the four spatial correlation characteristics are angular second moment, contrast, correlation and entropy; Step 5, convert the image to be tested obtained in step 2 into the HSV color space, and calculate the gradient direction spectra of its three components of hue H, saturation S, and lightness V respectively; Step 6, calculate the third-order moment feature of each gradient direction spectrum and construct the global feature vector of the image; Step 7, normalize the feature vectors of the two images obtained in step 4 and step 6 to [0, 1], and use the vector Euclidean distance to calculate the local feature difference and global feature difference of the two images respectively; Step 8: Using the feature-level fusion strategy, perform weighted summation of local feature differences and global feature differences, convert them into percentage form, and obtain the overall similarity of the images.

2. A method for calculating similarity of colored spun fabric images as claimed in claim 1, characterized in that: In step 1, the prepared samples include woven fabrics and knitted fabrics obtained by different weaving methods. In the process of collecting sample images, it is necessary to shoot under exactly the same environmental conditions, and the parameters of the camera are kept consistent. The environmental conditions include ambient humidity, light source, shooting angle and field of view. The parameters of the camera include lens focal length, aperture size and white balance.

3. A method for calculating similarity of colored spun fabric images as claimed in claim 1, characterized in that: In step 2, the R, G, and B channels of the image are arranged in space in different orders and combined into a variety of three-dimensional dot matrices. In the actual calculation process, only the dot matrices of the three arrangements of [R, G, B], [R, B, G], and [G, R, B] need to be calculated. Other arrangements can be obtained by the above three rotations, so there is no need to calculate.

4. A method for calculating similarity of colored spun fabric images as claimed in claim 1, characterized in that: In step 3, in the spatial rectangular coordinate system, the m×n local area of ​​the image is represented as a 3×m×n cube in the dot matrix composed of three channels. In the process of calculating the features, it is necessary to traverse each pixel in the dot matrix and calculate the LBP features of its 3×3 neighborhood along the normal vector direction of the xy plane, yz plane and xz plane respectively to form a cross-channel LBP feature. The calculation method is shown in Formula 1 and Formula 2. In the formula, p represents the value of the pixel in the channel, p i represents the neighborhood value of the i-th point, N represents the number of neighborhood pixels, and x and y represent the horizontal and vertical coordinates of point p; in: After the calculation is completed, the cross-channel LBP features of the three dot matrices [R, G, B], [R, B, G], and [G, R, B] are combined into a multidimensional feature map for the next step of calculation.

5. The method for calculating the similarity of colored spun fabric images according to claim 1, characterized in that: In step 4, the calculation methods of the four spatial correlation characteristics are shown in equations 3 to 6: Among them, ASM represents the second-order angular moment, CON represents contrast, COR represents correlation, EBT represents entropy, G(i,j) represents the spatial position of the pixel value in the gray-level co-occurrence matrix, i and j are the pixel index coordinates, k represents the gray level, and the intermediate variable U i , U j , S i , S j The definitions of are shown in equations 7 to 8 respectively:

6. A method for calculating similarity of colored spun fabric images as claimed in claim 1, characterized in that: The calculation method for constructing the gradient direction spectrum in step 5 is shown in equations 11 to 13; θ(x,y)=arctan(G h (x,y) / G v (x,y)) Formula 11 in: G h (x,y) = I(x + 1,y) - I(x - 1,y), Equation XII G v (x,y) = I(x,y + 1) - I(x,y - 1), Equation XIII; Where I represents the component channel of the image, x and y represent the horizontal and vertical coordinates of the pixel points respectively, and G h (x,y),G v (x, y) represents the horizontal gradient and vertical gradient at the pixel point respectively, and θ(x, y) represents the gradient direction angle at the pixel point.

7. A method for calculating similarity of colored spun fabric images as claimed in claim 1, characterized in that: In step 6, the calculation method of the third-order moment characteristic of the gradient directional spectrum is shown in equations 14 to 15; In the formula, C1, C2, C3 represent the third-order moments, P i,j Represents the value at the midpoint (i, j) of the gradient direction spectrum, and m and n represent the length and width of the gradient direction spectrum respectively.

8. A method for calculating similarity of colored spun fabric images as claimed in claim 1, characterized in that: In step 7, in order to eliminate the impact of the dimension between the local features and the global features of the image on the results, all the obtained features are normalized to [0, 1] by using standard deviation, and their similarity is measured using Euclidean distance.

9. A method for calculating similarity of colored spun fabric images as claimed in claim 1, characterized in that: In step 8, the feature level fusion strategy is shown in formula 17; DIST total =ω×DIST Local +(1-ω)×DIST Global Formula 17 SIM=[1-DIST total ]×100% Formula 18 Where DIST Local 、DIST Global They represent the Euclidean distance between the normalized local feature component and the full-color feature component of the image, ω represents the feature weight, and SIM represents the overall similarity.

Citation Information

Patent Citations

  • Land surface state recognition algorithm based on the combination of HSV and LBP

    CN109446963A

  • Garment texture recognition and classification method based on LBP and GLCM

    CN109934287A