Display color gamut compression method and device, electronic terminal and storage medium
By dividing the colors in the first color gamut into colors located inside and outside the second color gamut in the display color gamut, and mapping them using the principle of Lab color space and the minimum color difference, the problem of not having both color reduction and discrimination is solved, and efficient color gamut compression is achieved.
Patent Information
- Application Number
- CN202510231843.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-13
AI Technical Summary
In the prior art, when the color gamut is compressed, it is difficult to take into account both the color reduction degree and the color difference degree.
By dividing the colors in the first color gamut into colors located in the second color gamut and colors outside the second color gamut, the colors located in the second color gamut are not compressed, and the Lab color space and the minimum color difference principle are mapped using the principle of Lab color space and color difference, and the brightness value is modified to keep the color difference minimal.
The color reduction is guaranteed to the greatest extent, and the color difference is improved, solving the problem of not having both color reduction and distinction when gamut compression.
Smart Images

Figure CN120148436A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical education informatization, and particularly to a method, device, electronic terminal and storage medium for compressing the color gamut of a display. Background Art
[0002] With the development of display technology, people's requirements for the image display effect of displays are getting higher and higher, and the accuracy of the colors displayed by displays has attracted more and more attention. Especially in some professional fields, such as the medical field, in the application scenario of laparoscopic surgery, color accuracy and color discrimination will affect the judgment of surgeons, which has a great impact on the success rate and efficiency of surgery. In order to accurately reproduce colors, a display needs to perform color calibration according to the color gamut standard. When the color gamut of the display screen cannot fully cover the color gamut to be calibrated, the color gamut needs to be compressed.
[0003] Color gamut compression is mainly divided into two implementation methods. When the first color gamut is compressed to the second color gamut, in the first method, all colors in the first color gamut are compressed. The advantage of this method is that the relative relationship of the colors in the first color gamut is maintained, and the color discrimination after compression is high; the disadvantage is that the colors that the second color gamut can reproduce in the first color gamut are also compressed, and the color reproduction degree is low. In the second method, the colors that the second color gamut can reproduce in the first color gamut are not compressed, and only the colors that cannot be reproduced are compressed. The advantage of this method is that the color reproduction degree is high, and the disadvantage is that many colors in the first color gamut that cannot be reproduced in the first color gamut will be compressed to the same color, resulting in low color discrimination.
[0004] Therefore, there is an urgent need for a method for compressing the color gamut of a display to solve the above technical problems. Summary of the Invention
[0005] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method for compressing the color gamut of a display, which can solve the technical problem that the color reproduction degree and color discrimination cannot be both achieved during color gamut compression.
[0006] To achieve the above purpose, the present invention is implemented by adopting the following technical solutions: In a first aspect, the present invention provides a method for compressing the color gamut of a display, including: Dividing the colors in the first color gamut into the colors located in the second color gamut and the colors located outside the second color gamut, and not compressing the colors in the first color gamut that are located in the second color gamut; For the colors in the first color gamut that are located outside the second color gamut, converting the colors in the first color gamut and the second color gamut from the RGB color space to the Lab color space; In the Lab color space, mapping the original color points in the first color gamut to the second color gamut according to the principle of the minimum color difference to obtain the mapping points of the original color points in the first color gamut in the second color gamut; Keep the color coordinates of the mapping point unchanged, modify the brightness value of the mapping point to be consistent with the brightness value of the first color gamut, and obtain the final mapping point; Convert the Lab color space data to the RGB color space, complete the color gamut compression based on the final mapping point, and display it on the target device.
[0007] Further, mapping the original color points in the first color gamut to the second color gamut according to the principle of minimum color difference includes: Calculate the color difference according to the color difference calculation formula: , where, represents the color difference, represents the lightness difference, represents the red-green chromaticity difference, represents the yellow-blue chromaticity difference; Find the mapping point in the second color gamut until the color difference between this point and the original color point in the first color gamut is the smallest.
[0008] Further, before mapping the original color points in the first color gamut to the second color gamut according to the principle of minimum color difference: Normalize the brightness of the colors in the first color gamut and the second color gamut to the same numerical interval to eliminate the interference of brightness differences on the final color reduction and discrimination.
[0009] Further, before completing the color gamut compression based on the final mapping point, it also includes: Cluster the image by the K-means clustering algorithm, and according to the clustering result, process the colors related to human tissues so that the colors related to human tissues are preferentially protected during the color gamut compression process.
[0010] Further, processing the colors related to human tissues includes: Combine the sparse non-negative matrix factorization algorithm, solve the staining basis and the structure matrix, and accurately combine the structure matrix and the staining basis according to the clustering result, so as to retain the structural colors related to human tissues.
[0011] In a second aspect, the present invention provides a display color gamut compression device, including: A color discrimination module, configured to divide the colors in the first color gamut into colors located in the second color gamut and colors located outside the second color gamut. For the colors in the first color gamut that are located in the second color gamut, no compression is performed; A space conversion module, for the colors in the first color gamut that are located outside the second color gamut, configured to convert the colors in the first color gamut and the second color gamut from the RGB color space to the Lab color space; A mapping module, configured to map the original color points in the first color gamut to the second color gamut in the Lab color space according to the principle of minimizing color difference, so as to obtain the mapped points of the original color points in the first color gamut in the second color gamut; A brightness modification module, configured to keep the color coordinates of the mapped points unchanged, modify the brightness value of the mapped points to be consistent with the brightness value of the first color gamut, so as to obtain the final mapped points; A display module, configured to convert the Lab color space data to the RGB color space, complete color gamut compression based on the final mapped points, and display on a target device.
[0012] In a third aspect, the present invention provides an electronic terminal, including a processor and a memory connected to the processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the method described in any one of the above are executed.
[0013] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in any one of the above are implemented.
[0014] Compared with the prior art, the beneficial effects achieved by the present invention: In the method for compressing the display color gamut of the present invention, when compressing the first color gamut to the second color gamut, the colors in the first color gamut that are within the second color gamut are not compressed, which maximally guarantees color reproducibility. When compressing the colors in the first color gamut that are outside the second color gamut, first, the mapped points are obtained by minimizing the color difference, ensuring that the mapped points have the smallest color difference from the colors in the first color gamut; if the mapped points with the smallest color difference are directly obtained, a large number of different colors in the first color gamut will be mapped to the same color in the second color gamut. Therefore, in this application, the mapped points are changed while keeping the color coordinates unchanged, which guarantees color reduction; the brightness value of the mapped points is modified to be consistent with the brightness value of the first color gamut. Since the brightness of different colors in the first color gamut can be distinguished from each other and changes uniformly, the distinguishability between the new mapped points is improved, and the color distinguishability is improved while ensuring color reduction. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 FIG. is a flowchart of a method for compressing the display color gamut provided in Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0016] The technical solutions of the present invention will be described in detail below through the accompanying drawings and specific embodiments. It should be understood that the specific features in the embodiments of the present application and the embodiments are detailed descriptions of the technical solutions of the present application, rather than limitations on the technical solutions of the present application. Without conflict, the technical features in the embodiments of the present application and the embodiments can be combined with each other.
[0017] In this article, the term "and / or" is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. Additionally, in this article, the character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0018] The Sparse Nonnegative Matrix Factorization (SNMF) algorithm is a special matrix factorization technique that introduces a sparsity constraint based on Non-negative Matrix Factorization (NMF). The core idea of NMF is to decompose a non-negative data matrix V into the product of two non-negative matrices W and H, i.e., V≈WH. SNMF further constrains the sparsity of W or H on this basis, making the decomposition result more sparse, thereby better revealing the potential structure and features of the data. Embodiment
[0019] Figure 1 is a flowchart of the display color gamut compression method in the first embodiment of the present invention. This flowchart only shows the logical sequence of the method described in this embodiment. On the premise of non-conflict, in other possible embodiments of the present invention, the steps shown or described can be completed in a different Figure 1 order than that shown.
[0020] The display color gamut compression method provided in this embodiment can be applied to a terminal and can be executed by a display color gamut compression device. This device can be implemented in a software and / or hardware manner and can be integrated into the terminal. For example: any smart phone, tablet computer or computer device with communication functions. Refer to Figure 1 As shown, the method of this embodiment specifically includes the following steps: Step 1: Divide the colors in the first color gamut into the colors located in the second color gamut and the colors located outside the second color gamut. For the colors in the first color gamut that are located in the second color gamut, no compression is performed, which maximally ensures color reducibility; Step 2: For the colors in the first color gamut that are located outside the second color gamut, convert the colors in the first color gamut and the second color gamut from the RGB color space to the Lab color space. The mutual conversion of color spaces belongs to existing conventional technologies and will not be elaborated here. In this application, only subsequent operations need to be performed by converting the color space; Step 3: Normalize the brightness of the colors in the first color gamut and the second color gamut to the same numerical range to eliminate the interference of brightness differences on the final color reducibility and distinguishability; In the Lab color space, the original color points in the first color gamut are mapped to the second color gamut according to the principle of minimum color difference, and obtaining the mapped points of the original color points in the first color gamut in the second color gamut includes: Calculating the color difference according to the color difference calculation formula: , wherein, represents the color difference, represents the lightness difference, represents the red-green chromaticity difference, represents the yellow-blue chromaticity difference; Search for the mapped point in the second color gamut until the color difference between this point and the original color point in the first color gamut is the smallest; Step four: Keep the color coordinates of the mapped point unchanged, modify the brightness value of the mapped point to be the same as the brightness value of the first color gamut, and obtain the final mapped point; Step five: Convert the Lab color space data to the RGB color space, complete the color gamut compression based on the final mapped point, and display it on the target device.
[0021] Before completing the color gamut compression based on the final mapped point, it further includes: Clustering the image through the K-means clustering algorithm, identifying structures such as cell nuclei, cytoplasmic matrices, and backgrounds, and according to the clustering results, processing the colors related to human tissues so that the colors related to human tissues are preferentially protected during the color gamut compression process; Among them, processing the colors related to human tissues includes: Combining the sparse non-negative matrix factorization algorithm, solving the staining basis and the structure matrix, and accurately combining the structure matrix and the staining basis according to the clustering results, so as to retain the structural colors related to human tissues, thereby being able to further improve the color accuracy and color discrimination in the application scenario of endoscopic surgery, and improving the surgical success rate and efficiency. Embodiment Two:
[0022] Embodiment Two of the present invention provides a display color gamut compression device, including: A color discrimination module, used to divide the colors in the first color gamut into colors located in the second color gamut and colors located outside the second color gamut, and for the colors in the first color gamut that are located in the second color gamut, no compression is performed; A space conversion module, for the colors in the first color gamut that are located outside the second color gamut, used to convert the colors in the first color gamut and the second color gamut from the RGB color space to the Lab color space; A mapping module, used to map the original color points in the first color gamut to the second color gamut in the Lab color space according to the principle of minimum color difference, and obtain the mapped points of the original color points in the first color gamut in the second color gamut; A brightness modification module, which is used to keep the color coordinates of the mapping point unchanged, modify the brightness value of the mapping point to be consistent with the brightness value of the first color gamut, and obtain the final mapping point; A display module, which is used to convert the Lab color space data to the RGB color space, complete color gamut compression based on the final mapping point, and display it on the target device.
[0023] The display color gamut compression device provided in the second embodiment of the present invention can execute the display color gamut compression method provided in the first embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Embodiment Three:
[0024] The third embodiment of the present invention further provides an electronic terminal, including a processor and a memory connected to the processor. A computer program is stored in the memory, and the processor is used to operate according to the instruction to execute the steps of the method described in Embodiment One, and has the corresponding functional modules and beneficial effects for executing the method. Embodiment Four:
[0025] The fourth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in Embodiment One are implemented, and the corresponding functional modules and beneficial effects for executing the method are achieved.
[0026] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a device, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0027] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (apparatuses), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0028] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one or more of the processes and / or blocks Figure 1 one or more of the processes and / or blocks Figure 1 specified in one or more of the blocks or blocks.
[0029] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one or more of the processes and / or blocks Figure 1 one or more of the processes and / or blocks Figure 1 specified in one or more of the blocks or blocks.
[0030] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims
1. A display color gamut compression method, characterized in that: include: Divide the colors in the first color gamut into colors in the second color gamut and colors outside the second color gamut, and do not compress the colors in the second color gamut; For colors in the first color gamut that are outside the second color gamut, converting the colors in the first color gamut and the second color gamut from the RGB color space to the Lab color space; In the Lab color space, the original color point in the first color gamut is mapped to the second color gamut according to the principle of minimum color difference, so as to obtain the mapping point of the original color point in the first color gamut in the second color gamut; Keeping the color coordinates of the mapping point unchanged, modifying the brightness value of the mapping point to be consistent with the brightness value of the first color gamut, and obtaining a final mapping point; The Lab color space data is converted to the RGB color space, and the color gamut is compressed based on the final mapping point, and displayed on the target device.
2. A display color gamut compression method according to claim 1, characterized in that: Mapping the original color point in the first color gamut to the second color gamut according to the principle of minimum color difference includes: Calculate the color difference according to the color difference calculation formula: , in, Indicates color difference, Indicates brightness difference, Indicates the difference between red and green. Indicates the difference in yellow-blue saturation; Find the mapping point in the second color gamut until the color difference between the point and the original color point in the first color gamut is Minimum.
3. A display color gamut compression method according to claim 2, characterized in that: Before mapping the original color point in the first color gamut to the second color gamut according to the principle of minimum color difference: The brightness of the colors in the first color gamut and the second color gamut is normalized to the same value range to eliminate the interference of brightness difference on the final color reproduction and distinction.
4. The display color gamut compression method according to claim 1, characterized in that: Before completing the color gamut compression based on the final mapping point, the method further includes: The images are clustered by the K-means clustering algorithm, and the colors related to human tissue are processed according to the clustering results, so that the colors related to human tissue are given priority protection in the process of color gamut compression.
5. A display color gamut compression method according to claim 4, characterized in that: Processing of colors associated with human tissue includes: The sparse non-negative matrix factorization algorithm is combined to solve the color base and structure matrix, and the structure matrix and the color base are accurately combined according to the clustering results to retain the structural color related to human tissue.
6. A display color gamut compression device, characterized in that: include: A color distinguishing module, used for distinguishing colors in the first color gamut into colors in the second color gamut and colors outside the second color gamut, and for colors in the first color gamut that are in the second color gamut, no compression is performed; a space conversion module, for converting the colors in the first color gamut and the second color gamut from the RGB color space to the Lab color space, for colors in the first color gamut that are outside the second color gamut; A mapping module, used to map the original color point in the first color gamut to the second color gamut according to the principle of minimum color difference in the Lab color space, so as to obtain the mapping point of the original color point in the first color gamut in the second color gamut; A brightness modification module, used to keep the color coordinates of the mapping point unchanged, modify the brightness value of the mapping point to be consistent with the brightness value of the first color gamut, and obtain a final mapping point; The display module is used to convert the Lab color space data into the RGB color space, complete the color gamut compression based on the final mapping point, and display it on the target device.
7. An electronic terminal, characterized in that: comprising a processor and a memory connected to the processor, The memory stores a computer program, and when the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are performed.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.