Coding method and decoding method of color parameters, and non-volatile readable storage medium

By encoding and decoding the color parameters, the problem of low compatibility between display devices and camera devices in color parameters is solved, and higher compatibility and more efficient data processing is achieved.

CN119484847APending Publication Date: 2025-02-18GUANGZHOU SHICHUANG DISPLAY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310944729.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the prior art, the display device and the camera device have low compatibility in color parameters, resulting in the need to modify the device's data processing firmware to achieve mutual compatibility, which is cumbersome and is not conducive to expanding the scope of use of the device.

Method used

Provide a coding method for color parameters, which compresses and encodes to generate parameter encoding data by obtaining color parameters and custom encoding configuration information. This method allows the user to flexibly configure encoding configuration information, so that the generated parameter encoding data can be adapted to different scenarios without modifying the device firmware, thereby improving compatibility.

Benefits of technology

Through the encoding method, the amount of data of color parameters is reduced, the transmission efficiency and processing efficiency are improved, and the compatibility between display devices and camera devices is enhanced, and the interoperability between devices is simplified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484847A_ABST
    Figure CN119484847A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of color parameter processing, and discloses a color parameter encoding method, a color parameter decoding method and a nonvolatile readable storage medium. The color parameter coding method comprises the steps of obtaining color parameters and self-defined coding configuration information, compressing the color parameters according to the coding configuration information to obtain compressed data, and generating parameter coding data according to the coding configuration information and the compressed data. On one hand, since the coding configuration information can be customized, a user can flexibly configure the coding configuration information according to needs, so that the generated parameter coding data can adapt to various scenes, data processing firmware of various devices does not need to be modified, and the compatibility can be improved. And on the other hand, the color parameters can be compressed and coded, so that the data volume of the color parameters can be reduced, and the transmission efficiency and the processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of color parameter processing, and in particular to a color parameter encoding method and decoding method, and a non-volatile readable storage medium. Background Art

[0002] With the in-depth application of camera technology in various scenarios, accurate expression of color becomes more and more important. Usually, the display device sends color parameters to the camera device, and the camera device processes the captured image according to the color parameters, so that the processed image can be displayed more realistically on the display device, thereby reducing the color distortion of the image.

[0003] In the process of implementing the present invention, the inventor found that: the display device A is compatible with the camera device B, but the data structure of the color parameters of the display device A is relatively simple. When the display device A needs to exchange information with the camera device C to display an image, since the data format supported by the display device A is different from the data format supported by the camera device C, the designer needs to modify the data processing firmware of the display device A and the data processing firmware of the camera device C synchronously so that the display device A and the camera device C can be compatible with each other. This method is relatively cumbersome and is not conducive to expanding the scope of use of the display device or the camera device. Summary of the invention

[0004] An object of an embodiment of the present invention is to provide a color parameter encoding method and a decoding method, and a non-volatile readable storage medium, in order to solve the technical problem of low compatibility of related technologies in terms of color parameters.

[0005] In a first aspect, an embodiment of the present invention provides a method for encoding a color parameter, comprising:

[0006] Get color parameters and customized encoding configuration information;

[0007] Compressing the color parameters according to the encoding configuration information to obtain compressed data;

[0008] Generate parameter encoding data according to the encoding configuration information and the compressed data.

[0009] Optionally, the color parameter includes multiple groups of color data, each group of the color data includes an RGB value and a color value corresponding to the RGB value, and the compressing the color parameter according to the encoding configuration information to obtain the compressed data includes:

[0010] Determine single-channel color data according to the encoding configuration information;

[0011] Color coding data corresponding to each of the color values ​​is generated according to the coding configuration information, and the single-channel color data and the plurality of color coding data form compressed data.

[0012] Optionally, the encoding configuration information includes RGB configuration information, and determining the single-channel color data according to the encoding configuration information includes: determining the single-channel color data according to the RGB configuration information.

[0013] Optionally, the RGB configuration information includes the quantity of single-channel color data, bit width information of the single-channel color data, and RGB combination identification information.

[0014] Optionally, the encoding configuration information includes color configuration information, and generating color encoding data corresponding to each color value according to the encoding configuration information includes: generating color encoding data corresponding to each color value according to the color configuration information.

[0015] Optionally, the color configuration information includes a gain value of the color value, a denominator of a target color calculation formula, a bit width flag of single-channel data of the color value, a color space type and a color value sign flag, wherein the gain value is greater than any color value in the color parameters.

[0016] Optionally, generating color coding data corresponding to each color value according to the coding configuration information includes: substituting the gain value, denominator and color value of the color value into the target color calculation formula to obtain color coding data.

[0017] In a second aspect, an embodiment of the present invention provides a method for decoding color parameters, comprising:

[0018] Acquire parameter encoding data, wherein the parameter encoding data includes user-defined encoding configuration information and compressed data;

[0019] The compressed data is decoded according to the encoding configuration information to obtain color parameters.

[0020] Optionally, the compressed data includes single-channel color data and multiple color coding data, and decoding the compressed data according to the coding configuration information to obtain the color parameters includes:

[0021] Determine a plurality of RGB values ​​according to the encoding configuration information and the single-channel color data;

[0022] Decoding each color coded data according to the coding configuration information to obtain a color value;

[0023] A corresponding color value is configured for each of the RGB values. One of the RGB values ​​and the corresponding color value may form a set of color data, and a plurality of sets of the color data may form a color parameter.

[0024] Optionally, the encoding configuration information includes RGB configuration information, and determining a plurality of RGB values ​​according to the encoding configuration information and the single-channel color data includes: determining a plurality of RGB values ​​according to the RGB configuration information and the single-channel color data.

[0025] Optionally, the RGB configuration information includes the quantity of single-channel color data, bit width information of the single-channel color data, and RGB combination identification information.

[0026] Optionally, the encoding configuration information includes color configuration information, and decoding each color encoding data according to the encoding configuration information to obtain a color value includes: decoding each color encoding data according to the color configuration information to obtain a color value.

[0027] Optionally, the color configuration information includes a gain value of the color value, a denominator of a target color calculation formula, a bit width flag of single-channel data of the color value, a color space type and a color value sign flag, wherein the gain value is greater than any color value in the color parameters.

[0028] Optionally, decoding each of the color coded data according to the color configuration information to obtain a color value includes:

[0029] Determining a target color calculation formula from a plurality of preset color calculation formulas according to a bit width flag of the single-channel data of the color value;

[0030] Substitute the gain value, denominator and color value of the color value into the target color calculation formula to obtain the color value.

[0031] In a third aspect, an embodiment of the present invention provides a non-volatile readable storage medium storing computer executable instructions, wherein the computer executable instructions are used to enable an electronic device to execute the above-mentioned color parameter encoding method or the above-mentioned color parameter decoding method.

[0032] In a fourth aspect, an embodiment of the present invention provides an electronic device, including:

[0033] at least one processor; and,

[0034] a memory communicatively connected to the at least one processor; wherein,

[0035] 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 above-mentioned color parameter encoding method or the above-mentioned color parameter decoding method.

[0036] In the color parameter encoding method provided in the embodiment of the present invention, the color parameters and the customized encoding configuration information are obtained, the color parameters are compressed according to the encoding configuration information to obtain compressed data, and the parameter encoding data is generated according to the encoding configuration information and the compressed data. On the one hand, since the encoding configuration information is customizable, the user can flexibly configure the encoding configuration information according to the needs, so that the generated parameter encoding data can adapt to various scenarios without modifying the data processing firmware of various devices, thereby improving compatibility. On the other hand, this embodiment can compress and encode the color parameters, so that the data volume of the color parameters can be reduced, which is conducive to improving transmission efficiency and processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0038] Figure 1 A schematic diagram of the structure of a display system provided by an embodiment of the present invention;

[0039] Figure 2 A schematic diagram of a flow chart of a color parameter encoding method provided by an embodiment of the present invention;

[0040] Figure 3 A schematic diagram of a flow chart of a color parameter decoding method provided by an embodiment of the present invention;

[0041] Figure 4 A schematic diagram of the structure of a color parameter encoding device provided by an embodiment of the present invention;

[0042] Figure 5 A schematic diagram of the structure of a color parameter decoding device provided by an embodiment of the present invention;

[0043] Figure 6 A schematic diagram of a circuit structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0045] It should be noted that, if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, all within the scope of protection of the present invention. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in the present invention do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0046] In a related technology, when a display device receives a color signal, it decodes the color signal and then displays the decoded color signal in the form of an image, thereby restoring the original image. However, due to various factors, the color signal received by the display device has deviations, which will cause the color of the original image to be distorted. Therefore, the display device needs to perform color correction on the color signal.

[0047] In another related technology, the display device can exchange data with the camera device, the camera device captures an image, and sends the image to the display device for display. The camera device provided by the related technology can correct the color signal constituting the image, and then transmit the corrected image to the display device for display, so that the display device can display a more realistic image.

[0048] In another related technology, in order to adapt the performance of the camera device and the display device to display a more realistic image, the camera device with high real-time requirements (such as an endoscope for minimally invasive surgery) can exchange data with the display device, and the display device transmits color parameters to the camera device, and the camera device processes the captured image according to the color parameters, so that the captured image is displayed more realistically on the display device. Usually, the color parameters are expressed in the form of a color mapping table, and the color parameters include RGB colors (red, green, and blue primary colors) used to represent computer digital images and the color space CIEXYZ used for human visual perception. One RGB corresponds to one XYZ. After an RGB digital image is displayed on the display device, the color perceived by the human eye is the corresponding XYZ.

[0049] Usually, the data structure of RGB and XYZ is as follows:

[0050]

[0051]

[0052] The color value of this data structure has a numerical range of 0 to 65535. However, in actual use, the color value used by people ranges from 0.00 to 655.35. When the display device needs to express a numerical range of 0.001 to 10000, the data type in the above data structure needs to be modified. The modification is as follows:

[0053]

[0054] At this time, if the display device and the camera device need to be compatible with each other, the user needs to simultaneously modify the data processing firmware of the display device and the data processing firmware of the camera device. This process is relatively cumbersome and reduces compatibility.

[0055] Based on this, an embodiment of the present invention provides a display system, see Figure 1 The display system 100 includes a camera device 11 and a display device 12, and the camera device 11 is communicatively connected with the display device 12. The camera device 11 is used to capture images and send the images to the display device 12 for display.

[0056] In order to restore the image captured by the camera device 11 more realistically on the display device 12, the display device 12 compresses and encodes the color parameters to obtain color coding data, and sends the color coding data to the camera device 11. The camera device 11 decodes the color coding data to obtain color parameters, processes the captured image according to the color parameters to obtain a processed image, and sends the processed image to the display device 12. The display device 12 restores and displays the processed image more realistically.

[0057] As another aspect of the present invention, the present invention provides a method for encoding color parameters. Figure 2 , the color parameter encoding method includes the following steps:

[0058] S21: Obtain color parameters and customized encoding configuration information.

[0059] In this step, the color parameter is characteristic data used to perform color correction on the image, wherein the characteristic data is data associated with the color display of the display device, as shown in Table 1 below. The characteristic data of each display device may be the same or different, that is, the color parameters of different display devices may be the same or different. The camera device may correct the image based on the color parameter in combination with the color correction algorithm to obtain a corrected image.

[0060] In some embodiments, the color parameters are recorded in a color mapping table. Please refer to Table 1, the color mapping table is shown in Table 1:

[0061] Table 1

[0062] index R G B X Y Z 0 0 0 0 0.32 0.32 0.69 1 0 0 128 1.26 0.70 5.61 2 0 0 256 5.29 2.36 26.82 3 0 0 512 23.48 9.80 123.14 4 0 0 768 59.93 24.71 316.25 5 0 0 1023 104.93 42.93 554.53

[0063] The coding configuration information is used to instruct the electronic device to encode the color parameter, wherein the coding configuration information can be customized by the user. It is understandable that the user can customize the coding configuration information according to the business logic.

[0064] S22: compressing the color parameters according to the encoding configuration information to obtain compressed data.

[0065] In this step, the compressed data is data obtained by compressing and encoding the color parameters by the camera device according to the encoding configuration information.

[0066] S23: Generate parameter encoding data according to the encoding configuration information and the compressed data.

[0067] In this step, the embodiment stores the encoding configuration information and the compressed data in the corresponding storage area in sequence to obtain parameter encoding data. Since the encoding configuration information is customizable, the user can flexibly configure the encoding configuration information according to the needs, so that the generated parameter encoding data can adapt to various scenarios without modifying the data processing firmware of various devices, thereby improving compatibility. In addition, the embodiment can compress and encode the color parameters, so that the data volume of the color parameters can be reduced, which is conducive to improving transmission efficiency and processing efficiency.

[0068] Please combine Figure 1 The display device compresses and encodes the color mapping table into parameter encoding data according to the encoding configuration information, and sends the parameter encoding data to the camera device. The camera device decodes the parameter encoding data and restores the color mapping table. The camera device performs color correction on the captured image according to the color parameters given in the color mapping table and the color correction algorithm, and then sends the corrected image to the display device for display. In this way, the display device can display a more realistic image.

[0069] In some embodiments, the color parameters include multiple sets of color data, each set of color data includes RGB values ​​and color values ​​corresponding to the RGB values, wherein the color values ​​can be represented by any color space, and the color space can be a CIEXYZ color space, a CIELAB color space, or a CIELCH color space. For example, the color values ​​are represented by a CIEXYZ color space, wherein the color values ​​include three stimulus X values, Y values, and Z values.

[0070] Please refer to Table 2. The color parameters are shown in Table 2:

[0071] Table 2

[0072]

[0073]

[0074] As shown in Table 2, the color mapping table includes 216 groups of color data, each group of color data includes RGB values ​​and color values ​​corresponding to the RGB values, wherein the color values ​​are represented using the CIEXYZ color space. In the 0th group of color data, the RGB value is (0,0,0), and the color value XYZ is (0.32,0.32,0.69).

[0075] In some embodiments, color parameters are compressed according to encoding configuration information to obtain compressed data, including: determining single-channel color data according to the encoding configuration information, generating color encoding data corresponding to each color value according to the encoding configuration information, and the single-channel color data and multiple color encoding data constitute compressed data.

[0076] The single-channel color data is used to represent the single-channel color value corresponding to the RGB screen. For example, this embodiment uses 6 single-channel color data, wherein the 6 single-channel color data are {0, 128, 256, 512, 768, 1023}, and any single-channel color data in the RGB screen is one of the above 6 single-channel color data, that is, the single-channel color data can be any one of {0, 128, 256, 512, 768, 1023}. For example, if the single-channel color data is 0, then the single-channel color The data can be expressed as RGB[0]. For example, if the single-channel color data is 128, the single-channel color data can be expressed as RGB[1]. For example, if the single-channel color data is 256, the single-channel color data can be expressed as RGB[2]. For example, if the single-channel color data is 512, the single-channel color data can be expressed as RGB[3]. For example, if the single-channel color data is 768, the single-channel color data can be expressed as RGB[4]. For example, if the single-channel color data is 1023, the single-channel color data can be expressed as RGB[5].

[0077] In some embodiments, the RGB value may be composed of any three single-channel color data. As shown in Table 2, in each RGB value, any single-channel color data is any one of {0, 128, 256, 512, 768, 1023}.

[0078] In some embodiments, the encoding configuration information includes RGB configuration information, and determining the single-channel color data according to the encoding configuration information includes: determining the single-channel color data according to the RGB configuration information. The RGB configuration information includes the number of single-channel color data, the bit width information of the single-channel color data, and RGB combination identification information.

[0079] The number of single-channel color data can be customized by the user. As mentioned above, the number of single-channel color data is 6, wherein the single-channel color data is any one of {0, 128, 256, 512, 768, 1023}.

[0080] The bit width information of the single-channel color data is the number of bits occupied by the single-channel color data in the storage area. The bit width information of the single-channel color data can be customized by the user. For example, the bit width information of the single-channel color data is 10.

[0081] The RGB combination identification information is used to indicate the RGB combination mode constituting the RGB picture, for example, the RGB combination mode includes the first combination mode, the second combination mode or the third combination mode represented by the 3DLut mode.

[0082] The first combination method records the RGB picture in the (R0, G0, B0, R1, G1, B1, ..., Rn, Gn, Bn) format, where each R, G, B combination represents an RGB picture, and the number of RGB pictures Count = Num / 3, where Num is the number of single-channel color data.

[0083] The second combination method records the RGB pictures in the (R0, R1, ..., Rn) format. This embodiment uses the (R0, R0, R0), (R1, R1, R1), ..., (Rn, Rn, Rn) format to represent each RGB picture, and the number of RGB pictures Count = Num.

[0084] The third combination method records the RGB picture in the (R0, R1, ..., Rn) format. However, the picture is a 3DLut combination. The expression of the RGB picture is (C(Rn, 1), C(Rn, 1), C(Rn, 1)). The number of RGB pictures Count = Num*Num*Num.

[0085] When the single-channel color data can be any one of {0, 128, 256, 512, 768, 1023}, the single-channel color data includes RGB[0], RGB[1], RGB[2], RGB[3], RGB[4], RGB[5].

[0086] The amount of single-channel color data is stored in a preset first storage area, the bit width information and RGB combination identification information of the single-channel color data are stored together in a preset second storage area, and the single-channel color data is stored in a preset third storage area, wherein the first storage area, the second storage area and the third storage area are adjacent in sequence, and the number of bytes in any storage area of ​​the first storage area, the second storage area and the third storage area is programmable.

[0087] In some embodiments, the number of bytes in the first storage area is 2. In this embodiment, 2 bytes are allocated as the first storage area to store the number of single-channel color data. In this embodiment, the PatNum field may be used to represent the number of single-channel color data, and an unsigned short integer type unsigned short is used to declare the PatNum field, wherein the unsigned short integer type unsigned short occupies 2 bytes.

[0088] In some embodiments, the number of bytes in the second storage area is 1. This embodiment opens up 1 byte as the second storage area to store the bit width information and RGB combination identification information of the single-channel color data, wherein the low-order address of the second storage area is used to store the bit width information N of the single-channel color data, and the high-order address is used to store the RGB combination identification information PFlag. This embodiment can use the PatFlag field to represent the bit width information and RGB combination identification information of the single-channel color data, and use an unsigned byte type unsigned char to declare the PatFlag field, wherein the unsigned byte type unsigned char occupies 1 byte.

[0089] In some embodiments, the present embodiment determines the number of bytes of the single-channel color data according to the bit width information of the single-channel color data. For example, the present embodiment calculates the number of bytes of the single-channel color data according to the following formula, which is as follows: Pn=(N+7) / 8, where Pn is the number of bytes of the single-channel color data, and N is the bit width information of the single-channel color data. If the bit width information of the single-channel color data is 10, the number of bytes of the single-channel color data Pn is 2.

[0090] In some embodiments, the number of bytes in the third storage area is Num*Pn, where Num is the number of single-channel color data, and Pn is the number of bytes of the single-channel color data. For example, if Num is 6 and Pn is 2, the number of bytes in the third storage area is 12. In this embodiment, Num*Pn bytes are allocated as the third storage area to store single-channel color data. In this embodiment, the RGB[] field can be used to represent the single-channel color data, and unsigned char is used to declare the RGB[] field.

[0091] If the byte positions of the first storage area are J to J+1, the byte positions of the second storage area are J+2, and the byte positions of the third storage area are J+3 to J+3+Num*Pn-1.

[0092] Please refer to Table 3, the storage diagram of the first storage area, the second storage area and the third storage area is as follows:

[0093] Table 3

[0094]

[0095] As shown in Table 3, bits 0 to 15 of byte 0 and byte 1 are used to store the number of single-channel color data. Bits 0 to 5 of byte 2 are used to store the bit width information of single-channel color data, and bits 6 to 7 are used to store RGB combination identification information. Bytes 3 to 3+Num*Pn-1 are used to store single-channel color data.

[0096] It is understandable that the number of bytes in the first storage area, the second storage area and the third storage area is programmable. For example, the first storage area is set to 1 byte to store the number of single-channel color data, or, due to different RGB combinations that constitute the RGB screen, the number of bytes in the third storage area may also be different. In this way, the number of bytes of the storage area can be flexibly adjusted according to the needs of the user, which is conducive to reducing the amount of data.

[0097] In some embodiments, the encoding configuration information includes color configuration information, and generating color encoding data corresponding to each color value according to the encoding configuration information includes: generating color encoding data corresponding to each color value according to the color configuration information.

[0098] The color coding data is the coding value corresponding to the color value. In conjunction with Table 1, in this embodiment, the tristimulus value X=0.32 can be coded into 64960, 64960 is the coding value when the tristimulus value X is 0.32, the tristimulus value Y=0.32 is coded into 64960, and the tristimulus value Z=0.69 is coded into 58469. Therefore, the color coding data of the color value XYZ is (64960, 64960, 58469).

[0099] The color configuration information includes the gain value of the color value, the denominator of the target color calculation formula, the bit width flag of the single channel data of the color value, the color space type and the color value sign flag, wherein the gain value is greater than any color value in the color parameter.

[0100] The gain value of the color value is a value used to assist in calculating the color coding data, wherein the gain value is greater than any color value in the color parameter. As shown in Table 2, the value range of the color value XYZ is 0.32 to 659.10, and this embodiment selects 660 as the gain value. This embodiment may use the Gain field to represent the gain value of the color value, and use an unsigned long integer type unsigned long to declare the Gain field, wherein the unsigned long integer type unsigned long occupies 4 bytes.

[0101] The target color calculation formula is a color calculation formula for calculating color coding data, wherein the color calculation formula is an exponential formula, and the exponent includes a numerator and a denominator. There are multiple color calculation formulas, wherein the multiple color calculation formulas are as follows:

[0102] C = Gain * 2 -(T / K) ......(SFlag = 0)

[0103] C = Gain * 2 - (T / K) ......(SFlag = 1 && S < 0)

[0104] C = -Gain * 2 -(S / K) ......(SFlag = 1 && S >= 0)

[0105]

[0106] As described above, K is the denominator. Among them, in this embodiment, any one of the above three color calculation formulas can be selected as the target color calculation formula to calculate the color coding data.

[0107] This embodiment can use the Denom field to represent the denominator, and use the unsigned short integer type to declare the Denom field. Among them, the unsigned short integer type occupies 2 bytes.

[0108] The bit width flag of the single-channel data of the color value is the flag for calculating the bit width of the single-channel data of the color value. Among them, the bit width Cn of the single-channel data of the color value = 8 + M * 4, Cn is the bit width of the color value, and M is the bit width flag of the single-channel data of the color value. For example, if M = 2, then the bit width Cn of the single-channel data of the color value is 16, that is, the bit width of the color coding data corresponding to each single-channel data of the color value is 16 bits. For example, the bit width of the color coding data corresponding to the single-channel data X of the color value XYZ is 16 bits, the bit width of the color coding data corresponding to the single-channel data Y is 16 bits, and the bit width of the color coding data corresponding to the single-channel data Z is 16 bits.

[0109] The color space type is used to represent the color value. Among them, the color space type includes the CIEXYZ color space, the CIELAB color space, or the CIELCH color space. Among them, when the color space type is 0, this embodiment adopts the CIEXYZ color space. When the color space type is 1, this embodiment adopts the CIELAB color space. When the color space type is 2, this embodiment adopts the CIELCH color space.

[0110] The color value sign flag is used to indicate whether the color value is signed. Among them, the color value sign is the flag SFLag. When SFLag is 0, the color coding data is unsigned data. When SFLag is 1, the color coding data is signed data, and the highest bit of T is the sign bit.

[0111] In this embodiment, the ColorPara field may be used to jointly represent the bit width flag, color space type, and color value sign flag of single-channel data of the color value, and an unsigned byte type unsigned char may be used to declare the ColorPara field.

[0112] In this embodiment, the Color[] field can be used to represent the numerator of the target color calculation formula, and unsigned char is used to declare the Color[] field. The color encoding data provided in this embodiment is the numerator of the target color calculation formula.

[0113] The gain value of the color value is stored in a preset fourth storage area, the denominator of the target color calculation formula is stored in a preset fifth storage area, the bit width flag, color space type and color value symbol flag of the single channel data of the color value are stored together in a preset sixth storage area, and each color encoding data is stored in a preset seventh storage area, wherein the fourth storage area, the fifth storage area, the sixth storage area and the seventh storage area are adjacent in sequence, and the number of bytes in any storage area of ​​the fourth storage area, the fifth storage area, the sixth storage area and the seventh storage area is programmable.

[0114] In some embodiments, the number of bytes in the fourth storage area is 4. In this embodiment, 4 bytes are allocated as the fourth storage area to store the gain value of the color value.

[0115] In some embodiments, the number of bytes in the fifth storage area is 2. In this embodiment, 2 bytes are allocated as the fifth storage area to store the denominator of the target color calculation formula.

[0116] In some embodiments, the number of bytes in the sixth storage area is 2. This embodiment allocates 2 bytes as the sixth storage area to store the bit width flag, color space type and color value symbol flag of single channel data of the color value.

[0117] In some embodiments, the number of bytes in the seventh storage area is Cnum=(3*Count*Cn+7) / 8, where Count is the number of RGB images and Cn is the bit width of the single-channel data of the color value. In this embodiment, Cnum bytes are allocated to store multiple color coding data. When the color coding data is a molecule, every two bytes in the seventh storage area are molecules corresponding to each single-channel data of the color value. The data stream is expressed as follows:

[0118] Color[0][0],Color[0][1],Color[0][2],Color[1][0],Color[1][1],Color[1][2],Color[2][0],Color[2][1],Color[2][2],...Color[Count][0],Color[Count][1],Color[Count][2].

[0119] If the byte position of the fourth storage area is CAddr to CAddr+3, the byte position of the fifth storage area is CAddr+4 to CAddr+5, the byte position of the sixth storage area is CAddr+6, and the byte position of the seventh storage area is CAddr+7 to CAddr+7+Cnum-1.

[0120] Please refer to Table 4, the storage diagram of the fourth storage area, the fifth storage area, the sixth storage area and the seventh storage area is as follows:

[0121] Table 4

[0122]

[0123] In some embodiments, generating color coding data corresponding to each color value according to the coding configuration information includes: substituting the gain value, denominator and color value of the color value into a target color calculation formula to obtain the color coding data.

[0124] Based on the encoding method provided in this embodiment, the data structure used for transmitting parameter encoding data in this embodiment may be:

[0125]

[0126]

[0127] Users can modify the PatNum field, PatFlag field, RGB[] field, Gain field, Denom field, ColorPara field or Color[][3] field according to their own needs without having to re-modify the declaration type or definition type of each data, so as to achieve compatibility between different display devices and different camera devices, or to achieve compatibility between the same display device or camera device after system upgrade.

[0128] Please refer to Table 2. The gain value is 660, the denominator K is 5900, and the target color calculation formula is C = Gain * 2 -(T / K). When the X value of the color value XYZ is 0.32, that is, C=0.32, the gain value, denominator and color value of the color value are substituted into the target color calculation formula, and the numerator T0_0 is 64960. Since the numerator T0_0 is the color encoding data, the color encoding data is 64960. When the Y value of the color value XYZ is 0.32, the numerator T1_0 is 64960, so the color encoding data is 64960. When the Z value of the color value XYZ is 0.69, the numerator T2_0 is 64960, so the color encoding data is 58469, and so on.

[0129] Please refer to Table 2. The color data in Table 2 is recorded in 3D LUT mode. The bit width of the single-channel color data of RGB is 10 bits. The number of single-channel color data is 6, RGB[6]={0,128,256,512,768,1023}.

[0130] The color value in Table 2 ranges from 0.32 to 659.1, so the gain of the color value is 660. To reduce the amount of data, the bit width of the single-channel data of the color value is 16 bits, the denominator is 5900, the color space type is CIEXYZ, and all color values ​​are positive numbers, which are unsigned numbers. The color parameters provided in Table 2 are compressed and encoded using the encoding method provided in this embodiment to obtain Table 5, wherein Table 5 shows part of the encoded data, as shown in Table 5:

[0131] Table 5

[0132]

[0133]

[0134] Combining Table 2 and Table 5, it can be seen that if the color parameters shown in Table 2 are directly transmitted to the camera device without compression encoding, according to the data structure provided by the relevant technology, since unsigned short needs to occupy 2 bytes and float needs to occupy 4 bytes, then, to transmit the color parameters in Table 2, 216*(2+2+2+4+4+4)=3,888 bytes are required.

[0135] If the parameter encoding data given in Table 3 is transmitted to the camera device after compression encoding, according to the data structure provided in this embodiment, to transmit the parameter encoding data in Table 3, it can be seen from Table 3 that this embodiment requires 1312 bytes. 1312 bytes is more than twice as much as 3888 bytes, which indicates that the method provided in this embodiment can compress the color difference parameters to a large extent, reduce the amount of data, and help improve the transmission efficiency.

[0136] As another aspect of the present invention, the present invention provides a method for decoding color parameters. Figure 3 , the color parameter decoding method includes the following steps:

[0137] S31: Obtain parameter coding data, wherein the parameter coding data includes user-defined coding configuration information and compressed data.

[0138] S32: Decode the compressed data according to the encoding configuration information to obtain color parameters.

[0139] Since the encoding configuration information is customizable, users can flexibly configure the encoding configuration information according to their needs. Electronic devices can flexibly decode compressed data according to the encoding configuration information, thereby obtaining color parameters suitable for various scenarios without modifying the data processing firmware of various devices, thereby improving compatibility.

[0140] In some embodiments, the compressed data includes single-channel color data and multiple color encoding data. The compressed data is decoded according to the encoding configuration information to obtain the color parameters, including: determining multiple RGB values ​​according to the encoding configuration information and the single-channel color data, decoding each color encoding data according to the encoding configuration information to obtain the color value, and configuring a corresponding color value for each RGB value. An RGB value and a corresponding color value can form a set of color data, and multiple sets of color data can form color parameters.

[0141] In some embodiments, the encoding configuration information includes RGB configuration information, and determining multiple RGB values ​​according to the encoding configuration information and the single-channel color data includes: determining multiple RGB values ​​according to the RGB configuration information and the single-channel color data. The RGB configuration information includes the number of single-channel color data, the bit width information of the single-channel color data, and the RGB combination identification information.

[0142] Please refer to Table 5. The camera device determines the number of RGB values ​​that need to be restored based on the number of single-channel color data and the RGB combination identification information, determines the specific value of each restored RGB value based on the single-channel color data, reads data from the corresponding storage area based on the bit width information of the single-channel color data, and according to the above operations, the camera device can restore multiple RGB values ​​under the guidance of the number of single-channel color data, the bit width information of the single-channel color data, the RGB combination identification information and the single-channel color data. The camera device can restore the various RGB values ​​shown in Table 2 based on the number of single-channel color data, the bit width information of the single-channel color data, the RGB combination identification information and the single-channel color data in Table 5.

[0143] In some embodiments, the encoding configuration information includes color configuration information, and decoding each color encoding data according to the encoding configuration information to obtain a color value includes: decoding each color encoding data according to the color configuration information to obtain a color value.

[0144] The color configuration information includes the gain value of the color value, the denominator of the target color calculation formula, the bit width flag of the single channel data of the color value, the color space type and the color value sign flag, wherein the gain value is greater than any color value in the color parameter.

[0145] Decoding each color encoding data according to the color configuration information to obtain a color value includes: determining a target color calculation formula from a plurality of preset color calculation formulas according to the bit width flag of the single channel data of the color value, substituting the gain value, denominator and color value of the color value into the target color calculation formula to obtain the color value. Please refer to Table 5, the bit width flag of the single channel data of the color value is SFlag is 0, and this embodiment selects C = Gain*2 -(T / K) As a target color calculation formula, the gain value, denominator and color value of the color value are substituted into the target color calculation formula to obtain the color value.

[0146] As shown in Table 5, substituting T0_0=64960, gain value Gain=660, and K=5900 into the target color calculation formula, we get X0=0.32. Substituting T1_0=64960, gain value Gain=660, and K=5900 into the target color calculation formula, we get Y0=0.32. Substituting T2_0=58469, gain value Gain=660, and K=5900 into the target color calculation formula, we get Z0=0.69.

[0147] After the above decoding operation, the present embodiment can decode and obtain the color parameters shown in Table 2 based on Table 5. The camera device performs color correction on the captured image according to the color parameters and in combination with the color correction algorithm, and then sends the corrected image to the display device for display, so that the display device can display a more realistic image.

[0148] It should be noted that, in each of the above-mentioned embodiments, there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.

[0149] As another aspect of the present invention, the present invention provides a color parameter encoding device. Figure 4 The color parameter encoding device 400 includes a color parameter acquisition module 41, a data compression module 42 and a code generation module 43.

[0150] The color parameter acquisition module 41 is used to acquire color parameters and customized encoding configuration information, the data compression module 42 is used to compress the color parameters according to the encoding configuration information to obtain compressed data, and the encoding generation module 43 is used to generate parameter encoding data according to the encoding configuration information and compressed data.

[0151] On the one hand, since the encoding configuration information is customizable, the user can flexibly configure the encoding configuration information as needed, so that the generated parameter encoding data can adapt to various scenarios without modifying the data processing firmware of various devices, thereby improving compatibility. On the other hand, this embodiment can compress and encode the color parameters, so that the amount of color parameter data can be reduced, which is conducive to improving transmission efficiency and processing efficiency.

[0152] In some embodiments, the color parameters include multiple groups of color data, each group of color data includes RGB values ​​and color values ​​corresponding to the RGB values, and the data compression module 42 is specifically used to: determine single-channel color data according to the encoding configuration information, generate color coding data corresponding to each color value according to the encoding configuration information, and the single-channel color data and multiple color coding data constitute compressed data.

[0153] In some embodiments, the encoding configuration information includes RGB configuration information, and the data compression module 42 is further specifically configured to: determine single-channel color data according to the RGB configuration information.

[0154] In some embodiments, the RGB configuration information includes the quantity of single-channel color data, the bit width information of the single-channel color data, and RGB combination identification information.

[0155] In some embodiments, the encoding configuration information includes color configuration information, and the data compression module 42 is further specifically configured to generate color encoding data corresponding to each color value according to the color configuration information.

[0156] In some embodiments, the color configuration information includes the gain value of the color value, the denominator of the target color calculation formula, the bit width flag of the single channel data of the color value, the color space type and the color value sign flag, wherein the gain value is greater than any color value in the color parameter.

[0157] In some embodiments, the data compression module 42 is further specifically used to: substitute the gain value, denominator and color value of the color value into the target color calculation formula to obtain color coding data.

[0158] It should be noted that the color parameter encoding device described above can execute the color parameter encoding method provided in the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in the color parameter encoding device embodiment, please refer to the color parameter encoding method provided in the embodiment of the present invention.

[0159] As another aspect of the present invention, the present invention provides a color parameter decoding device. Figure 5 The color parameter decoding device 500 includes a coding data acquisition module 51 and a parameter decoding module 52.

[0160] The coding data acquisition module 51 is used to acquire parameter coding data, wherein the parameter coding data includes user-defined coding configuration information and compressed data.

[0161] The parameter decoding module 52 is used to decode the compressed data according to the encoding configuration information to obtain color parameters.

[0162] In some embodiments, the compressed data includes single-channel color data and multiple color encoding data. The parameter decoding module 52 is specifically used to: determine multiple RGB values ​​according to the encoding configuration information and the single-channel color data, decode each color encoding data according to the encoding configuration information to obtain a color value, and configure a corresponding color value for each RGB value. An RGB value and a corresponding color value can form a group of color data, and multiple groups of color data can form color parameters.

[0163] In some embodiments, the encoding configuration information includes RGB configuration information, and the parameter decoding module 52 is further specifically used to: determine multiple RGB values ​​according to the RGB configuration information and the single-channel color data.

[0164] In some embodiments, the RGB configuration information includes the quantity of single-channel color data, the bit width information of the single-channel color data, and RGB combination identification information.

[0165] In some embodiments, the encoding configuration information includes color configuration information, and the parameter decoding module 52 is further specifically configured to: decode each color encoding data according to the color configuration information to obtain a color value.

[0166] In some embodiments, the color configuration information includes a gain value of the color value, a denominator of a target color calculation formula, a bit width flag of a single channel data of the color value, a color space type, and a color value sign flag, wherein the gain value is greater than any color value in the color parameters.

[0167] In some embodiments, the parameter decoding module 52 is also specifically used to: determine a target color calculation formula from multiple preset color calculation formulas according to the bit width flag of the single-channel data of the color value, substitute the gain value, denominator and color value of the color value into the target color calculation formula to obtain the color value.

[0168] It should be noted that the above-mentioned color parameter decoding device can execute the color parameter decoding method provided in the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in the color parameter decoding device embodiment, please refer to the color parameter decoding method provided in the embodiment of the present invention.

[0169] See also Figure 6 , Figure 6 The circuit structure diagram of an electronic device provided by an embodiment of the present invention is shown in FIG. 1 , wherein the electronic device may be a display device or a camera device. Figure 6 As shown, the electronic device 600 includes one or more processors 61 and a memory 62. Figure 6 A processor 61 is taken as an example.

[0170] The processor 61 and the memory 62 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0171] The memory 62, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the color parameter encoding method or decoding method in the embodiment of the present invention. The processor 61 executes various functional applications and data processing of the color parameter encoding device or decoding device by running the non-volatile software programs, instructions and modules stored in the memory 62, that is, realizes the color parameter encoding method or decoding method provided in the above method embodiment and the functions of each module or unit in the above device embodiment.

[0172] The memory 62 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 62 may optionally include a memory remotely arranged relative to the processor 61, and these remote memories may be connected to the processor 61 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0173] The program instructions / modules are stored in the memory 62, and when executed by the one or more processors 61, the color parameter encoding method or decoding method in any of the above method embodiments is executed.

[0174] An embodiment of the present invention further provides a non-volatile computer storage medium, wherein the non-volatile computer storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors, such as Figure 6A processor 61 in the embodiment may enable the one or more processors to execute the color parameter encoding method or decoding method in any of the above method embodiments.

[0175] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by an electronic device, the electronic device executes any one of the color parameter encoding methods or decoding methods.

[0176] The above described device or equipment embodiments are merely illustrative, wherein the unit modules described as separate components may or may not be physically separated, and the components displayed as module units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network module units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0177] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0178] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Under the concept of the present invention, the technical features in the above embodiments or different embodiments may also be combined, the steps may be implemented in any order, and there are many other changes in different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they may still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for encoding color parameters, characterized in that: include: Get color parameters and customized encoding configuration information; Compressing the color parameters according to the encoding configuration information to obtain compressed data; Generate parameter encoding data according to the encoding configuration information and the compressed data.

2. The encoding method according to claim 1, characterized in that The color parameters include multiple groups of color data, each group of the color data includes RGB values ​​and color values ​​corresponding to the RGB values, and the color parameters are compressed according to the encoding configuration information to obtain compressed data including: Determine single-channel color data according to the encoding configuration information; Color coding data corresponding to each of the color values ​​is generated according to the coding configuration information, and the single-channel color data and the plurality of color coding data form compressed data.

3. The encoding method according to claim 2, characterized in that The encoding configuration information includes RGB configuration information, and determining the single-channel color data according to the encoding configuration information includes: determining the single-channel color data according to the RGB configuration information.

4. The encoding method according to claim 3, characterized in that The RGB configuration information includes the quantity of single-channel color data, the bit width information of the single-channel color data, and RGB combination identification information.

5. The encoding method according to claim 2, characterized in that: The encoding configuration information includes color configuration information, and generating color encoding data corresponding to each color value according to the encoding configuration information includes: generating color encoding data corresponding to each color value according to the color configuration information.

6. The encoding method according to claim 5, characterized in that The color configuration information includes a gain value of a color value, a denominator of a target color calculation formula, a bit width flag of single-channel data of a color value, a color space type, and a color value sign flag, wherein the gain value is greater than any color value in the color parameters.

7. The encoding method according to claim 6, characterized in that: Generating color coding data corresponding to each color value according to the coding configuration information includes: substituting the gain value, denominator and color value of the color value into the target color calculation formula to obtain color coding data.

8. A method for decoding color parameters, characterized in that: include: Acquire parameter encoding data, wherein the parameter encoding data includes user-defined encoding configuration information and compressed data; The compressed data is decoded according to the encoding configuration information to obtain color parameters.

9. The decoding method according to claim 8, characterized in that: The compressed data includes single-channel color data and multiple color coding data, and the color parameters obtained by decoding the compressed data according to the coding configuration information include: Determine a plurality of RGB values ​​according to the encoding configuration information and the single-channel color data; Decoding each color coded data according to the coding configuration information to obtain a color value; A corresponding color value is configured for each of the RGB values. One of the RGB values ​​and the corresponding color value may form a set of color data, and a plurality of sets of the color data may form a color parameter.

10. The decoding method according to claim 9, characterized in that: The encoding configuration information includes RGB configuration information, and determining a plurality of RGB values ​​according to the encoding configuration information and the single-channel color data includes: determining a plurality of RGB values ​​according to the RGB configuration information and the single-channel color data.

11. The decoding method according to claim 10, characterized in that: The RGB configuration information includes the quantity of single-channel color data, the bit width information of the single-channel color data, and RGB combination identification information.

12. The decoding method according to claim 9, characterized in that: The coding configuration information includes color configuration information, and decoding each color coding data according to the coding configuration information to obtain a color value includes: decoding each color coding data according to the color configuration information to obtain a color value.

13. The decoding method according to claim 12, characterized in that: The color configuration information includes a gain value of a color value, a denominator of a target color calculation formula, a bit width flag of single-channel data of a color value, a color space type, and a color value sign flag, wherein the gain value is greater than any color value in the color parameters.

14. The decoding method according to claim 13, characterized in that: Decoding each of the color coded data according to the color configuration information to obtain a color value includes: Determining a target color calculation formula from a plurality of preset color calculation formulas according to a bit width flag of the single-channel data of the color value; Substitute the gain value, denominator and color value of the color value into the target color calculation formula to obtain the color value.

15. A non-volatile readable storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to enable the electronic device to execute the color parameter encoding method as described in any one of claims 1 to 7 or the color parameter decoding method as described in any one of claims 8 to 14.

16. An electronic device, characterized in that: include: at least one processor; as well as, a memory 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 parameter encoding method described in any one of claims 1 to 7 or the color parameter decoding method described in any one of claims 8 to 14.