Fabric classification method and device based on color characteristics and storage medium
By printing color charts on fabrics and collecting color values using a spectrophotometer, a curve difference matrix is constructed for hierarchical clustering, solving the problem of low efficiency in fabric color management caused by traditional reliance on manual experience, and achieving efficient fabric classification and management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU WENSLI SILK DIGITAL PRINTING CO LTD
- Filing Date
- 2025-09-05
- Publication Date
- 2026-07-24
AI Technical Summary
Traditional processes rely on manual experience, which cannot effectively classify colors based on the color characteristics of the fabric after the reaction with ink. This results in low efficiency in fabric color management and cannot meet the needs of large-scale production.
By printing color charts on fabrics, collecting CIE Lab color values using a spectrophotometer, constructing ink curves for each color, calculating curve differences, building a symmetric difference matrix, and classifying the data using a hierarchical clustering algorithm.
It enables efficient classification based on fabric color characteristics, improves the efficiency of fabric color management, and ensures color consistency and accuracy.
Smart Images

Figure CN121167528B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more specifically, to a method, apparatus, and storage medium for classifying fabrics based on color characteristics. Background Technology
[0002] In the textile and apparel industry, the color characteristics of fabrics are a key factor affecting product appearance and quality. With the widespread adoption of digital printing technology, the diversity and complexity of fabric colors, as well as their interaction with inks, have significantly increased, placing higher demands on color management and classification. However, traditional processes still primarily rely on manual experience, classifying fabrics using indirect indicators such as weight, whiteness, and texture. These indicators cannot directly reflect the color characteristics of the fabric after reacting with ink, making it difficult to provide effective guidance for subsequent color management. Furthermore, manual identification is inefficient and inconsistent, failing to meet the demands of large-scale production for efficiency and market responsiveness.
[0003] There is currently no effective solution to the problem that relying on human experience in related technologies makes it impossible to classify fabrics based on the color characteristics of the fabric after the reaction between the fabric and the ink, resulting in low efficiency in fabric color management. Summary of the Invention
[0004] The main objective of this application is to provide a fabric classification method, apparatus, and storage medium based on color characteristics, in order to solve the problem in related technologies where relying on human experience makes it impossible to classify fabrics based on the color characteristics of the fabric after the reaction with ink, resulting in low efficiency in fabric color management.
[0005] To achieve the above objectives, according to one aspect of this application, a fabric classification method based on color characteristics is provided. The method includes: printing a color chart on each fabric to be classified, wherein the color chart consists of color samples of four colors of ink, each color sample of which includes M color samples of different concentrations, and the color chart includes 4*M color samples. The four colors of ink are magenta, cyan, yellow, and black. The color chart is used to obtain color characteristic data of each fabric to be classified; using a spectrophotometer to collect the CIE Lab color value of each color sample of the color chart on each fabric to be classified; constructing a curve corresponding to each color of ink on each fabric to be classified based on the CIE Lab color value of each color sample of the color chart on each fabric to be classified; calculating the curve difference degree between the curves corresponding to each color of ink between any two fabrics to be classified; obtaining the fabric difference value between any two fabrics to be classified based on the curve difference degree between the curves corresponding to each color of ink between any two fabrics to be classified; constructing a symmetric difference matrix based on the fabric difference value between any two fabrics to be classified; and using a hierarchical clustering algorithm, classifying the fabrics to be classified based on the symmetric difference matrix to obtain the classification result.
[0006] Furthermore, the spectrophotometer is an X-Rite i1Pro 3Plus spectrophotometer.
[0007] Furthermore, constructing the curve corresponding to each color ink on each fabric to be classified, based on the CIE Lab color value of each color sample of the color chart on each fabric to be classified, includes: classifying the CIE Lab color values of each color sample of the color chart on each fabric to be classified according to the color of the ink, obtaining the CIE Lab color values of M different concentration color samples of each color ink; obtaining M data points corresponding to each color ink on each fabric to be classified based on the CIE Lab color values of the M different concentration color samples of each color ink on each fabric to be classified; plotting the M data points corresponding to each color ink on each fabric to be classified in a three-dimensional coordinate system; and constructing the curve corresponding to each color ink on each fabric to be classified based on the M data points corresponding to each color ink on each fabric to be classified in the three-dimensional coordinate system.
[0008] Further, calculating the curve difference between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified includes: pairing the data points on the two curves corresponding to each color of ink between any two fabrics in the fabric to be classified to obtain multiple point pair combinations; calculating the three-dimensional Euclidean distance between the two data points of each point pair combination; and obtaining the curve difference between the two curves corresponding to each color of ink between any two fabrics in the fabric to be classified based on the three-dimensional Euclidean distance between the two data points of all point pair combinations on the two curves, wherein the curve difference is the cumulative sum of the three-dimensional Euclidean distances between the two data points of all point pair combinations on the two curves.
[0009] Furthermore, based on the curve difference between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified, the fabric difference value between any two fabrics in the fabric to be classified is obtained by: taking a weighted average of the curve difference between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified.
[0010] Furthermore, a hierarchical clustering algorithm is used to classify the fabrics to be classified based on the symmetric difference matrix. The classification results include: treating each fabric to be classified as a cluster; calculating the similarity between each pair of clusters based on the symmetric difference matrix, where the similarity between each pair of clusters is represented by the reciprocal of the inter-cluster distance; finding the two clusters with the highest similarity in the symmetric difference matrix and merging them into a new cluster; recalculating the similarity between the newly merged cluster and other clusters, updating the symmetric difference matrix, and obtaining the updated symmetric difference matrix; repeating the steps of finding the two clusters with the highest similarity in the updated symmetric difference matrix, merging the two clusters with the highest similarity into a new cluster, recalculating the similarity between the newly merged cluster and other clusters, updating the symmetric difference matrix, and obtaining the updated symmetric difference matrix, until a preset condition is met to obtain the target symmetric difference matrix; and classifying the fabrics in each cluster of the target symmetric difference matrix as a single fabric to obtain the classification result.
[0011] According to another aspect of this application, a fabric classification device based on color characteristics is provided. The device includes: a printing unit for printing a color chart on each fabric to be classified, wherein the color chart consists of color samples of four colors of ink, each color sample including M color samples of different concentrations, the color chart including 4*M color samples, and the four colors of ink being magenta, cyan, yellow, and black ink; the color chart is used to acquire color characteristic data of each fabric to be classified; an acquisition unit for acquiring the CIE Lab color value of each color sample of the color chart on each fabric to be classified using a spectrophotometer; and a first construction unit for constructing the CIE Lab color value of each color sample of the color chart on each fabric to be classified. The Lab color value is used to construct a curve corresponding to each color of ink on each fabric to be classified; the first calculation unit is used to calculate the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified; the second calculation unit is used to obtain the fabric difference value between any two fabrics to be classified based on the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified; the second construction unit is used to construct a symmetric difference matrix based on the fabric difference value between any two fabrics to be classified; the classification unit is used to classify the fabrics to be classified using a hierarchical clustering algorithm based on the symmetric difference matrix to obtain the classification result.
[0012] Furthermore, the spectrophotometer in the acquisition unit is an X-Rite i1Pro 3Plus spectrophotometer.
[0013] Further, the first building unit includes: a first classification module, used to classify the CIE Lab color values of each color sample of the color chart on each fabric to be classified according to the color of the ink, to obtain the CIE Lab color values of M different concentration color samples of each color ink; a first determination module, used to obtain M data points corresponding to each color ink on each fabric to be classified based on the CIE Lab color values of the M different concentration color samples of each color ink on each fabric to be classified; a drawing module, used to draw the M data points corresponding to each color ink on each fabric to be classified in a three-dimensional coordinate system; and a construction module, used to construct the curve corresponding to each color ink on each fabric to be classified based on the M data points corresponding to each color ink on each fabric to be classified in the three-dimensional coordinate system.
[0014] Further, the first calculation unit includes: a pairing module, used to pair data points on two curves corresponding to each color of ink between any two fabrics in the fabric to be classified, to obtain multiple point pair combinations; a first calculation module, used to calculate the three-dimensional Euclidean distance between the two data points of each point pair combination; and a second determination module, used to obtain the curve difference degree between the two curves corresponding to each color of ink between any two fabrics in the fabric to be classified based on the three-dimensional Euclidean distance between the two data points of all point pair combinations on the two curves.
[0015] Furthermore, the second calculation unit includes a second calculation module, which is used to perform a weighted average of the curve differences between the curves corresponding to each color of ink between any two fabrics to be classified, so as to obtain the fabric difference value between any two fabrics to be classified.
[0016] Further, the classification unit includes: a third determination module, used to classify each fabric to be classified as a cluster; a third calculation module, used to calculate the similarity between each pair of clusters based on the symmetric difference matrix, wherein the similarity between each pair of clusters is represented by the reciprocal of the inter-cluster distance; a first merging module, used to find the two clusters with the highest similarity in the symmetric difference matrix and merge the two clusters with the highest similarity into a new cluster; a fourth calculation module, used to recalculate the similarity between the newly merged cluster and other clusters, update the symmetric difference matrix, and obtain an updated symmetric difference matrix; a second merging module, used to repeatedly execute the steps of finding the two clusters with the highest similarity in the updated symmetric difference matrix, merging the two clusters with the highest similarity into a new cluster, recalculating the similarity between the newly merged cluster and other clusters, updating the symmetric difference matrix, and obtaining an updated symmetric difference matrix, until a preset condition is met to obtain the target symmetric difference matrix; and a second classification module, used to classify the fabrics in each cluster of the target symmetric difference matrix as a fabric, and obtain the classification result.
[0017] According to another aspect of this application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device where the computer-readable storage medium is located to perform the above-described fabric classification method based on color characteristics.
[0018] According to another aspect of this application, an electronic device is also provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the above-described fabric classification method based on color characteristics during runtime.
[0019] According to another aspect of this application, a computer program product is also provided, including computer instructions, characterized in that the computer instructions, when executed by a processor, implement the steps of the above-described fabric classification method based on color characteristics.
[0020] In this embodiment, a color chart is printed on each fabric to be classified. The color chart consists of color samples of four colors of ink, each color sample including M color samples of different concentrations. The color chart includes 4*M color samples. The four colors of ink are magenta, cyan, yellow, and black. The color chart is used to obtain the color characteristic data of each fabric to be classified. A spectrophotometer is used to collect the CIE Lab color value of each color sample on the color chart of each fabric to be classified. The CIE Lab color value of each color sample on the color chart of each fabric to be classified is then determined. Lab color values are used to construct curves corresponding to each color of ink on each fabric to be classified; the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified is calculated; based on the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified, the fabric difference value between any two fabrics to be classified is obtained; based on the fabric difference value between any two fabrics to be classified, a symmetric difference matrix is constructed; using a hierarchical clustering algorithm, based on the symmetric difference matrix, the fabrics to be classified are classified to obtain the classification results, thus solving the technical problem of low efficiency in fabric color management caused by relying on human experience to classify fabrics based on the color characteristics of fabrics after reacting with ink. In this application, by printing color plates on each fabric to be classified, the Lab values of different concentrations of color samples corresponding to the four colors of ink on each fabric to be classified are obtained. A curve corresponding to each color of ink on each fabric to be classified is constructed. Based on the similarity between the two curves corresponding to each color of ink on each fabric to be classified, the fabric difference value between any two fabrics can be calculated. A hierarchical clustering algorithm is used to classify the symmetric difference matrix constructed based on the fabric difference value to obtain the classification result, thereby achieving the technical effect of improving the classification efficiency of fabrics. Attached Figure Description
[0021] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0022] Figure 1 A hardware block diagram of a computer terminal for implementing a fabric classification method based on color characteristics is shown.
[0023] Figure 2This is a flowchart of an optional fabric classification method based on color characteristics according to an embodiment of this application;
[0024] Figure 3 This is a schematic diagram of an optional fabric sorting device based on color characteristics provided in an embodiment of this application;
[0025] Figure 4 A schematic diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] Example 1
[0029] According to an embodiment of this application, a method embodiment for classifying fabrics based on color characteristics is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0030] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a fabric classification method based on color characteristics is shown. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0031] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0032] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the fabric classification method based on color characteristics in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned fabric classification method based on color characteristics. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0033] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0034] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0035] Under the aforementioned operating environment, this application provides the following: Figure 2 The fabric classification method shown is based on color characteristics. Figure 2 This is a flowchart of a fabric classification method based on color characteristics according to Embodiment 1 of this application.
[0036] Step S201: Print a color label on each fabric to be classified. The color label consists of color samples of four colors of ink. Each color of ink includes M color samples of different concentrations. The color label includes 4*M color samples. The four colors of ink are magenta ink, cyan ink, yellow ink and black ink. The color label is used to obtain the color characteristic data of each fabric to be classified.
[0037] Optionally, the color chart printed on the fabric to be classified consists of a set of color samples of known colors, which can be displayed in the form of color blocks. In fabric classification, the color chart can not only be used to obtain color characteristic data for each type of fabric to be classified, but also, by printing it on the fabric, obtain the Lab values of different concentrations of the four colors of ink corresponding to each fabric to be classified. By printing the color chart on the fabric to be classified, color consistency and accuracy can be ensured under different equipment, materials, and environmental conditions.
[0038] Optionally, the color chart above consists of color samples of magenta, cyan, yellow, and black inks because these four colors are commonly used in the four-color printing (CMYK) model in the printing industry. Here, C represents cyan, M represents magenta, Y represents yellow, and K represents black. These four inks can be combined and mixed in different concentrations to produce a wide range of colors, satisfying most color requirements.
[0039] For example, if M=11, then there will be 11 color samples of each color ink with different concentrations, for a total of 44 color samples. These 44 color samples can be used to measure and compare the color characteristics of fabrics.
[0040] Step S202: Use a spectrophotometer to collect the CIE Lab color value of each color sample on the color chart of each fabric to be classified.
[0041] Optionally, the CIE Lab color values mentioned above include data in three dimensions: lightness (L), red-green axis (a), and yellow-blue axis (b). These can be used to capture the color characteristics of fabrics and serve as the basis for calculating color differences between fabrics in subsequent fabric classification steps.
[0042] For example, for a color sample of magenta ink of a certain concentration on a colorimeter, a spectrophotometer might measure a CIE Lab color value, such as L=50, a=30, b=0.
[0043] Step S203: Based on the CIE Lab color value of each color sample on the color chart of each fabric to be classified, construct the curve corresponding to each color ink on each fabric to be classified.
[0044] Optionally, the curve corresponding to each color of ink on each fabric to be classified refers to a curve composed of a series of data points (CIE Lab color values). Based on the collected CIE Lab color values, a curve is constructed for each color of ink, reflecting the color change of that color at different concentrations. The constructed curves allow for a direct comparison of the color change characteristics of the same color ink on different fabrics.
[0045] Step S204: Calculate the curve difference between the curves corresponding to each color of ink between any two fabrics to be classified.
[0046] Optionally, the similarity between the curves corresponding to each color of ink mentioned above refers to the degree of similarity between two color curves. The calculation of similarity helps to determine the color differences between fabrics and provides a basis for fabric classification.
[0047] For example, the curve difference between the two curves corresponding to the magenta ink on fabric A and fabric B is 0.9, which indicates that the color characteristics of the magenta ink on fabric A and fabric B are very similar.
[0048] Step S205: Based on the curve difference between the curves corresponding to each color of ink between any two fabrics in the fabrics to be classified, obtain the fabric difference value between any two fabrics in the fabrics to be classified.
[0049] Optionally, the fabric difference value mentioned above can represent the degree of difference in color characteristics between two fabrics to be classified. The smaller the calculated fabric difference value between any two fabrics, the more similar the color characteristics of the two fabrics are. The fabric difference value can provide a quantitative basis for the final classification of fabrics.
[0050] For example, the fabric difference value between fabric A and fabric B is 0.05, and the fabric difference value between fabric A and fabric C is 0.8, which indicates that fabric A and fabric B have more similar color characteristics.
[0051] Step S206: Construct a symmetrical difference matrix based on the fabric difference values between any two fabrics in the fabrics to be classified.
[0052] Optionally, the elements in the symmetric difference matrix above represent the difference values between any two fabrics. Each element in the symmetric difference matrix represents the fabric difference value between two fabrics, with the diagonal elements being 0 because they represent differences from themselves. These fabric difference values can be calculated based on the CIE Lab color values of the fabrics to be classified, reflecting the similarity in color characteristics between the two fabrics. The symmetric difference matrix is symmetric because the difference between two fabrics is independent of their order (i.e., the difference between fabric A and fabric B is the same as the difference between fabric B and fabric A). The purpose of constructing the symmetric difference matrix is to quantify and compare the similarity between fabrics during hierarchical clustering. Through this symmetric difference matrix, the algorithm can identify which fabrics are more similar in color characteristics, thus classifying them into the same category. For example, given three fabrics A, B, and C, the fabric difference value between fabric A and fabric B is calculated to be 0.8, the fabric difference value between fabric A and fabric C is 0.5, and the difference value between fabric B and fabric C is 0.9. The constructed symmetric difference matrix is shown below:
[0053]
[0054] Step S207: Using a hierarchical clustering algorithm based on a symmetric difference matrix, the fabrics to be classified are classified to obtain the classification results.
[0055] For example, based on the symmetric difference matrix constructed in step S206, a hierarchical clustering algorithm can be used to group fabric A and fabric C into one class, and fabric B into another class.
[0056] The fabric classification method based on color characteristics provided in this application involves printing a color chart on each fabric to be classified. The color chart consists of color samples of four colors of ink, each color sample including M color samples of different concentrations. The color chart includes 4*M color samples. The four colors of ink are magenta, cyan, yellow, and black. The color chart is used to acquire color characteristic data for each fabric to be classified. A spectrophotometer is used to collect the CIE Lab color value of each color sample on the color chart of each fabric to be classified. The CIE Lab color value is then determined based on the CIE Lab value of each color sample on the color chart of each fabric to be classified. Lab color values are used to construct curves corresponding to each color of ink on each fabric to be classified; the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified is calculated; based on the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified, the fabric difference value between any two fabrics to be classified is obtained; based on the fabric difference value between any two fabrics to be classified, a symmetric difference matrix is constructed; using a hierarchical clustering algorithm, based on the symmetric difference matrix, the fabrics to be classified are classified to obtain the classification results, thus solving the technical problem of low efficiency in fabric color management caused by relying on human experience to classify fabrics based on the color characteristics of fabrics after reacting with ink. In this application, by printing color plates on each fabric to be classified, the Lab values of different concentrations of color samples corresponding to the four colors of ink on each fabric to be classified are obtained. A curve corresponding to each color of ink on each fabric to be classified is constructed. Based on the similarity between the two curves corresponding to each color of ink on each fabric to be classified, the fabric difference value between any two fabrics can be calculated. A hierarchical clustering algorithm is used to classify the symmetric difference matrix constructed based on the fabric difference value to obtain the classification result, thereby achieving the technical effect of improving the classification efficiency of fabrics.
[0057] Optionally, in the fabric classification method based on color characteristics provided in the embodiments of this application, the spectrophotometer is an X-Rite i1Pro 3Plus spectrophotometer.
[0058] Optionally, the X-Rite i1Pro 3Plus can measure a wide color gamut, ensuring accurate capture even of highly saturated or uniquely colored fabrics. This device rapidly acquires color data, improving the efficiency of the fabric classification process. Through the precise measurements of the X-Rite i1Pro 3Plus, color differences between different fabrics can be reliably compared, providing accurate data support for fabric classification.
[0059] Optionally, in the fabric classification method based on color characteristics provided in this application embodiment, constructing the curve corresponding to each color ink on each fabric to be classified according to the CIE Lab color value of each color sample on the color chart of each fabric to be classified includes:
[0060] The first step is to classify the CIE Lab color values of each color sample on the color chart of each fabric to be classified according to the color of the ink, so as to obtain the CIE Lab color values of M color samples of different concentrations for each color of ink.
[0061] Optionally, the CIE Lab color values of the color samples on each color chart acquired from the spectrophotometer can be categorized according to the ink color. This allows for the analysis of the color characteristics of each ink color at different concentrations. By categorizing the inks by color, the CIE Lab color values of each ink color at different concentrations can be obtained separately, providing a data foundation for subsequent color curve construction.
[0062] The second step is to obtain M data points corresponding to each color of ink on each fabric to be classified, based on the CIE Lab color values of M different concentration color samples of each color ink on each fabric to be classified.
[0063] Optionally, based on the CIE Lab color values obtained in the first step, a data point is obtained for each ink color at each concentration level. These data points will be used to construct a color curve. Each data point represents the color characteristics of the ink at a specific concentration. M data points can form a complete color curve, reflecting the characteristics of ink color change with concentration.
[0064] For example, if there are 11 color samples of magenta ink on a fabric to be classified, then there will be 11 data points, and the coordinates of each point are (L,a,b), such as (50,30,10), (55,35,15), etc.
[0065] The third step is to plot M data points corresponding to each color of ink on each fabric to be classified in a three-dimensional coordinate system.
[0066] Optionally, in a three-dimensional coordinate system, with L as the x-axis, a as the y-axis, and b as the z-axis, each data point obtained in the second step can be plotted to form a curve.
[0067] The fourth step is to construct a curve corresponding to each color of ink on each fabric to be classified based on the M data points corresponding to each color of ink on each fabric to be classified in the three-dimensional coordinate system.
[0068] Optionally, by plotting M data points corresponding to each color of ink in a three-dimensional coordinate system, the color change trend of each color ink at different concentrations can be observed intuitively, providing a visual basis for fabric classification.
[0069] In summary, the above steps, by constructing curves corresponding to each color ink, can accurately analyze the color change characteristics of each fabric to be classified at different concentrations, providing detailed color data support for fabric classification.
[0070] Optionally, in the fabric classification method based on color characteristics provided in this application embodiment, calculating the curve difference degree between the curves corresponding to each color of ink between any two fabrics to be classified includes:
[0071] The first step is to pair up the data points on the two curves corresponding to each color of ink between any two fabrics to be classified, and obtain multiple point pair combinations.
[0072] Optionally, for any two fabrics, the data points on the two curves corresponding to each color of ink can be paired up according to the concentration steps to ensure that the color characteristics under the same concentration are being compared.
[0073] For example, the magenta ink curves on fabric A and fabric B have data points (L1, a1, b1) and (L2, a2, b2) respectively, which can be paired into point pairs (P1, Q1), where P1 = (L1, a1, b1) and Q2 = (L2, a2, b2).
[0074] The second step is to calculate the three-dimensional Euclidean distance between the two data points in each point pair combination.
[0075] Optionally, the three-dimensional Euclidean distance is the straight-line distance between two points in three-dimensional space. The distance between each pair of paired data points can be calculated using the formula for the distance between two points in three-dimensional space.
[0076] For example, to calculate the three-dimensional Euclidean distance between two data points in the pair (P1, Q1), which is equivalent to calculating the three-dimensional Euclidean distance between data points (L1, a1, b1) and (L2, a2, b2), the formula is:
[0077]
[0078] The third step is to obtain the curve difference degree between the two curves corresponding to each color of ink between any two fabrics in the fabric to be classified, based on the three-dimensional Euclidean distance between the two data points of each point pair combination. The curve difference degree is the cumulative sum of the three-dimensional Euclidean distances between the two data points of all point pairs combinations on the two curves.
[0079] For example, calculate the curve difference between the two curves corresponding to magenta ink on fabrics A and B. If the CIE Lab color values of the magenta ink on fabrics A and B at 11 density levels are:
[0080] Fabric A: (L A1 a A1 b A1 ), (L A2 a A2 b A2 )…(L A11 a A11 b A11 )
[0081] Fabric B: (L B1 a B1 b B1 ), (L B2 a B2 b B2 )…(L B11 a B11 b B11 )
[0082] For each pair of paired data points, calculate the three-dimensional Euclidean distance between them:
[0083]
[0084] The sum of the three-dimensional Euclidean distances between the two data points of all pairs of points on the curves corresponding to the two magenta inks is the curve difference degree between the two curves. The curve difference degree between the two curves corresponding to the magenta inks of fabric A and fabric B can assess the difference in color characteristics of the magenta inks on fabrics A and B. The smaller the curve difference degree, the more similar the two curves are, that is, the closer the color characteristics of the magenta inks on the two fabrics are.
[0085] In summary, by calculating the curve difference between the two curves corresponding to each color of ink between any two fabrics to be classified, the color characteristic difference of a specific color of ink on the two fabrics can be obtained. The smaller the curve difference, the closer the color characteristics of the specific color ink on the two fabrics are.
[0086] Optionally, in the fabric classification method based on color characteristics provided in this application embodiment, obtaining the fabric difference value between any two fabrics in the fabric to be classified according to the curve difference degree between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified includes: taking a weighted average of the curve difference degree between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified to obtain the fabric difference value between any two fabrics in the fabric to be classified.
[0087] Optionally, the fabric difference value mentioned above is determined by comprehensively analyzing the differences in the color characteristics of the four colors of ink (magenta, cyan, yellow, and black) on the two fabrics, resulting in an overall difference in color characteristics between the two fabrics. This value reflects the degree of similarity or difference in the color performance of the fabrics and can serve as an important basis for fabric classification and quality control. The smaller the fabric difference value, the closer the color characteristics of the two fabrics are.
[0088] For example, the calculated curve difference between fabric A and fabric B corresponding to magenta ink is 0.8, cyan ink is 0.7, yellow ink is 0.9, and black ink is 0.2. The weights for the curve differences corresponding to magenta ink are 0.5, cyan ink is 0.7, magenta ink is 0.1, and black ink is 0.5. The weighted average of the curve differences for each ink color between fabric A and fabric B is (0.8*0.5 + 0.7*0.7 + 0.9*0.1 + 0.2*0.5) / 4 = 0.27. In other words, the fabric difference value between fabric A and fabric B can be calculated as 0.27.
[0089] Optionally, in the fabric classification method based on color characteristics provided in this application embodiment, a hierarchical clustering algorithm is used to classify the fabrics to be classified based on a symmetric difference matrix, and the classification results include:
[0090] The first step is to group each fabric to be classified into a cluster;
[0091] The second step is to calculate the similarity between each pair of clusters based on the symmetric difference matrix, where the similarity between each pair of clusters is represented by the reciprocal of the inter-cluster distance;
[0092] The third step is to find the two clusters with the highest similarity in the symmetric difference matrix and merge the two clusters with the highest similarity into a new cluster;
[0093] The fourth step is to recalculate the similarity between the newly merged cluster and other clusters, update the symmetric difference matrix, and obtain the updated symmetric difference matrix.
[0094] The fifth step is to repeatedly perform the steps of finding the two clusters with the highest similarity in the updated symmetric difference matrix, merging the two clusters with the highest similarity into a new cluster, recalculating the similarity between the newly merged cluster and other clusters, updating the symmetric difference matrix, and obtaining the updated symmetric difference matrix, until the preset conditions are met and the target symmetric difference matrix is obtained.
[0095] The sixth step is to classify the fabrics in each cluster of the target symmetric difference matrix as a single fabric category to obtain the classification results.
[0096] For example, the calculated fabric difference values are: A and B = 0.27, A and C = 0.05, A and D = 0.31, B and C = 0.7, B and D = 0.28, and C and D = 0.09. A symmetric difference matrix is then constructed.
[0097]
[0098] Step 1: Initialize the cluster.
[0099] Treat each fabric to be classified as a separate cluster: {A}, {B}, {C}, {D}.
[0100] Step 2: Calculate the similarity, which is the reciprocal of the difference values. Therefore, we need to calculate the reciprocal of the difference values to obtain the similarity matrix.
[0101]
[0102] Step 3: Merge the most similar clusters. Find the two clusters with the highest similarity and merge them. In this example, fabric A and fabric D have the highest similarity (1 / 0.31), so they are merged into a new cluster: {A,D}.
[0103] Step 4: Update the symmetric difference matrix. Recalculate the similarity between the newly merged clusters and other clusters, and update the symmetric difference matrix. For example, calculate the similarity between {A,D} and {B}, and take the minimum of the similarities between A and B and D and B, i.e., min(1 / 0.27,1 / 0.28) = 1 / 0.28. The updated symmetric difference matrix is as follows:
[0104]
[0105] Step 5: Repeat the merging process. Continue to find the two clusters with the highest similarity and merge them until the preset condition is met. In this example, continue merging {B} and {C} because they have the highest similarity (1 / 0.7). The updated symmetric difference matrix is as follows:
[0106]
[0107] Step 6: Determine the classification results. Based on the final symmetric difference matrix, classify the fabrics in each cluster as a single fabric. The final classification results are: {A,D} and {B,C}.
[0108] In summary, based on the examples above, fabrics A and D are grouped into one category, while fabrics B and C are grouped into another. This classification method helps to quickly identify fabrics with similar color characteristics, thereby improving production efficiency and product quality.
[0109] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0110] Example 2
[0111] This application also provides a fabric classification device based on color characteristics. It should be noted that the fabric classification device based on color characteristics in this application can be used to execute the fabric classification method based on color characteristics provided in this application. The following describes the fabric classification device based on color characteristics provided in this application.
[0112] According to an embodiment of this application, an apparatus for implementing the above-described fabric classification method based on color characteristics is also provided, such as... Figure 3 As shown, the device includes:
[0113] Printing unit 301 is used to print color plates on each fabric to be classified. The color plates are composed of color samples of four colors of ink. Each color sample of ink includes M color samples of different concentrations. The color plates include 4*M color samples. The four colors of ink are magenta ink, cyan ink, yellow ink and black ink. The color plates are used to obtain color characteristic data of each fabric to be classified.
[0114] The acquisition unit 302 is used to acquire the CIE Lab color value of each color sample on the color chart of each fabric to be classified using a spectrophotometer;
[0115] The first building unit 303 is used to build a curve corresponding to each color of ink on each fabric to be classified based on the CIELab color value of each color sample of the color plate on each fabric to be classified.
[0116] The first calculation unit 304 is used to calculate the curve difference between the curves corresponding to each color of ink between any two fabrics in the fabrics to be classified.
[0117] The second calculation unit 305 is used to obtain the fabric difference value between any two fabrics to be classified based on the curve difference degree between the curves corresponding to each color of ink between any two fabrics to be classified.
[0118] The second construction unit 306 is used to construct a symmetric difference matrix based on the fabric difference value between any two fabrics in the fabrics to be classified.
[0119] Classification unit 307 is used to classify the fabrics to be classified using a hierarchical clustering algorithm based on a symmetric difference matrix, and obtain the classification results.
[0120] This application provides an apparatus for classifying fabrics based on color characteristics. The apparatus includes: a printing unit 301 for printing a color chart on each fabric to be classified, wherein the color chart consists of color samples of four colors of ink, each color sample including M color samples of different concentrations, and the color chart including 4*M color samples; the four colors of ink being magenta, cyan, yellow, and black ink; the color chart being used to acquire color characteristic data of each fabric to be classified; an acquisition unit 302 for acquiring the CIE Lab color value of each color sample of the color chart on each fabric to be classified using a spectrophotometer; and a first construction unit 303 for constructing the first color sample of the color chart on each fabric to be classified based on the CIE Lab color value of each color sample. The Lab color value is used to construct the curve corresponding to each color of ink on each fabric to be classified; the first calculation unit 304 is used to calculate the curve difference degree between the curves corresponding to each color of ink between any two fabrics to be classified; the second calculation unit 305 is used to obtain the fabric difference value between any two fabrics to be classified based on the curve difference degree between the curves corresponding to each color of ink between any two fabrics to be classified; the second construction unit 306 is used to construct a symmetric difference matrix based on the fabric difference value between any two fabrics to be classified; the classification unit 307 is used to classify the fabrics to be classified using a hierarchical clustering algorithm based on the symmetric difference matrix, and obtain the classification result. This solves the problem that relying on human experience cannot classify fabrics based on the color characteristics of the fabric after the reaction with ink, resulting in low efficiency of fabric color management, and thus achieves the technical effect of improving the classification efficiency of fabrics.
[0121] Optionally, in the fabric classification device based on color characteristics provided in the embodiments of this application, the spectrophotometer in the acquisition unit 302 is an X-Rite i1Pro 3Plus spectrophotometer.
[0122] Optionally, in the fabric classification device based on color characteristics provided in this application embodiment, the first construction unit 303 includes: a first classification module, used to classify the CIE Lab color values of each color sample of the color label on each fabric to be classified according to the color of the ink, to obtain the CIE Lab color values of M different concentration color samples of each color ink; a first determination module, used to obtain M data points corresponding to each color ink on each fabric to be classified based on the CIE Lab color values of the M different concentration color samples of each color ink on each fabric to be classified; a drawing module, used to draw the M data points corresponding to each color ink on each fabric to be classified in a three-dimensional coordinate system; and a construction module, used to construct the curve corresponding to each color ink on each fabric to be classified based on the M data points corresponding to each color ink on each fabric to be classified in the three-dimensional coordinate system.
[0123] Optionally, in the fabric classification device based on color characteristics provided in this application embodiment, the first calculation unit 304 includes: a pairing module, used to pair data points on two curves corresponding to each color of ink between any two fabrics in the fabric to be classified, to obtain multiple point pair combinations; a first calculation module, used to calculate the three-dimensional Euclidean distance between the two data points of each point pair combination; and a second determination module, used to obtain the curve difference degree between the two curves corresponding to each color of ink between any two fabrics in the fabric to be classified based on the three-dimensional Euclidean distance between the two data points of all point pair combinations on the two curves, wherein the curve difference degree is the cumulative sum of the three-dimensional Euclidean distances between the two data points of all point pair combinations on the two curves.
[0124] Optionally, in the fabric classification device based on color characteristics provided in this application embodiment, the second calculation unit 305 includes: a second calculation module, used to perform a weighted average of the curve difference degree between the curves corresponding to each color of ink between any two fabrics to be classified, to obtain the fabric difference value between any two fabrics to be classified.
[0125] Optionally, in the fabric classification device based on color characteristics provided in this application embodiment, the classification unit 307 includes: a third determining module, used to classify each fabric to be classified as a cluster; a third calculation module, used to calculate the similarity between each pair of clusters according to the symmetric difference matrix, wherein the similarity between each pair of clusters is represented by the reciprocal of the inter-cluster distance; a first merging module, used to find the two clusters with the highest similarity in the symmetric difference matrix and merge the two clusters with the highest similarity into a new cluster; a fourth calculation module, used to recalculate the similarity between the newly merged cluster and other clusters, update the symmetric difference matrix, and obtain an updated symmetric difference matrix; a second merging module, used to repeatedly execute the steps of finding the two clusters with the highest similarity in the updated symmetric difference matrix, merging the two clusters with the highest similarity into a new cluster, recalculating the similarity between the newly merged cluster and other clusters, updating the symmetric difference matrix, and obtaining an updated symmetric difference matrix, until a preset condition is met to obtain a target symmetric difference matrix; and a second classification module, used to classify the fabrics in each cluster of the target symmetric difference matrix as a fabric, and obtain a classification result.
[0126] It should be noted that the printing unit 301, acquisition unit 302, first construction unit 303, first calculation unit 304, second calculation unit 305, second construction unit 306, and classification unit 307 mentioned above correspond to steps S201 to S207 in Embodiment 1. The seven units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of the device and run in the computer terminal 10 provided in Embodiment 1.
[0127] Example 3
[0128] Embodiments of this application may provide a computer terminal, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or an electronic device, etc.
[0129] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0130] In this embodiment, the aforementioned computer terminal can execute program code for the following steps in the fabric classification method based on color characteristics: printing a color chart on each fabric to be classified, wherein the color chart consists of color samples of four colors of ink, each color sample of ink including M color samples of different concentrations, the color chart including 4*M color samples, the four colors of ink being magenta ink, cyan ink, yellow ink, and black ink, the color chart being used to acquire color characteristic data of each fabric to be classified; using a spectrophotometer to collect the CIE Lab color value of each color sample of the color chart on each fabric to be classified; and according to the CIE Lab value of each color sample of the color chart on each fabric to be classified... Lab color values are used to construct curves corresponding to each color of ink on each fabric to be classified; the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified is calculated; based on the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified, the fabric difference value between any two fabrics to be classified is obtained; based on the fabric difference value between any two fabrics to be classified, a symmetric difference matrix is constructed; using a hierarchical clustering algorithm, based on the symmetric difference matrix, the fabrics to be classified are classified to obtain the classification results.
[0131] Optionally, the computer terminal described above can execute program code for the following steps in the fabric classification method based on color characteristics: the spectrophotometer is an X-Rite i1Pro 3Plus spectrophotometer.
[0132] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the fabric classification method based on color characteristics: Constructing a curve corresponding to each color ink on each fabric to be classified based on the CIE Lab color value of each color sample of the color chart on each fabric to be classified includes: classifying the CIE Lab color values of each color sample of the color chart on each fabric to be classified according to the ink color, obtaining M different concentration CIE Lab color values of each color ink; obtaining M data points corresponding to each color ink on each fabric to be classified based on the CIE Lab color values of the M different concentration color samples of each color ink on each fabric to be classified; plotting the M data points corresponding to each color ink on each fabric to be classified in a three-dimensional coordinate system; and constructing a curve corresponding to each color ink on each fabric to be classified based on the M data points corresponding to each color ink on each fabric to be classified in the three-dimensional coordinate system.
[0133] Optionally, the aforementioned computer terminal can execute program code for the following steps in the fabric classification method based on color characteristics: calculating the curve difference degree between the curves corresponding to each color of ink between any two fabrics to be classified includes: pairing data points on the two curves corresponding to each color of ink between any two fabrics to be classified to obtain multiple point pair combinations; calculating the three-dimensional Euclidean distance between the two data points of each point pair combination; and obtaining the curve difference degree between the two curves corresponding to each color of ink between any two fabrics to be classified based on the three-dimensional Euclidean distance between the two data points of each point pair combination, wherein the curve difference degree is the cumulative sum of the three-dimensional Euclidean distances between the two data points of all point pair combinations on the two curves.
[0134] Optionally, the computer terminal described above can execute program code for the following steps in the fabric classification method based on color characteristics: obtaining the fabric difference value between any two fabrics in the fabric to be classified based on the curve difference degree between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified, including: taking a weighted average of the curve difference degree between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified to obtain the fabric difference value between any two fabrics in the fabric to be classified.
[0135] Optionally, the aforementioned computer terminal can execute the following steps in the fabric classification method based on color characteristics: using a hierarchical clustering algorithm, based on a symmetric difference matrix, to classify the fabrics to be classified, obtaining the classification results including: treating each fabric to be classified as a cluster; calculating the similarity between each pair of clusters according to the symmetric difference matrix, where the similarity between each pair of clusters is represented by the reciprocal of the inter-cluster distance; finding the two clusters with the highest similarity in the symmetric difference matrix and merging the two clusters with the highest similarity into a new cluster; recalculating the similarity between the newly merged cluster and other clusters, updating the symmetric difference matrix, and obtaining the updated symmetric difference matrix; repeating the steps of finding the two clusters with the highest similarity in the updated symmetric difference matrix, merging the two clusters with the highest similarity into a new cluster, recalculating the similarity between the newly merged cluster and other clusters, updating the symmetric difference matrix, and obtaining the updated symmetric difference matrix, until a preset condition is met to obtain the target symmetric difference matrix; classifying the fabrics in each cluster of the target symmetric difference matrix as a fabric, and obtaining the classification results.
[0136] Optionally, Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4Only one of the following is shown: processor 402, memory 404, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0137] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the color-characteristic-based fabric classification method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned color-characteristic-based fabric classification method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0138] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the fabric classification method based on color characteristics.
[0139] This application provides a scheme for fabric classification based on color characteristics. A color chart is printed on each fabric to be classified. The color chart consists of color samples of four colors of ink, each color sample including M color samples of different concentrations. The color chart includes 4*M color samples. The four colors of ink are magenta, cyan, yellow, and black. The color chart is used to acquire color characteristic data for each fabric to be classified. A spectrophotometer is used to collect the CIE Lab color value of each color sample on the color chart of each fabric to be classified. The CIE Lab color value of each color sample on the color chart of each fabric to be classified is then determined. Lab color values are used to construct curves corresponding to each color of ink on each fabric to be classified; the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified is calculated; based on the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified, the fabric difference value between any two fabrics to be classified is obtained; based on the fabric difference value between any two fabrics to be classified, a symmetric difference matrix is constructed; using a hierarchical clustering algorithm, based on the symmetric difference matrix, the fabrics to be classified are classified to obtain the classification results. This solves the problem that relying on human experience cannot classify fabrics based on the color characteristics of the fabric after the reaction with ink, resulting in low efficiency in fabric color management, thus achieving the technical effect of improving the classification efficiency of fabrics.
[0140] Those skilled in the art will understand that Figure 4 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices). Figure 4 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 4 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 4 The different configurations shown.
[0141] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0142] Example 4
[0143] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the fabric classification method based on color characteristics provided in Embodiment 1.
[0144] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0145] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: printing a color chart on each fabric to be classified, wherein the color chart consists of color samples of four colors of ink, each color sample of ink including M color samples of different concentrations, the color chart including 4*M color samples, the four colors of ink being magenta ink, cyan ink, yellow ink, and black ink, the color chart being used to acquire color characteristic data of each fabric to be classified; using a spectrophotometer to acquire the CIE Lab color value of each color sample of the color chart on each fabric to be classified; and according to the CIE Lab value of each color sample of the color chart on each fabric to be classified... Lab color values are used to construct curves corresponding to each color of ink on each fabric to be classified; the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified is calculated; based on the curve difference degree between the curves corresponding to each color of ink on any two fabrics to be classified, the fabric difference value between any two fabrics to be classified is obtained; based on the fabric difference value between any two fabrics to be classified, a symmetric difference matrix is constructed; using a hierarchical clustering algorithm, based on the symmetric difference matrix, the fabrics to be classified are classified to obtain the classification results.
[0146] Optionally, the storage medium is also configured to store program code for performing the following steps: the spectrophotometer is an X-Rite i1Pro 3Plus spectrophotometer.
[0147] Optionally, the storage medium is also configured to store program code for performing the following steps: constructing a curve corresponding to each color ink on each fabric to be classified based on the CIE Lab color value of each color sample of the color chart on each fabric to be classified, including: classifying the CIE Lab color values of each color sample of the color chart on each fabric to be classified according to the color of the ink, obtaining the CIE Lab color values of M different concentration color samples of each color ink; obtaining M data points corresponding to each color ink on each fabric to be classified based on the CIE Lab color values of the M different concentration color samples of each color ink on each fabric to be classified; plotting the M data points corresponding to each color ink on each fabric to be classified in a three-dimensional coordinate system; and constructing a curve corresponding to each color ink on each fabric to be classified based on the M data points corresponding to each color ink on each fabric to be classified in the three-dimensional coordinate system.
[0148] Optionally, the storage medium is also configured to store program code for performing the following steps: calculating the curve difference between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified, including: pairing data points on the two curves corresponding to each color of ink between any two fabrics in the fabric to be classified to obtain multiple point pair combinations; calculating the three-dimensional Euclidean distance between the two data points of each point pair combination; and obtaining the curve difference between the two curves corresponding to each color of ink between any two fabrics in the fabric to be classified based on the three-dimensional Euclidean distance between the two data points of all point pair combinations on the two curves, wherein the curve difference is the cumulative sum of the three-dimensional Euclidean distances between the two data points of all point pair combinations on the two curves.
[0149] Optionally, the storage medium is also configured to store program code for performing the following steps: obtaining the fabric difference value between any two fabrics in the fabric to be classified based on the curve difference degree between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified, including: taking a weighted average of the curve difference degree between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified to obtain the fabric difference value between any two fabrics in the fabric to be classified.
[0150] Optionally, the storage medium is also configured to store program code for performing the following steps: using a hierarchical clustering algorithm, based on a symmetric difference matrix, to classify the fabrics to be classified, obtaining the classification results including: treating each fabric to be classified as a cluster; calculating the similarity between each pair of clusters according to the symmetric difference matrix, where the similarity between each pair of clusters is represented by the reciprocal of the inter-cluster distance; finding the two clusters with the highest similarity in the symmetric difference matrix and merging the two clusters with the highest similarity into a new cluster; recalculating the similarity between the newly merged cluster and other clusters, updating the symmetric difference matrix, and obtaining an updated symmetric difference matrix; repeating the steps of finding the two clusters with the highest similarity in the updated symmetric difference matrix, merging the two clusters with the highest similarity into a new cluster, recalculating the similarity between the newly merged cluster and other clusters, updating the symmetric difference matrix, and obtaining an updated symmetric difference matrix, until a preset condition is met to obtain a target symmetric difference matrix; classifying the fabrics in each cluster of the target symmetric difference matrix as a fabric, and obtaining the classification results.
[0151] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing steps of a fabric classification method based on color characteristics.
[0152] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0153] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0154] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0155] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0156] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0157] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0158] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A fabric classification method based on color characteristics, characterized in that, include: A color chart is printed on each fabric to be classified. The color chart consists of color samples of four colors of ink. Each color sample of ink includes M color samples of different concentrations. The color chart includes 4*M color samples. The four colors of ink are magenta ink, cyan ink, yellow ink and black ink. The color chart is used to obtain the color characteristic data of each fabric to be classified. The CIE Lab color value of each color sample on the color chart of each fabric to be classified was acquired using a spectrophotometer; Based on the CIE Lab color value of each color sample on the color chart on each fabric to be classified, construct the curve corresponding to each color ink on each fabric to be classified; Calculate the curve difference between the curves corresponding to each color of ink between any two fabrics in the fabrics to be classified; The fabric difference value between any two fabrics is obtained based on the curve difference between the curves corresponding to each color of ink between any two fabrics in the fabrics to be classified. Construct a symmetric difference matrix based on the fabric difference values between any two fabrics in the fabrics to be classified. Using a hierarchical clustering algorithm, the fabric to be classified is classified based on the symmetric difference matrix to obtain the classification result.
2. The method according to claim 1, characterized in that, The spectrophotometer is an X-Rite i1Pro 3Plus spectrophotometer.
3. The method according to claim 1, characterized in that, Based on the CIE Lab color value of each color sample on the color chart for each fabric to be classified, the curve corresponding to each color ink on each fabric to be classified is constructed as follows: The CIE Lab color values of each color sample on the color chart of each fabric to be classified are classified according to the color of the ink, so as to obtain the CIE Lab color values of M color samples of different concentrations of each color ink. Based on the CIE Lab color values of M different concentration color samples of each color ink on each fabric to be classified, M data points corresponding to each color ink on each fabric to be classified are obtained. Plot M data points corresponding to each color of ink on each fabric to be classified in a three-dimensional coordinate system; Based on M data points corresponding to each color of ink on each fabric to be classified in the three-dimensional coordinate system, a curve corresponding to each color of ink on each fabric to be classified is constructed.
4. The method according to claim 3, characterized in that, Calculating the curve difference between the curves corresponding to each color of ink for any two fabrics in the fabrics to be classified includes: Pair the data points on the two curves corresponding to each color of ink between any two fabrics to be classified to obtain multiple point pair combinations. Calculate the three-dimensional Euclidean distance between the two data points in each pair of points; Based on the three-dimensional Euclidean distance between the two data points of each point pair combination, the curve difference degree of the two curves corresponding to each color of ink between any two fabrics in the fabric to be classified is obtained, wherein the curve difference degree is the cumulative sum of the three-dimensional Euclidean distances between the two data points of all point pairs combination on the two curves.
5. The method according to claim 4, characterized in that, Based on the curve difference between the curves corresponding to each color of ink between any two fabrics in the fabrics to be classified, the fabric difference value between any two fabrics in the fabrics to be classified is obtained, including: The fabric difference value between any two fabrics is obtained by weighted averaging the curve differences between the curves corresponding to each color of ink between any two fabrics to be classified.
6. The method according to claim 1, characterized in that, Using a hierarchical clustering algorithm, based on the symmetric difference matrix, the fabric to be classified is classified, and the classification results include: Treat each fabric to be classified as a cluster; Based on the symmetric difference matrix, the similarity between each pair of clusters is calculated, wherein the similarity between each pair of clusters is represented by the reciprocal of the inter-cluster distance; Find the two clusters with the highest similarity in the symmetric difference matrix, and merge the two clusters with the highest similarity into a new cluster; Recalculate the similarity between the newly merged cluster and other clusters, update the symmetric difference matrix, and obtain the updated symmetric difference matrix. Repeat the steps of finding the two clusters with the highest similarity in the updated symmetric difference matrix, merging the two clusters with the highest similarity into a new cluster, recalculating the similarity between the newly merged cluster and other clusters, updating the symmetric difference matrix, and obtaining the updated symmetric difference matrix until the preset conditions are met and the target symmetric difference matrix is obtained. The fabrics in each cluster of the target symmetric difference matrix are classified as a single fabric, and the classification results are obtained.
7. A fabric sorting device based on color characteristics, characterized in that, include: A printing unit is used to print a color label on each fabric to be classified. The color label consists of color samples of four colors of ink. Each color sample of ink includes M color samples of different concentrations. The color label includes 4*M color samples. The four colors of ink are magenta ink, cyan ink, yellow ink and black ink. The color label is used to obtain color characteristic data of each fabric to be classified. The acquisition unit is used to acquire the CIE Lab color value of each color sample of the color chart on each fabric to be classified using a spectrophotometer; The first construction unit is used to construct a curve corresponding to each color of ink on each fabric to be classified based on the CIELab color value of each color sample of the color plate on each fabric to be classified. The first calculation unit is used to calculate the curve difference between the curves corresponding to each color of ink between any two fabrics in the fabrics to be classified. The second calculation unit is used to obtain the fabric difference value between any two fabrics in the fabric to be classified based on the curve difference degree between the curves corresponding to each color of ink between any two fabrics in the fabric to be classified. The second construction unit is used to construct a symmetric difference matrix based on the fabric difference value between any two fabrics in the fabrics to be classified. The classification unit is used to classify the fabric to be classified based on the symmetric difference matrix using a hierarchical clustering algorithm to obtain the classification result.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the fabric classification method based on color characteristics as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program executes the fabric classification method based on color characteristics according to any one of claims 1 to 6.
10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the fabric classification method based on color characteristics as described in any one of claims 1 to 6.