Color palette matching method based on color difference analysis and related device
By pre-storing and calculating color difference values, the problems of inhomogeneous surface color plate matching accuracy and low calculation efficiency in the prior art are solved, and fast and accurate color plate matching is achieved, and the calculation burden is reduced.
Patent Information
- Application Number
- CN202510040880.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-04-25
AI Technical Summary
The existing color palette management methods are difficult to accurately match non-uniform surface color palettes, and the calculation amount is large and the calculation time is long.
By prestoring the first color difference value between the color plate pictures and the intermediate picture of multiple different color samples, the second color difference value between the color plate pictures to be measured and the intermediate picture is calculated, and the color difference value is matched to achieve rapid matching of the non-uniform surface color plate.
Improves the accuracy and efficiency of color plate matching, and is suitable for non-uniform surface color plates, reducing the amount of calculation and shortening the calculation time.
Smart Images

Figure CN119884408A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of color card management, and in particular to a color plate matching method based on color difference analysis and a related device. Background Art
[0002] In current color palette management practices, finding items that are similar to a specific color often relies on manual experience and visual judgment. This approach not only makes the search process complicated and difficult, but also makes it difficult to ensure accuracy due to the subjectivity of visual comparison. In addition, the lack of quantitative color difference measurement makes it unreliable to evaluate color similarity. As a result, this process is not only inefficient but also challenging to execute. As people's living standards improve, the demand for personalized product appearance is growing, and traditional appearance comparison methods can no longer meet the needs of modern industrial production.
[0003] Through searching, we found that the patent publication number CN118427387A discloses a color plate management method. This patent uses a color quantization measuring instrument (such as a colorimeter) to measure the color quantization value of an external color plate, and compares and analyzes the quantitative difference between it and the existing color quantization value in the database.
[0004] However, the above method is mainly applicable to uniform surface color plates with consistent surface color. When it comes to non-uniform surface color plates with inconsistent surface color (such as metal paint, marble color plates, wood grain color plates, etc.), although the accuracy and representativeness of the measurement results can be improved by multi-point measurement or using a specially designed colorimeter, it is still difficult to obtain accurate data. The results are often quite different from what the naked eye feels, or even completely opposite.
[0005] In addition, when there are color quantization value data of multiple different color palettes in the database, the above method needs to calculate the measured color quantization data values one by one with the color quantization values already existing in the database when performing color difference calculation. Therefore, there are also problems such as large amount of calculation and long calculation time. Summary of the invention
[0006] The purpose of the present invention is to provide a color plate matching method based on color difference analysis and related devices, which have the advantages of improving the accuracy and efficiency of color plate matching, being suitable for color plates on non-uniform surfaces, reducing the amount of calculation and shortening the calculation time.
[0007] In a first aspect, the present invention provides a color plate matching method based on color difference analysis, the method comprising the following steps: Pre-storing a first color difference value between a plurality of sample color palette images of different colors and an intermediate image, wherein the intermediate image is a pure color image with all pixels having the same color; Calculating a second color difference value between the color plate image to be tested and the intermediate image; Calculating color difference values between the second color difference value and a plurality of the first color difference values; A sample color palette image corresponding to the color palette image to be tested is output based on the color difference value.
[0008] The color plate matching method based on color difference analysis provided by the present invention can quantify and record the color difference between the sample color plate picture and the intermediate picture by pre-storing the first color difference value between a plurality of different color sample color plate pictures and the intermediate picture. Then, by calculating the second color difference value between the color plate picture to be tested and the intermediate picture, the color difference between the color plate picture to be tested and the intermediate picture can be expressed. Further, the second color difference value is compared with the plurality of first color difference values, and the color difference difference value is obtained by subtraction, so as to quantify and express the color difference between the sample color plate picture and the color plate picture to be tested. Finally, according to these color difference differences, the sample color plate picture corresponding to the color plate picture to be tested can be quickly matched under low computing power conditions, so as to realize the fuzzy matching between the color plate to be tested and the sample color plate. At the same time, since the method uses pictures for matching, the applicability and matching accuracy of color plates on non-uniform surfaces are enhanced. In addition, compared with directly calculating the color difference values between a plurality of sample color plate pictures and the color plate picture to be tested, this method greatly reduces the amount of calculation and improves the matching efficiency. Therefore, the present invention has the significant advantages of improving the accuracy and efficiency of color plate matching, being applicable to color plates on non-uniform surfaces, reducing the amount of calculation and shortening the calculation time.
[0009] Furthermore, the pre-storing of the first color difference value between the sample color palette images of multiple different colors and the intermediate image comprises the following steps: Converting the intermediate image into a first LAB color space matrix; Convert the sample color palette image into a second LAB color space matrix; Calculate the average value of the Euclidean distance between each corresponding pixel point of the first LAB color space matrix and the second LAB color space matrix to obtain the first color difference value; The first color difference value and the corresponding sample color palette image are associated and stored.
[0010] By adopting the above technical solution, the color difference between the sample color plate image and the intermediate image can be effectively quantified, and the accuracy of color matching can be improved. Compared with the prior art, the present application is not only applicable to uniform surface color plates with consistent surface color, but also can process non-uniform surface color plates with inconsistent surface color, such as marble color plates, wood grain color plates, etc. By using LAB color space and Euclidean distance calculation, the present application can provide a more accurate color difference measurement method and improve the reliability of color plate matching.
[0011] Furthermore, the first LAB color space matrix and the second LAB color space matrix each include a space matrix of three channels, the three channels are L channel, A channel and B channel, the size of each space matrix is m*n, and the calculation formula of the first color difference value is: ; in, is the first color difference value, , , are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the L, A, and B channels of the first LAB color space matrix respectively; , , They are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the L, A, and B channels of the second LAB color space matrix respectively.
[0012] By adopting the above technical solution, the size of the first LAB color space matrix and the second LAB color space matrix are set to m*n, and a specific calculation formula is introduced to solve the problem that the traditional method is difficult to obtain accurate data when processing non-uniform surface color plates. Specifically, by calculating the average value of the Euclidean distance between each corresponding pixel point, the color difference value can be more accurately reflected, thereby improving the accuracy and reliability of color plate matching.
[0013] Furthermore, the calculating of the second color difference value between the color plate image to be tested and the intermediate image comprises the following steps: Converting the intermediate image into a first LAB color space matrix; Convert the color palette image to be tested into a third LAB color space matrix; An average value of the Euclidean distance between each corresponding pixel point of the first LAB color space matrix and the third LAB color space matrix is calculated to obtain the second color difference value.
[0014] Furthermore, the first LAB color space matrix and the third LAB color space matrix each include a space matrix of three channels, where the three channels are L channel, A channel and B channel, the size of each space matrix is m*n, and the calculation formula of the second color difference value is: ; in, is the second color difference value, , , are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the L, A, and B channels of the first LAB color space matrix respectively; , , They are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the L, A, and B channels of the third LAB color space matrix respectively.
[0015] Furthermore, matching the sample color plate picture corresponding to the color plate picture to be tested based on the color difference value includes the following steps: Determining whether the color difference is within a matching range; When the color difference value is within the matching range, outputting the corresponding sample color palette image; When the color difference value exceeds the matching range, the second color difference value and the corresponding color plate image to be tested are stored.
[0016] The above technical solution improves the accuracy of color plate matching by quantifying the color difference difference and avoids the subjective error of manual judgment. The automated matching and storage processing steps improve the efficiency of color plate matching and reduce the complexity of manual operation. By storing and processing the color difference values and the color plate images that are out of the matching range, a basis for subsequent analysis and improvement is provided, further improving the scientificity and systematicness of color plate management.
[0017] Further, the intermediate picture includes a first intermediate picture and a second intermediate picture, and the method includes the following steps: Pre-storing a third color difference value between a plurality of sample color palette images of different colors and the first intermediate image; Pre-storing a fourth color difference value between a plurality of sample color palette images of different colors and the first intermediate image; Calculating a fifth color difference value between the color plate image to be tested and the first intermediate image; Calculating a sixth color difference value between the color plate image to be tested and the second intermediate image; Calculating a first color difference difference value between the fifth color difference value and a plurality of the third color difference values; Calculating a second color difference value between the sixth color difference value and a plurality of the fourth color difference values; A sample color plate image corresponding to the color plate image to be tested is output based on the first color difference value and the second color difference value.
[0018] By adopting the above technical solution, by respectively calculating the color difference values of the first intermediate image and the second intermediate image relative to the sample color plate image and the color plate image to be tested, the first color difference difference value and the second color difference difference value can be obtained. When matching, color plate matching can be performed simultaneously based on the first color difference difference value and the second color difference difference value, thereby improving the matching accuracy.
[0019] In a second aspect, the present application further provides a color plate matching device, the device comprising: A storage module, used for pre-storing a first color difference value between a plurality of sample color palette images of different colors and an intermediate image, wherein the intermediate image is a pure color image with all pixels having the same color; A first calculation module, used for calculating a second color difference value between the color plate image to be tested and the intermediate image; A second calculation module, used for calculating the color difference between the second color difference value and a plurality of the first color difference values; The color matching module is used to output a sample color palette image corresponding to the color palette image to be tested based on the color difference value.
[0020] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method provided in the first aspect are performed.
[0021] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps in the method provided in the first aspect are performed.
[0022] As can be seen from the above, the color plate matching method, device, electronic device and storage medium based on color difference analysis provided by the present invention can quantify and record the color difference between the sample color plate picture and the intermediate picture by pre-storing the first color difference value between multiple different color sample color plate pictures and the intermediate picture. Then, by calculating the second color difference value between the color plate picture to be tested and the intermediate picture, the color difference between the color plate picture to be tested and the intermediate picture can be expressed. Further, the second color difference value is compared with the multiple first color difference values, and the color difference difference value is obtained by subtraction, so as to quantify and express the color difference between the sample color plate picture and the color plate picture to be tested. Finally, according to these color difference differences, the sample color plate picture corresponding to the color plate picture to be tested can be quickly matched under low computing power conditions, and the fuzzy matching between the color plate to be tested and the sample color plate is realized. At the same time, since the method uses pictures for matching, the applicability and matching accuracy of non-uniform surface color plates are enhanced. In addition, compared with directly calculating the color difference values between multiple sample color plate pictures and the color plate picture to be tested, this method greatly reduces the amount of calculation and improves the matching efficiency. Therefore, the present invention has the significant advantages of improving the accuracy and efficiency of color plate matching, being applicable to color plates on non-uniform surfaces, reducing the amount of calculation and shortening the calculation time.
[0023] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A flowchart of a color plate matching method based on color difference analysis provided in an embodiment of the present application.
[0025] Figure 2 The present invention provides a block diagram of a color plate matching device.
[0026] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0027] Explanation of reference numerals: 10, storage module; 20, first calculation module; 30, second calculation module; 40, color matching module; 3, electronic device; 301, processor; 302, memory; 303, communication bus. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0029] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0030] In current color palette management practices, finding items that are similar to a specific color often relies on manual experience and visual judgment. This approach not only makes the search process complicated and difficult, but also makes it difficult to ensure accuracy due to the subjectivity of visual comparison. In addition, the lack of quantitative color difference measurement makes it unreliable to evaluate color similarity. As a result, this process is not only inefficient but also challenging to execute. As people's living standards improve, the demand for personalized product appearance is growing, and traditional appearance comparison methods can no longer meet the needs of modern industrial production.
[0031] The color plate matching method based on color difference analysis disclosed by the present invention is mainly used in color plate management, has the advantages of improving the accuracy and efficiency of color plate matching, being suitable for color plates on non-uniform surfaces, reducing the amount of calculation and shortening the calculation time.
[0032] In one embodiment, the color plate matching method based on color difference analysis includes the following steps: S100, pre-storing a first color difference value between a plurality of sample color palette images of different colors and an intermediate image, where the intermediate image is a pure color image with all pixels having the same color; S200, calculating a second color difference value between the color plate image to be tested and the middle image; S300, calculating a color difference between a second color difference value and a plurality of first color difference values; S400: Outputting a sample color plate image corresponding to the color plate image to be tested based on the color difference value.
[0033] Specifically, during the color mixing and production process of the paint, the prepared paint is sprayed on a card, and the card sprayed with paint is called a color plate.
[0034] The sample color plate images and the color plate images to be tested are both collected through a visual instrument, which includes a light source system, a lens, a camera, a back-end image signal processor, a sample clip, a memory, a display screen and accessories.
[0035] The collection process of the sample color plate image and the color plate image to be tested is as follows: the light source system simulates the sunlight light source and projects it onto the color plate. The lens with a resolution of 10 million pixels and a magnification of 2x projects the color information on the color plate surface into the full-color optical sensor of the 1200W pixel camera. The full-color optical sensor of the camera converts the light and shadow signal into an electrical signal, and the back-end image signal processor performs white balance calibration and color calibration to obtain a color plate image that is extremely close to the visual effect of the human eye.
[0036] It is worth noting that the sample color plate image, the color plate image to be tested and the intermediate image are all in png format. Since the png format uses lossless compression and the color space is "RGBA", it can retain the image information to the greatest extent.
[0037] The color difference calculation formula for a single pixel is: ,in, is the color difference value, , , They are the corresponding pixels in the LAB image. (brightness axis), (Red and green axis), (yellow-blue axis).
[0038] Generally speaking, ΔE ≤ 0~0.25: very small or no color difference, ideal match; 0.25<ΔE ≤ 0.5: slight color difference, acceptable match; 0.5<ΔE ≤ 1.0: slight to moderate color difference, acceptable in some applications; 1.0<ΔE ≤2.0: moderate color difference, acceptable in specific applications; ΔE>2.0: very large color difference, unacceptable in most applications. In the coatings industry, color difference values between ΔE=0.5-1.5 are generally considered acceptable.
[0039] Since a color palette image has 12 million pixels, when matching, if the color difference between the color palette image to be tested and multiple sample color palette images is directly calculated, the amount of calculation is obviously huge. Therefore, the first color difference between multiple sample color palettes and the intermediate image can be calculated in advance. Before matching, you only need to calculate the second color difference between the color plate image to be tested and the middle image. , color difference =First color difference value - Second color difference value Therefore, by setting the intermediate image to indirectly obtain the color difference between the color plate image to be tested and the sample color plate image, only one color difference calculation between 12 million points is required during matching, which helps to simplify the calculation amount during matching.
[0040] It is worth noting that the color difference refers to the relative color difference, that is, the difference between the color change from the sample color plate image to the middle image and the color change from the color plate image to the middle image. When the color difference is positive, it means that the color change from the sample color plate image to the middle image is greater than the color change from the color plate image to the middle image. When it is a negative value, the opposite is true; that is, the color difference The closer it is to 0, the more visually similar the color change from the sample color palette image to the middle image is to the color change from the color palette image to the middle image.
[0041] As can be seen from the above, the color plate matching method based on color difference analysis provided by the present invention can quantify and record the color difference between the sample color plate picture and the intermediate picture by pre-storing the first color difference value between a plurality of different color sample color plate pictures and the intermediate picture. Then, by calculating the second color difference value between the color plate picture to be tested and the intermediate picture, the color difference between the color plate picture to be tested and the intermediate picture can be expressed. Further, the second color difference value is compared with the plurality of first color difference values, and the color difference difference value is obtained by subtraction, so as to quantify and express the color difference between the sample color plate picture and the color plate picture to be tested. Finally, according to these color difference differences, the sample color plate picture corresponding to the color plate picture to be tested can be quickly matched under low computing power conditions, so as to realize the fuzzy matching between the color plate to be tested and the sample color plate. At the same time, since the method uses pictures for matching, the applicability and matching accuracy of the color plate on the non-uniform surface are enhanced. In addition, compared with directly calculating the color difference values between the plurality of sample color plate pictures and the color plate picture to be tested, this method greatly reduces the amount of calculation and improves the matching efficiency. Therefore, the present invention has the significant advantages of improving the accuracy and efficiency of color plate matching, being applicable to color plates on non-uniform surfaces, reducing the amount of calculation and shortening the calculation time.
[0042] In one embodiment, pre-storing a first color difference value between a plurality of sample color palette images of different colors and an intermediate image comprises the following steps: Convert the intermediate image to the first LAB color space matrix; Convert the sample palette image to the second LAB color space matrix; Calculate the average value of the Euclidean distance between each corresponding pixel point of the first LAB color space matrix and the second LAB color space matrix to obtain a first color difference value; The first color difference value and the corresponding sample color palette image are associated and stored.
[0043] Specifically, image processing software or programming tools (such as the OpenCV library in Python) can be used for conversion. Next, the Euclidean distance between each corresponding pixel point of the two matrices is calculated, and the average value of these distances is calculated to obtain the first color difference value. Then, the calculated first color difference value and the corresponding sample color plate image are stored and processed, and can be stored in a database or file system for subsequent use.
[0044] By adopting the above technical solution, the color difference between the sample color plate image and the intermediate image can be effectively quantified, and the accuracy of color matching can be improved. Compared with the prior art, the present application is not only applicable to uniform surface color plates with consistent surface color, but also can process non-uniform surface color plates with inconsistent surface color, such as marble color plates, wood grain color plates, etc. By using LAB color space and Euclidean distance calculation, the present application can provide a more accurate color difference measurement method and improve the reliability of color plate matching.
[0045] In one embodiment, the first LAB color space matrix and the second LAB color space matrix each include a space matrix of three channels, the three channels are L channel, A channel and B channel, the size of each space matrix is m*n, and the calculation formula of the first color difference value is: ; in, is the first color difference value, , , are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the first LAB color space matrix in the L, A, and B channels respectively; , , They are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the second LAB color space matrix in the L, A, and B channels respectively.
[0046] By adopting the above technical solution, the size of the first LAB color space matrix and the second LAB color space matrix are set to m*n, and a specific calculation formula is introduced to solve the problem that the traditional method is difficult to obtain accurate data when processing non-uniform surface color plates. Specifically, by calculating the average value of the Euclidean distance between each corresponding pixel point, the color difference value can be more accurately reflected, thereby improving the accuracy and reliability of color plate matching.
[0047] In one embodiment, calculating the second color difference between the color plate image to be tested and the intermediate image comprises the following steps: Convert the intermediate image to the first LAB color space matrix; Convert the color palette image to be tested into the third LAB color space matrix; The average value of the Euclidean distance between each corresponding pixel point of the first LAB color space matrix and the third LAB color space matrix is calculated to obtain a second color difference value.
[0048] Specifically, this process can be implemented by writing corresponding image processing algorithms. For example, using Python programming language and OpenCV library, the color space conversion and Euclidean distance calculation of the image can be easily performed. The intermediate image and the color plate image to be tested are loaded into matrix form, and the cv2.cvtColor function is used to convert them into LAB color space, and then the Euclidean distance between each corresponding pixel point is calculated, and the average value is obtained to obtain the second color difference value.
[0049] In one embodiment, the first LAB color space matrix and the third LAB color space matrix each include a space matrix of three channels, the three channels are L channel, A channel and B channel, the size of each space matrix is m*n, and the calculation formula of the second color difference value is: ; in, is the second color difference value, , , are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the first LAB color space matrix in the L, A, and B channels respectively; , , They are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the L, A, and B channels of the third LAB color space matrix respectively.
[0050] In one embodiment, matching a sample color plate image corresponding to a color plate image to be tested based on a color difference value includes the following steps: Determine whether the color difference is within the matching range; When the color difference is within the matching range, the corresponding sample color palette image is output; When the color difference value exceeds the matching range, the second color difference value and the corresponding color plate image to be tested are stored.
[0051] Specifically, the color difference When it is between -1 and 1, it can be considered to be within the matching range. At this time, the corresponding sample color plate image is output; otherwise, the second color difference value and the corresponding color plate image to be tested are associated and stored.
[0052] The above technical solution improves the accuracy of color plate matching by quantifying the color difference difference and avoids the subjective error of manual judgment. The automated matching and storage processing steps improve the efficiency of color plate matching and reduce the complexity of manual operation. By storing and processing the color difference values and the color plate images that are out of the matching range, a basis for subsequent analysis and improvement is provided, further improving the scientificity and systematicness of color plate management.
[0053] For non-uniform surface color plates (such as metal paint, marble color plates, wood grain color plates, etc.), there are color differences in different areas. Therefore, when calculating the color difference value, the overall color difference value may be close, but there may be differences in the local color difference value.
[0054] To this end, in one embodiment, the sample color plate image, the intermediate image and the color plate image to be tested are all divided into X*Y areas; the color plate matching method based on color difference analysis also includes the following steps: Pre-store first color difference values corresponding to X*Y areas of a plurality of sample color palette images of different colors relative to the middle image; Calculate the second color difference value corresponding to the color plate image to be tested and the middle image in X*Y areas; Calculate a plurality of color difference values of the first color difference value and the second color difference value in the X*Y area; When multiple color difference values are within the matching range, the corresponding sample color palette images are output.
[0055] Exemplarily, X and Y can both be 3, that is, the sample color plate image, the intermediate image and the color plate image to be tested are divided into 9 areas to calculate the third color difference value and the fourth color difference value, and then the color difference difference values of the 9 areas are obtained. When the color difference difference values corresponding to the 9 areas are all between -1 and 1, the corresponding sample color plate image is output.
[0056] By adopting the above technical solution, the sample color plate image, the intermediate image and the color plate image to be tested are divided into regions, and the third color difference value and the fourth color difference value of different regions are calculated respectively, and then the color difference difference values of multiple regions are obtained for matching, which helps to reduce errors and improve matching accuracy.
[0057] In one embodiment, the intermediate image includes a first intermediate image and a second intermediate image, and the color plate matching method based on color difference analysis includes the following steps: Pre-storing a third color difference value between a plurality of sample color palette images of different colors and the first intermediate image; Pre-storing a fourth color difference value between a plurality of sample color palette images of different colors and the first intermediate image; Calculate the fifth color difference between the color plate image to be tested and the first intermediate image; Calculate the sixth color difference between the color plate image to be tested and the second intermediate image; calculating a first color difference difference value between the fifth color difference value and a plurality of third color difference values; calculating a second color difference difference value between the sixth color difference value and a plurality of fourth color difference values; A sample color plate image corresponding to the color plate image to be tested is output based on the first color difference value and the second color difference value.
[0058] Specifically, when the first color difference value and the second color difference value are both within the matching range, the corresponding sample color plate image is output; when at least one of the first color difference value and the second color difference value exceeds the matching range, the fifth color difference value, the sixth color difference value and the corresponding color plate image to be tested are stored and processed.
[0059] By adopting the above technical solution, by respectively calculating the color difference values of the first intermediate image and the second intermediate image relative to the sample color plate image and the color plate image to be tested, the first color difference difference value and the second color difference difference value can be obtained. When matching, color plate matching can be performed simultaneously based on the first color difference difference value and the second color difference difference value, thereby improving the matching accuracy.
[0060] In other embodiments, the number of intermediate pictures may be increased accordingly according to the need for matching accuracy. For example, the intermediate pictures may also include a third intermediate picture, a fourth intermediate picture, a fifth intermediate picture, and the like.
[0061] In one embodiment, the first intermediate image may be a pure white image; and the second intermediate image may be a pure black intermediate image.
[0062] In the process of color plate matching, the technical solution of selecting pure white pictures and pure black pictures as intermediate pictures is mainly to provide a unified reference benchmark. Pure white pictures and pure black pictures as intermediate pictures can effectively reduce interference factors in color difference calculation, thereby improving the calculation accuracy of color difference values. Specifically, pure white pictures have fixed color values in the LAB color space (L=100, A=0, B=0), and pure black pictures have fixed color values in the LAB color space (L=0, A=0, B=0), which makes it possible to more accurately reflect the color difference between the color plate picture to be tested and the sample color plate picture when calculating color difference.
[0063] By adopting the above technical solution, pure white pictures and pure black pictures are used as intermediate pictures, which can maintain consistency in different color plate matching processes and avoid errors caused by color changes of the intermediate pictures. In addition, pure white pictures and pure black pictures are easy to obtain and standardize in actual operations, which can simplify the implementation steps of the color plate matching method.
[0064] Reference Figure 2 , attached Figure 2 It is a color plate matching device in some embodiments of the present application, and the color plate matching device includes a storage module 10, a first calculation module 20, a second calculation module 30 and a color matching module 40.
[0065] Among them, the storage module 10 is used to pre-store the first color difference value between multiple sample color palette images of different colors and the intermediate image, and the intermediate image is a pure color image with the same color for all pixels; the first calculation module 20 is used to calculate the second color difference value between the color palette image to be tested and the intermediate image; the second calculation module 30 is used to calculate the color difference difference between the second color difference value and multiple first color difference values; the color matching module 40 is used to output the sample color palette image corresponding to the color palette image to be tested based on the color difference difference.
[0066] Please refer to Figure 3 , Figure 3 The present invention provides a structural diagram of an electronic device provided by an embodiment of the present application. The present application provides an electronic device 3, including: a processor 301 and a memory 302. The processor 301 and the memory 302 are interconnected and communicate with each other through a communication bus 303 and / or other forms of connection mechanisms (not shown). The memory 302 stores a computer program executable by the processor 301. When the computing device is running, the processor 301 executes the computer program to execute the method in any optional implementation of the above embodiment to achieve the following functions: by pre-storing a plurality of first color difference values between different color sample color palette images and the intermediate image, the color difference between the sample color palette image and the intermediate image can be quantified and recorded. Then, by calculating the second color difference value between the color palette image to be tested and the intermediate image, the color difference between the color palette image to be tested and the intermediate image can be expressed. Further, the second color difference value is compared with the plurality of first color difference values, and the color difference difference value is obtained by subtracting them, so as to quantify and express the color difference between the sample color palette image and the color palette image to be tested. Finally, according to these color difference values, the sample color plate image corresponding to the color plate image to be tested can be quickly matched under low computing power conditions, realizing fuzzy matching between the color plate to be tested and the sample color plate. At the same time, since the method uses images for matching, the applicability and matching accuracy of color plates on non-uniform surfaces are enhanced. In addition, compared with directly calculating the color difference values between multiple sample color plate images and the color plate image to be tested, this method greatly reduces the amount of calculation and improves the matching efficiency. Therefore, the present invention has the significant advantages of improving the accuracy and efficiency of color plate matching, being applicable to color plates on non-uniform surfaces, reducing the amount of calculation and shortening the calculation time.
[0067] The embodiment of the present application provides a storage medium, and when the computer program is executed by a processor, the method in any optional implementation of the above embodiment is executed to achieve the following functions: by pre-storing a plurality of first color difference values between sample color palette images of different colors and an intermediate image, the color difference between the sample color palette image and the intermediate image can be quantified and recorded. Then, by calculating the second color difference value between the color palette image to be tested and the intermediate image, the color difference between the color palette image to be tested and the intermediate image can be expressed. Further, the second color difference value is compared with the plurality of first color difference values, and the color difference difference value is obtained by subtraction, so as to quantify and express the color difference between the sample color palette image and the color palette image to be tested. Finally, according to these color difference differences, the sample color palette image corresponding to the color palette image to be tested can be quickly matched under low computing power conditions, so as to achieve fuzzy matching between the color palette to be tested and the sample color palette. At the same time, since the method uses images for matching, the applicability and matching accuracy of color palettes on non-uniform surfaces are enhanced. In addition, compared with directly calculating the color difference values between a plurality of sample color palette images and the color palette image to be tested, this method greatly reduces the amount of calculation and improves the matching efficiency. Therefore, the present invention has the significant advantages of improving the accuracy and efficiency of color plate matching, being applicable to color plates on non-uniform surfaces, reducing the amount of calculation and shortening the calculation time. Wherein, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0068] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0069] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0070] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0071] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0072] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A color plate matching method based on color difference analysis, characterized in that: The method comprises the following steps: Pre-storing a first color difference value between a plurality of sample color palette images of different colors and an intermediate image; Calculating a second color difference value between the color plate image to be tested and the intermediate image; Calculating color difference values between the second color difference value and a plurality of the first color difference values; A sample color palette image corresponding to the color palette image to be tested is output based on the color difference value.
2. A color plate matching method based on color difference analysis according to claim 1, characterized in that: The method of pre-storing a plurality of first color difference values between sample color palette images of different colors and the intermediate image comprises the following steps: Converting the intermediate image into a first LAB color space matrix; Convert the sample color palette image into a second LAB color space matrix; Calculate the average value of the Euclidean distance between each corresponding pixel point of the first LAB color space matrix and the second LAB color space matrix to obtain the first color difference value; The first color difference value and the corresponding sample color palette image are associated and stored.
3. A color plate matching method based on color difference analysis according to claim 2, characterized in that: The first LAB color space matrix and the second LAB color space matrix both include space matrices with three channels, where the three channels are L channel, A channel and B channel, and the size of each space matrix is m*n. The calculation formula of the first color difference value is: ; in, is the first color difference value, , , are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the L, A, and B channels of the first LAB color space matrix respectively; , , They are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the L, A, and B channels of the second LAB color space matrix respectively.
4. The color plate matching method based on color difference analysis according to claim 1, characterized in that: The step of calculating the second color difference between the color plate image to be tested and the intermediate image comprises the following steps: Converting the intermediate image into a first LAB color space matrix; Convert the color palette image to be tested into a third LAB color space matrix; An average value of the Euclidean distance between each corresponding pixel point of the first LAB color space matrix and the third LAB color space matrix is calculated to obtain the second color difference value.
5. The color plate matching method based on color difference analysis according to claim 4, characterized in that: The first LAB color space matrix and the third LAB color space matrix both include space matrices with three channels, where the three channels are L channel, A channel and B channel, and the size of each space matrix is m*n. The calculation formula of the second color difference value is: ; in, is the second color difference value, , , are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the L, A, and B channels of the first LAB color space matrix respectively; , , They are the channel values of the pixel point in the i-th row and j-th column of the space matrix of the L, A, and B channels of the third LAB color space matrix respectively.
6. The color plate matching method based on color difference analysis according to claim 1, characterized in that: The step of outputting a sample color plate picture corresponding to the color plate picture to be tested based on the color difference value comprises the following steps: Determining whether the color difference is within a matching range; When the color difference value is within the matching range, outputting the corresponding sample color palette image; When the color difference value exceeds the matching range, the second color difference value and the corresponding color plate image to be tested are stored.
7. The color plate matching method based on color difference analysis according to claim 1, characterized in that: The intermediate picture includes a first intermediate picture and a second intermediate picture, and the method includes the following steps: Pre-storing a third color difference value between a plurality of sample color palette images of different colors and the first intermediate image; Pre-storing a fourth color difference value between a plurality of sample color palette images of different colors and the first intermediate image; Calculating a fifth color difference value between the color plate image to be tested and the first intermediate image; Calculating a sixth color difference value between the color plate image to be tested and the second intermediate image; Calculating a first color difference difference value between the fifth color difference value and a plurality of the third color difference values; Calculating a second color difference value between the sixth color difference value and a plurality of the fourth color difference values; A sample color plate image corresponding to the color plate image to be tested is output based on the first color difference value and the second color difference value.
8. A color plate matching device, characterized in that: The device comprises: A storage module, used for pre-storing a first color difference value between a plurality of sample color palette images of different colors and an intermediate image, wherein the intermediate image is a pure color image with all pixels having the same color; A first calculation module, used for calculating a second color difference value between the color plate image to be tested and the intermediate image; A second calculation module, used for calculating the color difference between the second color difference value and a plurality of the first color difference values; The color matching module is used to output a sample color palette image corresponding to the color palette image to be tested based on the color difference value.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 7 are executed.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Color palette management method
CN118427387A