Image color correction method and system and storage medium
By extracting and processing image pixel data, a calibration matrix is generated to correct the real image, which solves the problem of printing color and real color deviation in digital printing, and improves the accuracy of color correction.
Patent Information
- Application Number
- CN202411087015.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-22
AI Technical Summary
The prior art cannot effectively solve the huge deviation between printing color and actual color in digital printing, resulting in the printed image not matching the actual color.
By extracting pixel data of the real image and pixel data of the standard hue loop, a first matrix and a second matrix are generated, and a calibration matrix is generated based on these matrices, the pixel points of the real image are corrected, and the calibrated target pixel data is output to achieve Color correction.
The deviation between the printed physical image and the actual color is effectively solved, the color correction of image pixels is achieved, and the accuracy of printing quality is improved.
Smart Images

Figure CN119011741A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of pixel color correction, and in particular, relates to an image color correction method, system and storage medium. Background Art
[0002] Digital printing is a way of printing directly from electronic files, which can achieve high-precision, high-efficiency and personalized printing. The application of digital printing in color printing is mainly reflected in the high-fidelity color reproduction that can be achieved through digital printing. The quality control of color printing mainly includes color accuracy, where the color accuracy refers to the closeness of the printing result to the color information of the original, which needs to be achieved through precise color measurement and adjustment.
[0003] However, there is a deviation between the actual digital printed image and the actual color. In the prior art, color matching is only performed through photography, scanning or simple color analysis and extraction, which cannot effectively solve the huge deviation between the printed color and the actual color.
[0004] In view of this, the image color correction method proposed in the present application can realize the color correction of image pixels and effectively solve the deviation between the printed physical image and the actual color. Summary of the invention
[0005] Embodiments of the present application provide an image color correction method, system, and storage medium.
[0006] In a first aspect, an embodiment of the present application provides an image color correction method, the method comprising:
[0007] Identify and extract pixel points in the physical image to generate a first matrix;
[0008] Identify and extract pixel points in the standard hue ring to generate a second matrix;
[0009] generating a calibration matrix according to the first matrix and the second matrix;
[0010] The pixels of the physical image are corrected according to the calibration matrix to obtain a target image.
[0011] Optionally, the physical image is placed within the sensing range of the sensor, the sensor identifies and extracts color data of pixels in the physical image, generates a first matrix, and the physical image is in RGB mode; or,
[0012] Identify and extract color data of pixels in the electronic file of the physical image according to the electronic file, and generate a first matrix, wherein the electronic file of the physical image is in CMYK mode, and each pixel in the electronic file is a pixel in CMYK mode;
[0013] Converting the CMYK mode pixel points into RGB mode pixel points according to the electronic file of the physical image;
[0014] A first matrix is generated according to the RGB values corresponding to the pixels in the RGB mode in the physical image.
[0015] Optionally, converting CMYK mode pixels into RGB mode pixels according to the electronic file of the physical image includes:
[0016] Converting the CMYK mode pixel points into CMY mode pixel points according to the electronic file of the physical image;
[0017] Each of the CMY mode pixels is converted into the RGB mode pixel according to the electronic file of the physical image.
[0018] Optionally, the values corresponding to the CMYK mode pixel points include C value, M value, Y value and K value, the values corresponding to the CMY mode pixel points include C value, M value and Y value, and converting the CMYK mode pixel points into CMY mode pixel points according to the electronic file of the physical image includes:
[0019] Determine the C value of the pixel point in the CMYK mode according to the C value and K value corresponding to the pixel point in the CMYK mode;
[0020] Determine the M value of the CMYK mode pixel point according to the M value and K value corresponding to the CMYK mode pixel point;
[0021] Determine the Y value of the pixel point in the CMYK mode according to the Y value and K value corresponding to the pixel point in the CMYK mode.
[0022] Optionally, the values corresponding to the CMY mode pixel points include C value, M value, and Y value, the values corresponding to the RGB mode pixel points include R value, B value, and G value, and the converting of the CMYK mode pixel points into the CMY mode pixel points according to the electronic file of the physical image includes:
[0023] Determine the R value of the pixel point in the RGB mode according to the C value corresponding to the pixel point in the CMY mode and the maximum value in the RGB mode;
[0024] Determine the G value of the pixel point in the RGB mode according to the difference between the M value corresponding to the pixel point in the CMY mode and the maximum value of the RGB mode;
[0025] The B value of the pixel point in the RGB mode is determined according to the difference between the Y value corresponding to the pixel point in the CMY mode and the maximum value of the RGB mode.
[0026] Optionally, the step of identifying and extracting pixels in a standard hue ring to generate a second matrix includes:
[0027] Reading pixel points in the standard color phase circle, the standard color phase circle is in HSB mode, and each pixel in the standard color phase circle is a pixel point in HSB mode;
[0028] Converting the HSB mode pixel point into the RGB mode pixel point according to the standard color phase circle;
[0029] A second matrix is generated according to the RGB values corresponding to each of the RGB mode pixels in the standard color phase circle.
[0030] Optionally, the correcting pixels of the physical image according to the calibration matrix to obtain a target image includes:
[0031] Correcting the RGB mode pixels in the physical image according to the calibration matrix to obtain a target RGB value;
[0032] Convert the RGB mode pixel point to the CMY mode pixel point according to the target RGB value;
[0033] Converting the CMY mode pixel points into the CMYK mode pixel points according to the physical image;
[0034] The target image is printed according to the values corresponding to the pixels in the CMYK mode.
[0035] In a second aspect, an embodiment of the present application provides an image color correction system, comprising:
[0036] A first matrix module, used to identify and extract pixels in the physical image to generate a first matrix;
[0037] The second matrix module is used to identify and extract pixels in the standard hue ring to generate a second matrix;
[0038] A calibration matrix module, used for generating a calibration matrix according to the first matrix and the second matrix;
[0039] The target image module is used to correct the pixel points of the physical image according to the calibration matrix to obtain a target image.
[0040] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described above when executing the computer program.
[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described above is implemented.
[0042] The present application extracts pixel data of a physical image and pixel data of a standard color phase circle to obtain a first matrix and a second matrix respectively, and then obtains a calibration matrix based on the first matrix and the second matrix, calibrates the pixel data of the extracted physical image based on the calibration matrix, outputs the target pixel data obtained by calibration, and obtains a target image based on the target pixel data. The color correction of image pixels can be achieved, and the deviation between the printed physical image and the actual color is effectively solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 is a schematic diagram of an image color correction method provided by an embodiment of the present application;
[0045] Figure 2 The embodiment of this application provides Figure 1 Schematic diagram of the specific process of S100;
[0046] Figure 3 The embodiment of this application provides Figure 2 Schematic diagram of the specific process of S102;
[0047] Figure 4 The embodiment of this application provides Figure 1 Schematic diagram of the specific process of S200;
[0048] Figure 5 The embodiment of this application provides Figure 1 Schematic diagram of the specific process of S400;
[0049] Figure 6 is a structural schematic diagram of an image color correction system provided by an embodiment of the present application;
[0050] Figure 7 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0052] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0053] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0054] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0055] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0056] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0057] Color printing is a printing technology that uses different color inks to accurately copy the color information of the original onto paper or other printing media. Its main goal is to achieve color reproduction of the original, including color attributes such as hue, saturation and brightness. The basic principle is to convert the color information of the original into commands that can be understood and executed by the printing equipment through the process of color decomposition and color synthesis. Among them, color decomposition is to decompose the color information of the original into a combination of basic colors (such as cyan, magenta, yellow, and black), which is achieved through color modes (such as CMYK mode). Color synthesis is to mix the inks of basic colors in a certain combination ratio to produce a color close to the color of the original.
[0058] The color mode of an image is a specific way to describe color. It defines how to decompose a color into a combination of basic colors. Common color modes include RGB mode (for screen display), CMYK mode (for color printing) and HSB mode (based on the human eye's perception of color). Different color modes have different color ranges and expressive capabilities. Choosing the right color mode is crucial to ensuring printing quality.
[0059] In the field of color printing, digital printing is a way of printing directly using electronic files, which can achieve high-precision, high-efficiency and personalized printing. The application of digital printing in color printing is mainly reflected in the high-fidelity color reproduction that can be achieved through digital printing. Color accuracy refers to the degree of closeness between the printed result and the color information of the original, which needs to be achieved through precise color measurement and adjustment.
[0060] However, there is a deviation between the actual digital printed image and the actual color. In the prior art, color matching is only performed through photography, scanning or simple color analysis and extraction, which cannot effectively solve the huge deviation between the printed color and the actual color.
[0061] In view of this, the image color correction method proposed in the present application extracts the pixel data of the physical image and the pixel data of the standard color phase circle to obtain the first matrix and the second matrix respectively, and then obtains the calibration matrix according to the first matrix and the second matrix, calibrates the pixel data of the extracted physical image according to the calibration matrix, outputs the target pixel data obtained by calibration, and obtains the target image according to the target pixel data. The color correction of the image pixels can be realized, and the deviation between the printed physical image and the actual color is effectively solved.
[0062] Figure 1 is a schematic diagram of an image color correction method provided by an embodiment of the present application, the method comprising:
[0063] S100, identifying and extracting pixels in the real object image to generate a first matrix.
[0064] In the embodiments of the present application, the physical image refers to a color printed image, specifically, a printed image that accurately copies the color information of the original onto paper or other printed media by using different color inks. For digital printing technology, the method of directly printing using electronic files can achieve high-precision, high-efficiency and personalized printing, where the electronic file is the original of the printed image. However, there is a deviation between the actual digital printed image and the actual color (i.e., the original color), so it is necessary to correct the pixels.
[0065] In a possible implementation, the printed physical image is identified and extracted by a sensor, wherein the sensor may be a color sensor, which detects the color by comparing the color of the object with a reference color, and outputs a detection result when the two colors match within a certain error range. The physical image is identified and extracted by the sensor, and the first matrix is automatically generated after the identified and extracted data is uploaded.
[0066] S200, identifying and extracting pixels in the standard hue ring to generate a second matrix.
[0067] In the embodiment of the present application, the pixel points are corrected by the color data in the standard color circle. In one possible example, the standard color circle is a physical standard color card. The standard color card is placed within the sensing range of the color sensor by the method in S100 to identify and extract the color data on the standard color card, and the identified and extracted color data is uploaded to automatically generate the second matrix. In another possible embodiment, the standard color circle can also be a virtual color circle, that is, there is no physical color card, and the color palette that comes with the software, such as the digital color circle in Photoshop, whose color data is directly recorded in the computer, and the second matrix is automatically generated by identification and extraction.
[0068] S300: Generate a calibration matrix according to the first matrix and the second matrix.
[0069] In the embodiment of the present application, a standard matrix is generated according to the first matrix and the second matrix obtained in S100 and S200. Since the second matrix is a standard matrix generated by a standard color card, the second matrix is taken as the target matrix. Assuming that the first matrix is A and the second matrix is B, A*K=B, and K is the calibration matrix.
[0070] S400, correcting the pixels of the physical image according to the calibration matrix to obtain a target image.
[0071] In the embodiment of the present application, the pixel data uploaded by the physical image is corrected according to the calibration matrix to obtain the corrected pixel data, and then the target image is printed according to the corrected pixel data. This section will introduce the recognition and extraction of the physical image to generate the first matrix.
[0072] Specifically, Figure 2 The embodiment of this application provides Figure 1 The specific process diagram of S100 in FIG. 1 is that the sensor identifies and extracts pixel points in the physical image to generate a first matrix, including:
[0073] S101: placing the physical image within the sensing range of the sensor, the sensor identifying and extracting color data of pixels in the physical image to generate a first matrix, wherein the physical image is in RGB mode; or
[0074] The first matrix is generated by identifying and extracting color data of pixel points in the electronic file according to the electronic file of the physical image, wherein the electronic file of the physical image is in CMYK mode and each pixel in the electronic file is a pixel point in CMYK mode.
[0075] A color mode is a specific way of describing a color, which defines how to decompose a color into a combination of basic colors. Common color modes include RGB mode (for screen display), CMYK mode (for color printing), and HSB mode (based on the human eye's perception of color). In the embodiment of the present application, there are two processing methods, one is to directly scan the physical image of the RGB mode to obtain RGB pixels, and the other is to convert the CMYK mode pixels of the electronic file corresponding to the physical image to obtain RGB pixels, and automatically generate the first matrix based on the RGB pixels.
[0076] In one possible implementation, a physical image is scanned and identified by a sensor. Since most physical images are in RGB mode, the pixels obtained by the identification scan are directly RGB mode pixels. The data of the RGB pixels are uploaded to a computer, and the computer automatically generates a first matrix based on the RGB mode pixels.
[0077] Due to the limitation of printing process, there is a deviation between the pixel data of electronic file and the pixel data of printed physical image. Specifically, there is a deviation between the color data of the pixel in the electronic file and the color data of the pixel of the physical image identified. Therefore, in another possible implementation, in the embodiment of the present application, the physical image is a color printed image, and the printed image is printed according to the electronic file. The electronic file of the physical image is in CMYK mode. The printing four-color mode (CMYK) is a color mode used in color printing. It uses the principle of mixing the three primary colors of the color material, plus black ink, and a total of four colors are mixed and superimposed to form the so-called "full-color printing". Open the electronic file in the computer, directly identify and extract the electronic file of the physical image, and upload the extracted CMYK mode pixel points for subsequent pixel format conversion and correction processing. Compared with identifying physical images, it is more accurate to extract pixel data from electronic files of physical images. However, the data format of electronic files is not in RGB format. Therefore, it is necessary to convert the CMYK mode pixels of the electronic files into RGB mode pixels, so as to obtain a unified RGB mode matrix later, so as to correct the pixels in a unified mode, which is conducive to improving the accuracy of calibration.
[0078] S102: Convert the CMYK mode pixel points into RGB mode pixel points according to the electronic file of the physical image.
[0079] In the embodiment of the present application, the CMYK mode pixel points are converted into RGB mode pixel points through format conversion. Since most image modes are RGB modes and RGB modes are convenient for image correction, in the embodiment of the present application, all image modes are converted into a unified RGB mode for correction, which is beneficial to improve the accuracy of image calibration.
[0080] Since there is no direct conversion relationship between the CMYK mode and the RGB mode, converting CMYK mode pixels to RGB mode pixels includes two steps. First, the CMYK mode pixels need to be converted to CMY mode pixels, and then the CMY mode pixels need to be converted to RGB mode pixels.
[0081] Specifically, Figure 3 The embodiments of the present application provide Figure 2 The specific process diagram of S102, wherein converting the CMYK mode pixel points into RGB mode pixel points according to the electronic file of the physical image includes:
[0082] S1021: Convert the CMYK mode pixel points into CMY mode pixel points according to the electronic file of the physical image.
[0083] The CMY mode is a subtractive color model, mainly used in color printing and printing industry. It consists of three colors: Cyan, Magenta and Yellow, which are the complementary colors of red, green and blue in the color cube. In the CMY mode, colors are produced by absorbing specific colors in light instead of emitting light. The CMY model is opposite to the RGB model, which is an additive color model used in light-emitting devices such as monitors. The characteristic of the CMY mode is that it reduces the reflected light required for the visual system to recognize colors, so it is also called the subtractive color mixing mode.
[0084] Specifically, the values corresponding to the CMYK mode pixel points include C value, M value, Y value and K value, the values corresponding to the CMY mode pixel points include C value, M value and Y value, and converting the CMYK mode pixel points into CMY mode pixel points according to the physical image includes:
[0085] S1: Determine the C value of the pixel point in the CMYK mode according to the C value and K value corresponding to the pixel point in the CMYK mode;
[0086] S2: Determine the M value of the CMY mode pixel point according to the M value and K value corresponding to the CMYK mode pixel point;
[0087] S3: Determine the Y value of the pixel point in the CMYK mode according to the Y value and K value corresponding to the pixel point in the CMYK mode.
[0088] The value of the black ink channel (K) is calculated based on the value of the CMY channel, and the CMY channel is adjusted to a ratio relative to the K channel. This is to ensure that there will be no color distortion during the printing process. In the embodiment of the present application, the CMYK mode pixel point is converted to the CMY mode pixel point by the inverse transformation of the formula.
[0089] The conversion relationship from CMY to CMYK is as follows:
[0090] K=min(C CMYK , M CMYK , Y CMYK )
[0091]
[0092] The conversion relationship from CMYK to CMY can be obtained as follows:
[0093] C CMY =C CMYK (1-K)+K
[0094] M CMY =M CMYK (1-K)+K
[0095] Y CMY =Y CMYK (1-K)+K
[0096] Among them, C CMY 、M CMY , Y CMY They are the C, M, and Y values of the pixels in CMY mode. CMYK , C CMYK , Y CMYK , K are the C, M, Y, and K values of the pixel in CMYK mode respectively.
[0097] S1022: Convert each of the CMY mode pixel points into the RGB mode pixel point according to the electronic file of the physical image.
[0098] Specifically, the values corresponding to the CMY mode pixel points include C value, M value, and Y value, the values corresponding to the RGB mode pixel points include R value, B value, and G value, and the converting of the CMYK mode pixel points into the CMY mode pixel points according to the physical image includes:
[0099] Determine the R value of the pixel point in the RGB mode according to the C value corresponding to the pixel point in the CMY mode and the maximum value in the RGB mode;
[0100] Determine the G value of the pixel point in the RGB mode according to the difference between the M value corresponding to the pixel point in the CMY mode and the maximum value of the RGB mode;
[0101] The B value of the pixel point in the RGB mode is determined according to the difference between the Y value corresponding to the pixel point in the CMY mode and the maximum value of the RGB mode.
[0102] The RGB color model uses three channels, red, green, and blue, to represent various colors. The value range of each channel is 0-255, where 0 represents the absence of the color of the channel and 255 represents the color with the highest saturation of the channel. The maximum value of the RGB mode is 255.
[0103] The CMY value is calculated by mapping the color in the RGB color space to the CMY color space. Since CMY is a subtractive color model, it is necessary to subtract 255 from the value of the RGB channel to obtain the value of the CMY channel.
[0104] The conversion from RGB to CMY has the following conversion relationship:
[0105]
[0106]
[0107] The conversion relationship from CMY to RGB can be obtained as follows:
[0108] R=(1-C CMY )255
[0109] G=(1-M CMY )255
[0110] B=(1-Y CMY )255
[0111] Among them, C CMY 、M CMY , Y CMY They are the C, M, and Y values of pixels in CMY mode respectively.
[0112] S103: Generate a first matrix according to the RGB values corresponding to the RGB mode pixels in the physical image.
[0113] In the embodiment of the present application, a first matrix is generated according to the RGB values corresponding to the pixels in the RGB mode, and each pixel corresponds to an RGB value. Suppose the first matrix is A, then
[0114] This section will introduce the identification and extraction of standard color cards to generate the second matrix. Specifically, Figure 4 The embodiment of this application provides Figure 1 The specific process diagram of S200, wherein the step of identifying and extracting pixels in the standard hue ring to generate a second matrix includes:
[0115] S201: Reading pixel points in the standard color circle, the standard color circle is in HSB mode, and each pixel in the standard color circle is a pixel point in the HSB mode.
[0116] In one possible example, the standard color circle is a physical standard color card. The method in S100 is used to place the standard color card within the sensing range of the color sensor to identify and extract the color data on the standard color card, and the identified and extracted color data is uploaded to automatically generate the second matrix. In another possible embodiment, the standard color circle can also be a virtual color circle, that is, there is no physical color card, and the color palette provided by the software, such as the digital color circle in Photoshop, whose color data is directly recorded in the computer, and the second matrix is automatically generated by identification and extraction.
[0117] S202: Convert the HSB mode pixel point into the RGB mode pixel point according to the standard color circle.
[0118] HSB, also known as HSV, represents a color mode: In the HSB mode, H (hues) represents hue, S (saturation) represents saturation, and B (brightness) represents brightness. The medium corresponding to the HSB mode is the human eye. Hue (H, hue): On the standard color wheel of 0 to 360°, hue is measured by position. In common use, hue is identified by the name of the color, such as red, green or orange, and black and white have no hue. Among them, saturation (S, saturation): represents the purity of the color, and when it is 0, it is gray. White, black and other gray colors have no saturation. At maximum saturation, each hue has the purest color light. The value range is 0 to 100%. Brightness (B, brightness or V, value): is the brightness of the color. When it is 0, it is black. The maximum brightness is the most vivid state of the color. The value range is 0 to 100%.
[0119] The conversion relationship between HSB and RGB is as follows:
[0120]
[0121] B=max
[0122] The conversion relationship from HSB to RGB can be obtained as follows:
[0123]
[0124] p=v×(1-s)
[0125] q=v×(1-f×s)
[0126] t=v×(1-(1-f)×s)
[0127]
[0128] To determine the remainder range, first divide H by 60, take the integer part, then divide by six to get the remainder. The decimal part of H / 60 is the offset value in this color range. i = 0, then the color is in the 0-60° area, if H i =1, then the color is in the 60-120° area, if H i =2, then the color is in the 120-180° area, if H i =3, then the color is in the 180-240° area, if H i =4, then the color is in the 240-300° area. If H i =5, then the color is in the 300-359° area.
[0129] S203: Generate a second matrix according to the RGB values corresponding to the RGB mode pixels in the standard color phase circle.
[0130] In the embodiment of the present application, a first matrix is generated according to the RGB values corresponding to the pixels in the RGB mode, and each pixel corresponds to an RGB value. Suppose the first matrix is B, then
[0131] The calibration matrix is generated according to the first matrix A and the second matrix B. The relationship between the first matrix, the second matrix and the calibration matrix K is as follows:
[0132] A×H=B
[0133]
[0134] Figure 5 The embodiment of this application provides Figure 1 The specific process diagram of S400 in FIG. 1 is as follows: correcting the pixels of the physical image according to the calibration matrix to obtain the target image includes:
[0135] S401: Correcting the RGB mode pixels in the physical image according to the calibration matrix to obtain target RGB values;
[0136] S402: Convert the RGB mode pixel point into the CMY mode pixel point according to the target RGB value;
[0137] S403: Converting the CMY mode pixel points into the CMYK mode pixel points according to the physical image;
[0138] S404: Printing a target image according to the values corresponding to the pixels in the CMYK mode.
[0139] In one possible implementation, the physical image is directly identified and scanned by a sensor, and a first matrix generated by pixels in RGB mode of the physical image is obtained for correction. Another possible implementation is to convert the format of the electronic file of the physical image into RGB mode, and perform correction based on the first matrix generated by pixels in RGB mode.
[0140] In the embodiment of the present application, a calibration matrix is obtained based on the first matrix and the second matrix. The calibration matrix is also a matrix under the RGB mode. All image modes are uniformly converted to the RGB mode for calibration, and then converted into a printable CMYK mode based on the calibrated RGB mode pixels. The steps have been described in detail in S1021-S1022 and will not be repeated here.
[0141] The present application extracts pixel data of a physical image and pixel data of a standard color phase circle to obtain a first matrix and a second matrix respectively, and then obtains a calibration matrix based on the first matrix and the second matrix, calibrates the pixel data of the extracted physical image based on the calibration matrix, outputs the target pixel data obtained by calibration, and obtains a target image based on the target pixel data. The color correction of image pixels can be achieved, and the deviation between the printed physical image and the actual color is effectively solved.
[0142] See also Figure 6 , shows a structural schematic diagram of an image color correction system provided in an embodiment of the present application. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.
[0143] The image color correction system 500 may specifically include the following modules:
[0144] The first matrix module 510 is used to identify and extract pixels in the physical image to generate a first matrix;
[0145] The second matrix module 520 is used to identify and extract pixels in the standard hue ring to generate a second matrix;
[0146] A calibration matrix module 530, configured to generate a calibration matrix according to the first matrix and the second matrix;
[0147] The target image module 540 is used to correct the pixels of the physical image according to the calibration matrix to obtain a target image.
[0148] The first matrix module 510 includes the following units:
[0149] The physical image reading unit 511: places the physical image within the sensing range of the sensor, and the sensor identifies and extracts the color data of the pixels in the physical image to generate a first matrix, wherein the physical image is in RGB mode; or
[0150] Identify and extract color data of pixels in the electronic file of the physical image according to the electronic file, and generate a first matrix, wherein the electronic file of the physical image is in CMYK mode, and each pixel in the electronic file is a pixel in CMYK mode;
[0151] A pixel conversion unit 512 converts the CMYK mode pixel points into RGB mode pixel points according to the electronic file of the physical image;
[0152] The first matrix generating unit 513 generates a first matrix according to the RGB values corresponding to the pixels in the RGB mode in the physical image.
[0153] The pixel conversion unit 512 includes the following sub-units:
[0154] The first unit 5121 converts the CMYK mode pixel points into CMY mode pixel points according to the electronic file of the physical image;
[0155] The second unit 5122 converts each of the CMY mode pixels into the RGB mode pixels according to the electronic file of the physical image.
[0156] The first unit 5121 is specifically used for:
[0157] Determine the C value of the pixel point in the CMYK mode according to the C value and K value corresponding to the pixel point in the CMYK mode;
[0158] Determine the M value of the CMYK mode pixel point according to the M value and K value corresponding to the CMYK mode pixel point;
[0159] Determine the Y value of the pixel point in the CMYK mode according to the Y value and K value corresponding to the pixel point in the CMYK mode.
[0160] The second unit 5122 is specifically used for:
[0161] Determine the R value of the pixel point in the RGB mode according to the C value corresponding to the pixel point in the CMY mode and the maximum value in the RGB mode;
[0162] Determine the G value of the pixel point in the RGB mode according to the difference between the M value corresponding to the pixel point in the CMY mode and the maximum value of the RGB mode;
[0163] The B value of the pixel point in the RGB mode is determined according to the difference between the Y value corresponding to the pixel point in the CMY mode and the maximum value of the RGB mode.
[0164] The second matrix module 520 includes the following units:
[0165] A standard color circle reading unit 521 is used to read pixel points in the standard color circle, where the standard color circle is in HSB mode and each pixel in the standard color circle is a pixel point in HSB mode;
[0166] The third unit 522 converts the HSB mode pixel point into the RGB mode pixel point according to the standard color phase circle;
[0167] The fourth unit 523 generates a second matrix according to the RGB values corresponding to the RGB mode pixels in the standard color phase circle.
[0168] The target image module 540 includes:
[0169] Correcting the RGB mode pixels in the physical image according to the calibration matrix to obtain a target RGB value;
[0170] Convert the RGB mode pixel point to the CMY mode pixel point according to the target RGB value;
[0171] Converting the CMY mode pixel points into the CMYK mode pixel points according to the physical image;
[0172] The target image is printed according to the values corresponding to the pixels in the CMYK mode.
[0173] The image color correction system provided in the embodiment of the present application can be applied in the aforementioned method embodiment. For details, please refer to the description of the aforementioned method embodiment, which will not be repeated here.
[0174] Figure 7 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Figure 7 As shown, the terminal device 700 of this embodiment includes: at least one processor 710 ( Figure 7 Only one is shown in the figure), a memory 720, and a computer program 721 stored in the memory 720 and executable on the at least one processor 710, wherein the processor 710 implements the steps in the above method embodiment when executing the computer program 721.
[0175] The terminal device 700 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 710 and a memory 720. Those skilled in the art will appreciate that Figure 7 It is only an example of the terminal device 700 and does not constitute a limitation on the terminal device 700. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0176] The processor 710 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0177] In some embodiments, the memory 720 may be an internal storage unit of the terminal device 700, such as a hard disk or memory of the terminal device 700. In other embodiments, the memory 720 may also be an external storage device of the terminal device 700, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device 700. Further, the memory 720 may also include both an internal storage unit of the terminal device 700 and an external storage device. The memory 720 is used to store an operating system, an application program, a boot loader (Boot Loader), data and other programs, such as the program code of the computer program, etc. The memory 720 may also be used to temporarily store data that has been output or is to be output.
[0178] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0179] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0180] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0181] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0182] 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.
[0183] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0184] If the integrated module / unit is implemented in the form of 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 present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0185] The present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed through a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing.
[0186] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for image color correction, characterized in that: The method comprises: Identify and extract pixel points in the physical image to generate a first matrix; Identify and extract pixel points in the standard hue ring to generate a second matrix; generating a calibration matrix according to the first matrix and the second matrix; The pixels of the physical image are corrected according to the calibration matrix to obtain a target image.
2. The method according to claim 1, characterized in that: The step of identifying and extracting pixels in the physical image to generate a first matrix includes: The physical image is placed within the sensing range of the sensor, and the sensor identifies and extracts the color data of the pixels in the physical image to generate a first matrix, where the physical image is in RGB mode; or Identify and extract color data of pixels in the electronic file of the physical image according to the electronic file, and generate a first matrix, wherein the electronic file of the physical image is in CMYK mode, and each pixel in the electronic file is a pixel in CMYK mode; Converting the CMYK mode pixel points into RGB mode pixel points according to the electronic file of the physical image; A first matrix is generated according to the RGB values corresponding to the pixels in the RGB mode in the physical image.
3. The method according to claim 2, characterized in that: The step of converting CMYK mode pixels into RGB mode pixels according to the electronic file of the physical image includes: Converting the CMYK mode pixel points into CMY mode pixel points according to the electronic file of the physical image; Each of the CMY mode pixels is converted into the RGB mode pixel according to the electronic file of the physical image.
4. The method according to claim 3, characterized in that: The values corresponding to the CMYK mode pixel points include C value, M value, Y value and K value, the values corresponding to the CMY mode pixel points include C value, M value and Y value, and converting the CMYK mode pixel points into CMY mode pixel points according to the electronic file of the physical image includes: Determine the C value of the pixel point in the CMYK mode according to the C value and K value corresponding to the pixel point in the CMYK mode; Determine the M value of the CMYK mode pixel point according to the M value and K value corresponding to the CMYK mode pixel point; Determine the Y value of the pixel point in the CMYK mode according to the Y value and K value corresponding to the pixel point in the CMYK mode.
5. The method according to claim 3, characterized in that: The values corresponding to the CMY mode pixel points include C value, M value, and Y value, the values corresponding to the RGB mode pixel points include R value, B value, and G value, and the converting of the CMYK mode pixel points into the CMY mode pixel points according to the electronic file of the physical image includes: Determine the R value of the pixel point in the RGB mode according to the C value corresponding to the pixel point in the CMY mode and the maximum value in the RGB mode; Determine the G value of the pixel point in the RGB mode according to the difference between the M value corresponding to the pixel point in the CMY mode and the maximum value of the RGB mode; The B value of the pixel point in the RGB mode is determined according to the difference between the Y value corresponding to the pixel point in the CMY mode and the maximum value of the RGB mode.
6. The method according to claim 1, characterized in that: The step of identifying and extracting pixels in the standard hue ring to generate a second matrix includes: Reading pixel points in the standard color phase circle, the standard color phase circle is in HSB mode, and each pixel in the standard color phase circle is a pixel point in HSB mode; Converting the HSB mode pixel point into the RGB mode pixel point according to the standard color phase circle; A second matrix is generated according to the RGB values corresponding to each of the RGB mode pixels in the standard color phase circle.
7. The method according to claim 1, characterized in that: Correcting the pixels of the physical image according to the calibration matrix to obtain a target image includes: Correcting the RGB mode pixels in the physical image according to the calibration matrix to obtain a target RGB value; Convert the RGB mode pixel point to the CMY mode pixel point according to the target RGB value; Converting the CMY mode pixel points into the CMYK mode pixel points according to the physical image; The target image is printed according to the values corresponding to the pixels in the CMYK mode.
8. An image color correction system, characterized in that: include: A first matrix module, used to identify and extract pixels in the physical image to generate a first matrix; The second matrix module is used to identify and extract pixels in the standard hue ring to generate a second matrix; A calibration matrix module, used for generating a calibration matrix according to the first matrix and the second matrix; The target image module is used to correct the pixel points of the physical image according to the calibration matrix to obtain a target image.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
