Color conversion method and device, equipment, storage medium and computer program product
By calculating the saturation and brightness of the image in the color conversion, the protection weight is determined, and the color conversion matrix is merged to solve the color gamuties and improve the image quality.
Patent Information
- Application Number
- CN202411479797.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-01-28
AI Technical Summary
The prior art has color gamut overflow problems in color conversion, resulting in loss of image details and overflow of highlights, affecting image quality.
By obtaining the RGB data of the original image, the saturation and brightness of the original image is calculated to determine the protection weight of color overflow protection, and integrate the original color conversion matrix with the unit matrix to obtain a new color conversion matrix to avoid color gamut overflow.
Effectively avoid color gamut overflow, reduce data truncation, retain image details, and improve image quality, especially when color gamut overflow.
Smart Images

Figure CN119383280A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image display, and in particular to a color conversion method, a color conversion device, a display device, a storage medium and a computer program product. Background Art
[0002] In camera imaging systems and display systems, color correction and color gamut conversion are often implemented through color conversion matrices. In some application scenarios, since the color gamut before color conversion is larger than the color gamut after conversion, that is, color gamut overflow, the converted data range (after normalization) will be less than 0 or greater than 1. In conventional processing methods, data that exceeds the data range (after normalization) is directly truncated, which will cause problems such as loss of image details and highlight overflow, which will have a significant impact on image quality.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present application is to provide a color conversion method, a color conversion device, a display device, a storage medium and a computer program product, aiming to solve the current technical problem of color conversion for color gamut overflow, that is, the image quality deteriorates after color conversion.
[0005] To achieve the above object, the present application proposes a color conversion method, which includes:
[0006] Acquire an original image and determine RGB data of each pixel of the original image;
[0007] Based on the RGB data of each pixel of the original image, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are merged to obtain a new color conversion matrix;
[0008] The color of the original image is converted by a new color conversion matrix to obtain a target image.
[0009] In one embodiment, the step of fusing the original color conversion matrix and a unit matrix of the same size as the original color conversion matrix based on the RGB data of each pixel of the original image to obtain a new color conversion matrix includes:
[0010] Based on the RGB data of each pixel of the original image, the saturation and brightness of each pixel of the original image are calculated;
[0011] Determining, according to the saturation and brightness of each pixel of the original image, a protection weight for performing color overflow protection on the saturation and brightness;
[0012] The original color conversion matrix and a unit matrix having the same size as the original color conversion matrix are fused by using the protection weights to obtain a new color conversion matrix.
[0013] In one embodiment, the step of calculating the saturation and brightness of each pixel of the original image based on the RGB data of each pixel of the original image includes:
[0014] Based on the maximum and minimum values of the RGB grayscale values of each pixel of the original image, the saturation of each pixel of the original image is calculated;
[0015] Based on the RGB data of each pixel of the original image, the RGB grayscale value of each pixel of the original image and the maximum value of the RGB color component are calculated; according to the preset combination coefficient, the RGB grayscale value of each pixel of the original image and the maximum value of the RGB color component are combined to obtain the brightness of each pixel of the original image.
[0016] In one embodiment, the step of determining, according to the saturation and brightness of each pixel of the original image, a protection weight for performing color overflow protection on the saturation and brightness comprises:
[0017] Determining a first protection weight for saturation overflow protection according to the saturation of each pixel of the original image;
[0018] A second protection weight for brightness overflow protection is determined according to the brightness of each pixel of the original image.
[0019] In one embodiment, the protection weights include a first protection weight for saturation overflow protection and a second protection weight for brightness overflow protection; the step of fusing the original color conversion matrix and a unit matrix of the same size as the original color conversion matrix by using the protection weights to obtain a new color conversion matrix includes:
[0020] The original color conversion matrix and a unit matrix having the same size as the original color conversion matrix are fused by using the respective weight values of the first protection weight and the second protection weight to obtain a new color conversion matrix.
[0021] In one embodiment, the original color conversion matrix and the unit matrix having the same size as the original color conversion matrix are fused with reference to the following formula:
[0022] M n =(1-W s )*(1-W Y )*M o +(W s -W S*W Y +W Y )*M e
[0023] Among them, W s is the first protection weight, W Y is the second protection weight, M o is the original color conversion matrix, M e is a unit matrix of the same size as the original color conversion matrix.
[0024] In addition, to achieve the above-mentioned purpose, the present application also proposes a color conversion device, the color conversion device comprising:
[0025] An acquisition module, used to acquire an original image and determine the RGB data of each pixel of the original image;
[0026] An adjustment module, configured to fuse an original color conversion matrix and a unit matrix having the same size as the original color conversion matrix based on RGB data of each pixel of the original image to obtain a new color conversion matrix;
[0027] The conversion module is used to perform color conversion on the original image through a new color conversion matrix to obtain a target image.
[0028] In addition, to achieve the above-mentioned purpose, the present application also proposes a display device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the color conversion method described above.
[0029] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the color conversion method described above are implemented.
[0030] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the color conversion method described above are implemented.
[0031] One or more technical solutions proposed in this application have at least the following technical effects:
[0032] In the present application, a color conversion method that can achieve color overflow protection is proposed. The original color conversion matrix is adjusted through the RGB data of each pixel of the original image, and the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are merged to obtain a new color conversion matrix that avoids color gamut overflow, and the original image is color converted through the new color conversion matrix to obtain a target image. In the above, by adjusting the original color conversion matrix, it is avoided that the converted data range (after normalization) is less than 0 or greater than 1, and the direct truncation of data that exceeds the data range (after normalization) is reduced, thereby retaining as much image information as possible, improving the image quality problems such as image detail loss and highlight overflow that currently occur in the color conversion process of color gamut overflow, and improving the image quality after color conversion when the color gamut overflows. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0035] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the color conversion method of the present application;
[0036] Figure 2 This is a schematic diagram of the implementation of the first application scenario of the color conversion method of this application;
[0037] Figure 3 This is a schematic diagram of the module structure of the color conversion device according to an embodiment of the present application;
[0038] Figure 4 Schematic diagram of the device structure of the hardware operating environment involved in the color conversion method in the embodiment of the present application.
[0039] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0040] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0041] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0042] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a display device, etc. capable of realizing the above functions. The following takes a display device as an example to illustrate this embodiment and the following embodiments.
[0043] Based on this, the present application embodiment provides a color conversion method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the color conversion method of the present application.
[0044] In this embodiment, the color conversion method includes steps S10 to S30:
[0045] Step S10, acquiring an original image and determining RGB data of each pixel of the original image;
[0046] It should be noted that the RGB data of each pixel of the original image is the grayscale data in the R, G or B channel, and the grayscale data may be close to 0 or 255, that is, the data after normalization of the RGB data is close to 0 or 1, resulting in high saturation or high brightness, which may cause the data range after color gamut conversion (after normalization) to be less than 0 or greater than 1.
[0047] In this embodiment, by adjusting the color conversion matrix, excessive data truncation is prevented in color areas prone to data truncation, mainly including high-saturation and high-brightness areas of the image. In this way, the truncated information in the color conversion can be effectively protected, thereby improving the problems of detail loss and highlight overflow in the image.
[0048] Step S20, based on the RGB data of each pixel of the original image, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are merged to obtain a new color conversion matrix;
[0049] In one embodiment, the original color conversion matrix and the new color conversion matrix are both 3*3 matrices.
[0050] In a feasible implementation manner, the step S20 includes:
[0051] Step S201: Calculate the saturation and brightness of each pixel of the original image based on the RGB data of each pixel of the original image;
[0052] It should be noted that the basic attributes of the original image include pixels, resolution, size, color, bit depth, hue, saturation, brightness, and color channels, etc. In this embodiment, saturation and brightness, which are most relevant to color gamut conversion, are selected as target basic attributes. In this embodiment, there is no limitation on the method of calculating the value of each pixel of the original image on the target basic attribute that is prone to color overflow.
[0053] Step S202: determining a protection weight for color overflow protection on the saturation and brightness according to the saturation and brightness of each pixel of the original image;
[0054] In this embodiment, the saturation and brightness of each pixel of the original image are searched in the saturation and brightness lookup tables respectively to determine the protection weight for color overflow protection on the saturation and brightness. It should be noted that the lookup table is a mapping table, and the table can be manually set to determine the area affected by the overflow and the color area prone to data truncation.
[0055] It should be noted that improving the problem of image quality deterioration after color conversion refers to alleviating the degree of overflow. The most ideal situation is to have no overflow at all. However, the situation of no overflow at all will also affect the actual effect of color conversion. Therefore, in fact, this embodiment determines the lookup table and the corresponding protection weights in the lookup table based on the balance between color gamut overflow and color conversion.
[0056] Step S203: The original color conversion matrix and a unit matrix having the same size as the original color conversion matrix are merged by using the protection weights to obtain a new color conversion matrix.
[0057] In this embodiment, the original color conversion matrix is adjusted by protecting the weights, and the original color conversion matrix and a unit matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix that avoids color gamut overflow, thereby avoiding the situation where the converted data range (after normalization) is less than 0 or greater than 1, and reducing the occurrence of direct truncation of data that exceeds the data range (after normalization).
[0058] In a feasible implementation manner, the step S201 includes:
[0059] Based on the maximum and minimum values of the RGB grayscale values of each pixel of the original image, the saturation of each pixel of the original image is calculated;
[0060] Based on the RGB data of each pixel of the original image, the grayscale value of each pixel of the original image and the maximum value of the RGB color component are calculated; according to the preset combination coefficient, the grayscale value of each pixel of the original image and the maximum value of the RGB color component are combined to obtain the brightness of each pixel of the original image.
[0061] In one embodiment, when calculating the saturation of each pixel of the original image, the following formula may be used for calculation:
[0062]
[0063] Among them, S is the saturation value of a pixel in the original image, max(R,G,B) is the maximum RGB grayscale value of a pixel in the original image, and min(R,G,B) is the minimum RGB grayscale value of a pixel in the original image.
[0064] In one embodiment, when calculating the brightness of each pixel of the original image, the following formula may be used for calculation:
[0065] Y=(1-blend)*(0.299×R+0.587×G+0.114×B)+blend*max(R,G,B)
[0066] Where Y is the brightness value of a pixel in the original image, (0.299×R+0.587×G+0.114×B is a brightness calculation method, where R, G, and B represent the red, green, and blue color component values of a pixel in the image, respectively, and their respective coefficients are determined based on the sensitivity of the human eye to different colors. max(R,G,B) means taking the maximum value of the three color components of red, green, and blue. blend is a parameter between 0 and 1, which is used to control the mixing ratio of combining the grayscale value of each pixel in the original image with the maximum value of the RGB color component.
[0067] In a feasible implementation manner, the step S202 includes:
[0068] Determining a first protection weight for saturation overflow protection according to the saturation of each pixel of the original image;
[0069] A second protection weight for brightness overflow protection is determined according to the brightness of each pixel of the original image.
[0070] In one embodiment, according to the saturation S calculated in the above step S201, a protection weight value WS for the saturation dimension is obtained through a configurable one-dimensional lookup table. The horizontal axis of the one-dimensional lookup table is saturation, and the vertical axis is weight. The greater the saturation, the higher the weight. The maximum weight is 1. The parameters of the lookup table can be adjusted according to the situation.
[0071] In one embodiment, according to the brightness value Y calculated in the above step S201, a protection weight value WY for the brightness dimension is obtained through a configurable one-dimensional lookup table. The horizontal axis of the one-dimensional lookup table is brightness, and the vertical axis is weight. The greater the brightness, the higher the weight. The maximum weight is 1. The parameters of the lookup table can be adjusted according to the situation.
[0072] In a feasible implementation manner, the protection weight includes a first protection weight for saturation overflow protection and a second protection weight for brightness overflow protection; the step S203 includes:
[0073] The original color conversion matrix and a unit matrix having the same size as the original color conversion matrix are fused by using the respective weight values of the first protection weight and the second protection weight to obtain a new color conversion matrix.
[0074] In one embodiment, the original color conversion matrix Mo is adjusted according to the first protection weight WS and the second protection weight WY calculated in the above step S202, and the adjustment method is to fuse the unit matrix Me of the same size as the original color conversion matrix and the original color matrix Mo through two protection weights. It should be noted that, because the preset unit matrix Me does not produce truncation at all, fusing the preset unit matrix Me can reduce the occurrence of truncation and obtain a new color conversion matrix Mn. In other words, the influence of the preset unit matrix Me that does not produce truncation at all is added, thereby reducing the probability of truncation.
[0075] In a feasible implementation manner, the original color conversion matrix and a unit matrix having the same size as the original color conversion matrix are fused with reference to the following formula:
[0076] M n =(1-W s )*(1-W Y )*M o +(W s -W S *W Y +W Y )*M e
[0077] Among them, W s is the first protection weight, W Y is the second protection weight, M o is the original color conversion matrix, M e is a unit matrix of the same size as the original color conversion matrix.
[0078] Step S30, performing color conversion on the original image using a new color conversion matrix to obtain a target image.
[0079] In one embodiment, the new color conversion matrix Mn calculated in step S20 is applied to the current RGB data of the original image to complete the color conversion operation. For example, the latest 3*3 color conversion matrix Mn is multiplied by the RGB data to complete the color conversion operation of the original image.
[0080] It should be noted that the color conversion method proposed in this application can significantly improve the color truncation problem with very little overhead. It can be completed by adding a small amount of calculation and data storage to the existing general solution. The solution is low-cost, simple and efficient.
[0081] In addition, it should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the color conversion method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0082] In one application scenario of the color conversion method of the present application, referring to Figure 2 :
[0083] S11 input RGB: input image RGB data, and then perform color conversion through the matrix.
[0084] S12a Saturation calculation: Calculate the saturation value S at each pixel from the RGB data. One method of calculating saturation is:
[0085]
[0086] S12b brightness calculation: Calculate the brightness data Y at each pixel from the RGB data. One method of calculating brightness is:
[0087] Y=(1-blend)*(0.299×R+0.587×G+0.114×B)+blend*max(R,G,B)
[0088] S13a Saturation overflow protection weight calculation: According to the saturation S calculated by S12a above, a protection weight value WS for the saturation dimension is obtained through a settable one-dimensional lookup table. The horizontal axis of the one-dimensional lookup table is saturation, and the vertical axis is weight. The greater the saturation, the higher the weight. The maximum weight is 1. The lookup table parameters can be adjusted according to the situation.
[0089] S13b brightness overflow protection weight calculation: According to the above S12b, the brightness value Y is calculated, and the protection weight value WY for the brightness dimension is obtained through a settable one-dimensional lookup table. The horizontal axis of the one-dimensional lookup table is brightness, and the vertical axis is weight. The greater the brightness, the higher the weight. The maximum weight is 1. The lookup table parameters can be adjusted according to the situation.
[0090] S14 3x3 matrix adjustment: According to the protection weight coefficients WS and WY calculated by S13a and S13b above, the original 3x3 color conversion matrix Mo is adjusted. The adjustment method is to fuse the unit matrix Me and the original color matrix Mo through two weight protection coefficients. Because the unit matrix Me does not produce truncation at all, the fusion of the unit matrix can reduce the truncation and obtain the new color conversion matrix Mn. The formula is:
[0091] M n =(1-W s )*(1-W Y )*M o +(W s -W S *W Y +W Y )*M e
[0092] S15 color conversion: Apply the matrix Mn calculated in S14 to the current RGB data to complete the color conversion operation.
[0093] This application also provides a color conversion device, please refer to Figure 3 , the color conversion device comprises:
[0094] An acquisition module 10 is used to acquire an original image and determine RGB data of each pixel of the original image;
[0095] An adjustment module 20 is used to merge the original color conversion matrix and a unit matrix of the same size as the original color conversion matrix based on the RGB data of each pixel of the original image to obtain a new color conversion matrix;
[0096] The conversion module 30 is used to perform color conversion on the original image through a new color conversion matrix to obtain a target image.
[0097] In one embodiment, the adjustment module is further used for:
[0098] Based on the RGB data of each pixel of the original image, the saturation and brightness of each pixel of the original image are calculated;
[0099] Determining, according to the saturation and brightness of each pixel of the original image, a protection weight for performing color overflow protection on the saturation and brightness;
[0100] The original color conversion matrix and a unit matrix having the same size as the original color conversion matrix are fused by using the protection weights to obtain a new color conversion matrix.
[0101] In one embodiment, the adjustment module is further used for:
[0102] Based on the maximum and minimum values of the RGB grayscale values of each pixel of the original image, the saturation of each pixel of the original image is calculated;
[0103] Based on the RGB data of each pixel of the original image, the grayscale value of each pixel of the original image and the maximum value of the RGB color component are calculated; according to the preset combination coefficient, the grayscale value of each pixel of the original image and the maximum value of the RGB color component are combined to obtain the brightness of each pixel of the original image.
[0104] In one embodiment, the adjustment module is further used for:
[0105] Determining a first protection weight for saturation overflow protection according to the saturation of each pixel of the original image;
[0106] A second protection weight for brightness overflow protection is determined according to the brightness of each pixel of the original image.
[0107] In one embodiment, the protection weight includes a first protection weight for saturation overflow protection and a second protection weight for brightness overflow protection; the adjustment module is further used to:
[0108] The original color conversion matrix and a unit matrix having the same size as the original color conversion matrix are fused by using the respective weight values of the first protection weight and the second protection weight to obtain a new color conversion matrix.
[0109] In one embodiment, the adjustment module is further used for:
[0110] The original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are fused according to the following formula:
[0111] M n =(1-W s )*(1-W Y )*M o +(W s -W S *W Y +W Y )*M e
[0112] Among them, W s is the first protection weight, W Y is the second protection weight, M o is the original color conversion matrix, M e is a unit matrix of the same size as the original color conversion matrix.
[0113] The color conversion device provided by the present application adopts the color conversion method in the above embodiment, which can solve the technical problem that the image quality deteriorates after the color conversion for color gamut overflow. Compared with the prior art, the beneficial effects of the color conversion device provided by the present application are the same as the beneficial effects of the color conversion method provided by the above embodiment, and the other technical features of the color conversion device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0114] The present application provides a display device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the color conversion method in the above-mentioned embodiment 1.
[0115] Reference below Figure 4 , which shows a schematic diagram of the structure of a display device suitable for implementing the embodiment of the present application. The display device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The display device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0116] like Figure 4As shown, the display device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the display device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the display device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a display device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0117] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0118] The display device provided by the present application adopts the color conversion method in the above embodiment, which can solve the technical problem that the image quality deteriorates after the color conversion for color gamut overflow. Compared with the prior art, the beneficial effects of the display device provided by the present application are the same as the beneficial effects of the color conversion method provided by the above embodiment, and the other technical features in the display device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0119] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0120] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0121] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the color conversion method in the above-mentioned embodiment.
[0122] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0123] The computer-readable storage medium may be included in the display device; or may exist independently without being assembled into the display device.
[0124] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a display device, the display device: obtains an original image and determines the RGB data of each pixel of the original image; based on the RGB data of each pixel of the original image, fuses an original color conversion matrix and a unit matrix of the same size as the original color conversion matrix to obtain a new color conversion matrix; and performs color conversion on the original image through the new color conversion matrix to obtain a target image.
[0125] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0126] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0127] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0128] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned color conversion method, and can solve the technical problem that the current color conversion for color gamut overflow has poor image quality after color conversion. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the color conversion method provided by the above-mentioned embodiment, and will not be repeated here.
[0129] The present application also provides a computer program product, including a computer program, which implements the steps of the color conversion method as described above when executed by a processor.
[0130] The computer program product provided by the present application can solve the technical problem that the image quality deteriorates after the color conversion for color gamut overflow. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the color conversion method provided by the above embodiment, which will not be described in detail here.
[0131] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A color conversion method, characterized in that: The color conversion method comprises: Acquire an original image and determine RGB data of each pixel of the original image; Based on the RGB data of each pixel of the original image, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are merged to obtain a new color conversion matrix; The color of the original image is converted by a new color conversion matrix to obtain a target image.
2. The color conversion method according to claim 1, characterized in that: The step of fusing the original color conversion matrix and a unit matrix of the same size as the original color conversion matrix based on the RGB data of each pixel of the original image to obtain a new color conversion matrix comprises: Based on the RGB data of each pixel of the original image, the saturation and brightness of each pixel of the original image are calculated; Determining, according to the saturation and brightness of each pixel of the original image, a protection weight for performing color overflow protection on the saturation and brightness; The original color conversion matrix and a unit matrix having the same size as the original color conversion matrix are fused by using the protection weights to obtain a new color conversion matrix.
3. The color conversion method according to claim 2, characterized in that: The step of calculating the saturation and brightness of each pixel of the original image based on the RGB data of each pixel of the original image comprises: Based on the maximum and minimum values of the RGB grayscale values of each pixel of the original image, the saturation of each pixel of the original image is calculated; Based on the RGB data of each pixel of the original image, the grayscale value of each pixel of the original image and the maximum value of the RGB color component are calculated; according to the preset combination coefficient, the grayscale value of each pixel of the original image and the maximum value of the RGB color component are combined to obtain the brightness of each pixel of the original image.
4. The color conversion method according to claim 2, characterized in that: The step of determining the protection weight for color overflow protection on the saturation and brightness according to the saturation and brightness of each pixel of the original image comprises: Determining a first protection weight for saturation overflow protection according to the saturation of each pixel of the original image; A second protection weight for brightness overflow protection is determined according to the brightness of each pixel of the original image.
5. The color conversion method according to claim 2, characterized in that: The protection weights include a first protection weight for saturation overflow protection and a second protection weight for brightness overflow protection; the step of fusing the original color conversion matrix and a unit matrix of the same size as the original color conversion matrix by using the protection weights to obtain a new color conversion matrix includes: The original color conversion matrix and a unit matrix having the same size as the original color conversion matrix are fused by using the respective weight values of the first protection weight and the second protection weight to obtain a new color conversion matrix.
6. The color conversion method according to claim 5, characterized in that: The original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are fused according to the following formula: M n =(1-W s )*(1-W Y )*M o +(W s -W S *W Y +W Y )*M e Among them, W s is the first protection weight, W Y is the second protection weight, M o is the original color conversion matrix, M e is a unit matrix of the same size as the original color conversion matrix.
7. A color conversion device, characterized in that: The color conversion device comprises: An acquisition module, used to acquire an original image and determine the RGB data of each pixel of the original image; An adjustment module, configured to fuse an original color conversion matrix and a unit matrix having the same size as the original color conversion matrix based on RGB data of each pixel of the original image to obtain a new color conversion matrix; The conversion module is used to perform color conversion on the original image through a new color conversion matrix to obtain a target image.
8. A display device, characterized in that: The display device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the color conversion method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the color conversion method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the color conversion method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
System and method for correcting colour images
CN101513036A
Image processing method and unit
JP2000134498A
Color conversion apparatus and method
US20090046332A1
Color correction method and apparatus
WO2020037635A1
Cited By
Color conversion method and apparatus, device, storage medium, and computer program product
WO2026086816A1