Image color processing method and apparatus

By determining the ratio of the brightness value to the color component of the pixel and using a lookup table and interpolation operation, the problem of image color non-uniformity is solved and the image quality is improved.

CN115088253BActive Publication Date: 2025-10-17HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202080096708.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-30
Publication Date
2025-10-17
Estimated Expiration
2040-04-30

AI Technical Summary

Technical Problem

In the prior art, image color processing is non-uniform, resulting in degradation of image quality.

Method used

By determining the ratio of the brightness value of the pixel to the color component, using a lookup table to determine the color adjustment coefficient, and performing interpolation operations, the color processing of the image is achieved, the complexity of the hardware circuit is reduced and the image quality is improved.

Benefits of technology

It reduces the color deviation phenomenon, improves the color processing quality of the image, and enhances the practical application possibility of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115088253B_ABST
    Figure CN115088253B_ABST
Patent Text Reader

Abstract

An image color processing method and device, the method comprising: determining color values of a plurality of color components of a pixel of an image to be processed (S301); determining ratios of a luminance value of the pixel to the color values of the plurality of color components (S302); determining a first color adjustment coefficient of the pixel according to the ratios and a first lookup table (S303); and performing color processing on the pixel according to the first color adjustment coefficient to obtain a target image (S304). The color deviation phenomenon of the image subjected to color processing can be reduced, and the quality of the image subjected to color processing is improved. Each step can be implemented by a hardware circuit of a terminal device. For example, the first color adjustment coefficient can be determined by the first lookup table, the processing of integer data can be implemented, the execution process of the image color processing flow can be implemented by the hardware circuit, and the practical application possibility of the image color processing method is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and particularly relates to an image color processing method and device. BACKGROUND

[0002] Optical digital imaging process is to convert the light radiation of a real scene into an electric signal through an image sensor and save it in the form of a digital image. The purpose of image display is to reproduce the real scene described by a digital image through a display device, so that a user obtains the same visual perception as directly observing the real scene.

[0003] In the field of image processing, the image color needs to be adjusted due to the non-uniformity of the color space. How to adjust the image color is a problem to be solved. SUMMARY

[0004] The present application provides an image color processing method and device to realize the adjustment of the image color and improve the image quality.

[0005] In a first aspect, an image color processing method is provided. The execution subject of the method can be a terminal device. The method specifically includes: determining color values of multiple color components of a pixel of a to-be-processed image; determining ratios of a luminance value of the pixel to the color values of the multiple color components; determining first color adjustment coefficients of the pixel according to the ratios and a first lookup table; and performing color processing on the pixel according to the first color adjustment coefficients to obtain a target image. According to the ratios of the luminance value of the pixel of the to-be-processed image to the color values of the color components, the first color adjustment coefficients are determined to perform color processing on the to-be-processed image, which can reduce the color deviation phenomenon of the image subjected to color processing and improve the quality of the image subjected to color processing. Each step can be implemented by a hardware circuit of the terminal device. For example, the first color adjustment coefficients are determined by the first lookup table, which can implement the processing of integer data, so that the execution process of the image color processing flow can be implemented by the hardware circuit and the practical application possibility of the image color processing method is improved.

[0006] In a possible design, the first lookup table includes a mapping relationship between the color adjustment coefficients and preset ratios.

[0007] In a possible design, the determining the first color adjustment coefficient of the pixel according to the ratio and the first lookup table can include the following cases: when the preset ratio includes the ratio, determining the first color adjustment coefficient corresponding to the ratio according to the mapping relationship; when the preset ratio does not include the ratio, determining a first preset ratio and a second preset ratio in the first lookup table; determining a first coefficient corresponding to the first preset ratio and a second coefficient corresponding to the second preset ratio according to the mapping relationship; and performing interpolation operation on the first coefficient and the second coefficient to obtain the first color adjustment coefficient corresponding to the ratio. In this way, the first color adjustment system is determined by using the interpolation method, the number of table item values of the first lookup table is reduced, the occupied space of the first lookup table is reduced, and the complexity of the hardware circuit is reduced.

[0008] Optionally, the interpolation operation includes any one of the following types of operation: linear interpolation, nearest interpolation, bilinear quadratic interpolation, cubic interpolation, or Lanczos interpolation.

[0009] In a possible design, a mapping relationship between a first table item value of the first lookup table and a first lookup table value satisfies a first power function. The first table item value can correspond to a color adjustment coefficient, and the first lookup table value can correspond to a preset ratio. For example, the first power function can be represented as f(x)=x b .

[0010] Optionally, an exponent b of the first power function is a function coefficient. The coefficient b of the first power function can be determined by using a lookup table based on image or image sequence statistical information. The image or image sequence statistical information can include a maximum value, a minimum value, an average value, a standard deviation, and histogram distribution information of the image or the image sequence.

[0011] In a possible design, the first lookup table value is a fixed-point number value; and the first lookup table entry value of the first lookup table can be determined in the following manner: the fixed-point number value is dequantized to obtain a floating-point number value according to a maximum value in a value range determined according to the bit width of the color value; the floating-point number value is determined to be a function value based on the first power function; and the function value is quantized according to a preset quantization coefficient to obtain the first lookup table entry value of the first lookup table. By determining the first lookup table entry value of the first lookup table in the above manner, the first lookup table value and the first lookup table entry value of the first lookup table can be fixed-point number values, and the mapping relationship meets the first power function, so that the input data and the output data of the first lookup table can be fixed-point number values, and the implementation possibility of the hardware circuit is realized. The above method can be implemented by software, thereby improving the actual usability of the image color processing procedure by means of software and hardware separation. Moreover, the method in this part can be implemented by software, and the software procedure can be updated according to the effect of image color processing at any time, so that the adaptability is high and the effect is adjustable.

[0012] In a possible design, the first lookup table value is determined based on an index value of the first lookup table and a step length between index values of the first lookup table.

[0013] In a possible design, the method further includes: determining the first lookup table corresponding to a first value range in which the ratio value is located; and the value range determined according to the bit width of the color value includes the first value range and a second value range corresponding to a second lookup table.

[0014] In a possible design, a mapping relationship between the second lookup table entry value and the second lookup table value of the second lookup table meets the first power function. The second lookup table can be generated in a manner similar to that of the first lookup table, and the two tables can be referred to each other.

[0015] In a possible design, a minimum value of the first value range is greater than a maximum value of the second value range.

[0016] Correspondingly, the first lookup table value of the first lookup table is determined based on the index value of the first lookup table, the step length between index values of the first lookup table, and the maximum value of the second value range.

[0017] Similarly, if a minimum value of the second value range is greater than a maximum value of the first value range, the first lookup table value of the first lookup table is determined based on the index value of the first lookup table and the step length between index values of the first lookup table.

[0018] In a possible design, the step length between index values of the first lookup table and the step length between index values of the second lookup table can be different.

[0019] In a possible design, the color processing of the pixel according to the first color adjustment coefficient can be implemented by the following manner: determining a second color adjustment coefficient of the pixel; multiplying the first color adjustment coefficient and the second color adjustment coefficient; and performing color processing on the pixel according to the multiplication product.

[0020] In a possible design, the to-be-processed image is an image processed by dynamic range adjustment; and the second color adjustment coefficient of the pixel is determined by the following steps: determining an electrical signal ratio of the pixel after the dynamic range adjustment and before the dynamic range adjustment; and determining the second color adjustment coefficient according to the electrical signal ratio. The color deviation phenomenon of the to-be-processed image caused by the dynamic range adjustment can be reduced, and the quality of the image processed by color processing is improved.

[0021] In a possible design, the second color adjustment coefficient corresponding to the electrical signal ratio is determined by table lookup. For example, the second color adjustment coefficient is determined according to the electrical signal ratio and a third lookup table; and the third lookup table includes a mapping relationship between color adjustment coefficients and preset ratios, and the mapping relationship conforms to a second power function.

[0022] In a possible design, the plurality of color components include R, G and B components in an RGB space, and the target image is obtained according to the following formula:

[0023]

[0024] wherein R, G and B respectively represent color values of R, G and B components of the pixel, R', G' and B' respectively represent color values of R, G and B components of a corresponding pixel in the target image, Y represents a luminance value of the pixel, AlphyR0 represents the first color adjustment coefficient corresponding to the R component of the pixel, AlphyG0 represents the first color adjustment coefficient corresponding to the G component of the pixel, AlphyB0 represents the first color adjustment coefficient corresponding to the B component of the pixel, Alphy1 represents the second color adjustment coefficient, A1 is a quantization coefficient of the Alphy1, A2 is a quantization coefficient of the AlphyR0, A3 is a quantization coefficient of the AlphyG0, and A4 is a quantization coefficient of the AlphyB0.

[0025] In a possible design, the plurality of color components include U and V components in a YUV space, and the target image is obtained according to the following formula:

[0026]

[0027] wherein, U, V represent color values of U component and V component of the pixel respectively, U', V' represent color values of U component and V component of corresponding pixel in the target image respectively, AlphayU0 represents the first color adjustment coefficient corresponding to U component of the pixel, AlphayV0 represents the first color adjustment coefficient corresponding to V component of the pixel, Alphay1 represents the second color adjustment coefficient, A1 is the quantization coefficient of Alphay1, A2 is the quantization coefficient of AlphayU0, and A3 is the quantization coefficient of AlphayV0.

[0028] In a second aspect, an image color processing apparatus is provided, which can be a terminal device, a device (e.g., a chip or a chip system or a circuit) in a terminal device, or a device capable of being used in matching with a terminal device. In one design, the apparatus can include a module corresponding to each of the methods / operations / steps / actions described in the first aspect, which can be hardware circuit, software, or a combination of hardware circuit and software. In one design, the apparatus can include a determining module and a processing module. Exemplarily,

[0029] The determining module is configured to determine color values of multiple color components of a pixel in a to-be-processed image; determine a ratio of a luminance value of the pixel to the color values of the multiple color components; and determine a first color adjustment coefficient of the pixel according to the ratio and a first lookup table. The processing module is configured to perform color processing on the pixel according to the first color adjustment coefficient to obtain a target image.

[0030] In one possible design, the first lookup table includes a mapping relationship between color adjustment coefficients and preset ratios.

[0031] In one possible design, when determining the first color adjustment coefficient of the pixel according to the ratio and the first lookup table, the determining module is specifically configured to: when the preset ratio includes the ratio, determine the first color adjustment coefficient corresponding to the ratio according to the mapping relationship; and when the preset ratio does not include the ratio, determine a first preset ratio and a second preset ratio in the first lookup table; determine a first coefficient and a second coefficient corresponding to the first preset ratio and the second preset ratio respectively according to the mapping relationship; and perform interpolation operation on the first coefficient and the second coefficient to obtain the first color adjustment coefficient corresponding to the ratio.

[0032] In one possible design, the interpolation operation includes any one of the following types of operations: linear interpolation, nearest interpolation, bilinear quadratic interpolation, cubic interpolation, or Lanczos interpolation.

[0033] In a possible design, a mapping relationship between a first table entry value of the first lookup table and a first lookup table value satisfies a first power function. The first table entry value can correspond to a color adjustment coefficient, and the first lookup table value can correspond to a preset ratio. For example, the first power function can be represented as f(x)=x b .

[0034] Optionally, the exponent b of the first power function is a function coefficient. The coefficient b of the first power function can be determined by using a lookup table based on image or image sequence statistical information. The image or image sequence statistical information can include a maximum value, a minimum value, an average value, a standard deviation, and histogram distribution information of the image or image sequence.

[0035] In a possible design, the first lookup table value is a fixed-point value.

[0036] When determining the first table entry value of the first lookup table, the determining module is specifically configured to: perform dequantization on the fixed-point value to obtain a floating-point value according to a maximum value of a value range determined by the bit width of the color value; determine a function value of the floating-point value based on the first power function; and perform quantization on the function value to obtain the first table entry value of the first lookup table according to a preset quantization coefficient.

[0037] In a possible design, the first lookup table value is determined based on an index value of the first lookup table and a step length between the index values of the first lookup table.

[0038] In a possible design, the determining module is further configured to: determine the first lookup table corresponding to a first value range in which the ratio is located; and the value range determined by the bit width of the color value includes the first value range and a second value range corresponding to a second lookup table.

[0039] In a possible design, a mapping relationship between a second table entry value of the second lookup table and a second lookup table value satisfies the first power function.

[0040] In a possible design, a minimum value of the first value range is greater than a maximum value of the second value range.

[0041] Correspondingly, the first lookup table value of the first lookup table is determined based on an index value of the first lookup table, a step length between the index values of the first lookup table, and the maximum value of the second value range.

[0042] In a possible design, the step length between the index values of the first lookup table is different from the step length between the index values of the second lookup table.

[0043] In a possible design, when performing color processing on the pixel according to the first color adjustment coefficient, the processing module is specifically configured to: determine a second color adjustment coefficient of the pixel; multiply the first color adjustment coefficient and the second color adjustment coefficient; and perform color processing on the pixel according to the multiplication product.

[0044] In a possible design, the to-be-processed image is an image processed by dynamic range adjustment.

[0045] In a possible design, when determining the second color adjustment coefficient of the pixel, the determining module is specifically configured to: determine an electrical signal ratio of the pixel after the dynamic range adjustment processing and before the dynamic range adjustment processing; and determine the second color adjustment coefficient according to the electrical signal ratio.

[0046] In a possible design, the second color adjustment coefficient corresponding to the electrical signal ratio is determined by table lookup.

[0047] In a possible design, the plurality of color components include an R component, a G component, and a B component in an RGB space, and the target image is obtained according to the following formula:

[0048]

[0049] wherein R, G, and B respectively represent a color value of an R component, a color value of a G component, and a color value of a B component of the pixel, R', G', and B' respectively represent a color value of an R component, a color value of a G component, and a color value of a B component of a corresponding pixel in the target image, Y represents a luminance value of the pixel, AlphyR0 represents a first color adjustment coefficient corresponding to the R component of the pixel, AlphyG0 represents a first color adjustment coefficient corresponding to the G component of the pixel, AlphyB0 represents a first color adjustment coefficient corresponding to the B component of the pixel, Alphy1 represents the second color adjustment coefficient, A1 is a quantization coefficient of the Alphy1, A2 is a quantization coefficient of the AlphyR0, A3 is a quantization coefficient of the AlphyG0, and A4 is a quantization coefficient of the AlphyB0.

[0050] In a possible design, the plurality of color components include a U component and a V component in a YUV space, and the target image is obtained according to the following formula:

[0051]

[0052] Wherein, U, V respectively represent color values of U component and V component of the pixel, U', V' respectively represent color values of U component and V component of the corresponding pixel in the target image, AlphayU0 represents the first color adjustment coefficient corresponding to the U component of the pixel, AlphayV0 represents the first color adjustment coefficient corresponding to the V component of the pixel, Alphay1 represents the second color adjustment coefficient, A1 is the quantization coefficient of the Alphay1, A2 is the quantization coefficient of the AlphayU0, and A3 is the quantization coefficient of the AlphayV0.

[0053] The beneficial effects of the second aspect and each possible design can refer to the effects of the first aspect, which will not be repeated here.

[0054] In a third aspect, an embodiment of the present application provides an image color processing device, the device comprising a processor configured to invoke a set of programs, instructions or data, and execute the method described in the first aspect or any possible design of the first aspect. The device can further comprise a memory configured to store the programs, instructions or data invoked by the processor. The memory is coupled to the processor, and when the processor executes the instructions or data stored in the memory, the method described in the first aspect or any possible design can be implemented.

[0055] In a fourth aspect, an embodiment of the present application provides a chip system, which comprises a processor and can further comprise a memory, and is configured to implement the method described in the first aspect or any possible design of the first aspect. The chip system can be composed of a chip, or can comprise a chip and other discrete devices.

[0056] In a fifth aspect, an embodiment of the present application further provides a computer readable storage medium, which stores computer readable instructions, and when the computer readable instructions are run on a computer, the method described in the first aspect or any possible design of the first aspect is executed.

[0057] In a sixth aspect, an embodiment of the present application further provides a computer program product comprising instructions, and when the computer program product is run on a computer, the computer executes the method described in the first aspect or any possible design of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0058] Figure 1 FIG. 1 is a schematic structural diagram of a terminal device in an embodiment of the present application;

[0059] Figure 2 FIG. 2 is a schematic diagram of image color processing by a terminal device in an embodiment of the present application;

[0060] Figure 3Figure 1 is a flowchart of an image color processing method according to an embodiment of the present application;

[0061] Figure 4 Figure 2 is a flowchart of an RGB image color processing method according to an embodiment of the present application;

[0062] Figure 5 Figure 3 is a schematic diagram of an image color processing device according to an embodiment of the present application;

[0063] Figure 6 Figure 4 is another schematic diagram of an image color processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0064] The embodiments of the present application provide an image color processing method and device, so as to adjust the image color and improve the image quality. The method and the device are based on the same or similar technical concepts, and the device and the method can be referred to each other for implementation, and the repeated parts will not be described herein.

[0065] It should be noted that, in the description of the embodiments of the present application, the "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the associated objects before and after it are in an "or" relationship. At least one involved in the present application means one or more; multiple means two or more. In addition, it should be understood that, in the description of the present application, the terms "first", "second", "third", etc. are only used for distinguishing the purpose of description, and cannot be understood as indicating or implying relative importance, nor can it be understood as indicating or implying order. In the description of the present application, the reference "one embodiment" or "some embodiments" means that the specific features, structures or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in another some embodiments" and the like appearing in the description of the present application do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "include", "contain", "have" and their variants mean "include but not limited to", unless otherwise specifically emphasized.

[0066] The image color processing method and device provided in the embodiments of the present application can be applied to electronic devices. The electronic device can be a mobile device such as a mobile terminal, a mobile station (MS), a user equipment (UE), or a fixed device such as a landline phone, a desktop computer, or a video monitor. The electronic device has an image color processing function. The electronic device can also optionally have a wireless connection function to provide a handheld device with voice and / or data connectivity to the user, or other processing devices connected to a wireless modem, for example: the electronic device can be a mobile phone (or called a "cellular" phone), a computer with a mobile terminal, etc., or a portable, pocket-sized, handheld, computer-built-in or vehicle-mounted mobile device, and of course it can also be a wearable device (such as a smart watch, smart bracelet, etc.), a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a point of sales (POS), etc. In the embodiments of the present application, a terminal device may be used as an example for illustration.

[0067] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0068] Figure 1 The figure shows an optional hardware structure diagram of the terminal device 100 involved in the embodiment of the present application.

[0069] like Figure 1 As shown, terminal device 100 primarily includes a chipset, wherein the chipset can be used to process image color. For example, the chipset includes an image signal processor (ISP), which processes image color. Optionally, the chipset in terminal device 100 also includes other modules, and terminal device 100 may also include peripheral devices. Details are described below. Figure 1The power management unit (PMU), voice data codec, short distance module and radio frequency (RF), operation processor, random-access memory (RAM), input / output (I / O), display interface, sensor hub, baseband communication module and other components in the middle solid line box form a chip or chip set. The USB interface, memory, display screen, battery / mains, earphone / speaker, antenna, sensor (Sensor) and other components can be understood as peripheral devices. The operation processor, RAM, I / O, display interface, ISP, sensor hub, baseband and other components in the chip set can form a system-on-a-chip (SOC), which is the main part of the chip set. The components in the SOC can be integrated into a complete chip, or some components in the SOC can be integrated, and the other components can not be integrated, for example, the baseband communication module in the SOC can not be integrated with the other parts and become an independent part. The components in the SOC can be connected to each other through a bus or other connection lines. The PMU, voice codec, RF and other components outside the SOC usually include an analog circuit part, so they are often outside the SOC and are not integrated with each other.

[0070] Figure 1In some embodiments, the PMU is used to power the SOC from an external power supply or battery, and the external power supply can be used to charge the battery. The voice codec is used to encode and decode voice signals from a microphone or speaker to convert analog voice signals to digital voice signals that can be processed by the SOC. The short-range module can include a wireless fidelity (WiFi) module and a Bluetooth module, and can optionally include an infrared module, a near field communication (NFC) module, a radio frequency (RF) module, or a global positioning system (GPS) module. The RF module is connected to the baseband communication module in the SOC to convert RF signals to baseband signals, i.e., to mix the signals. For a mobile phone, the RF module down-converts received signals and up-converts transmitted signals. The short-range module and the RF module can each have one or more antennas for transmitting or receiving signals. The baseband communication module is used for baseband communication, including one or more of various communication modes, and is used to process wireless communication protocols, including physical layer (layer 1), medium access control (MAC) layer (layer 2), and radio resource control (RRC) layer (layer 3) protocols, and can support various cellular communication standards, such as long term evolution (LTE) communication or 5G new radio (NR) communication. The sensor hub is an interface between the SOC and external sensors, and is used to collect and process data from at least one external sensor, such as an accelerometer, a gyroscope, a control sensor, or an image sensor. The arithmetic processor can be a general-purpose processor, such as a central processing unit (CPU), and can also be one or more integrated circuits, such as one or more application specific integrated circuits (ASICs), one or more digital signal processors (DSPs), one or more microprocessors, or one or more field programmable gate arrays (FPGAs). The arithmetic processor can include one or more cores, and can optionally schedule other units. The RAM can store intermediate data during calculation or processing, such as intermediate calculation data of the CPU and the baseband. The ISP is used to process data collected by the image sensor. The I / O is used to interact with various interfaces outside the SOC, such as a universal serial bus (USB) interface for data transmission. The memory can be one or a group of chips.The display screen can be a touch screen, connected with the bus through a display interface. The display interface can be used for data processing before image display, such as superimposition of multiple layers to be displayed, cache of display data, control and adjustment of screen brightness, and the like.

[0071] It can be understood that the image signal processor involved in the embodiments of the present application can be one or a group of chips, that is, can be integrated or independent. For example, the image signal processor included in the terminal device 100 can be an integrated ISP chip integrated in the operation processor.

[0072] Figure 2 A schematic diagram of image color processing of a terminal device is shown. The terminal device can perform image processing on an input image to be processed. The image processing process can include image color processing, and can also include dynamic range adjustment processing and other processing processes. The terminal device outputs a target image after processing. In combination with the terminal device shown in the figure, the ISP in the terminal device can process the image color to obtain a target image after processing. Figure 1 The terminal device shown in the figure, the ISP in the terminal device can process the image color to obtain a target image after processing.

[0073] In order to better understand the scheme of the embodiments of the present application, first, the concepts and terms involved in the embodiments of the present application are explained.

[0074] 1) Image format:

[0075] In the embodiments of the present application, the format of the image can be a red-green-blue (RGB) format, a luminance-chrominance separation (YUV) format, or a bayer format.

[0076] 2) Color value:

[0077] In the embodiments of the present application, the image can include one or more pixels, and each pixel includes one or more dimensional image color components. The color in the embodiments of the present application can include hue and saturation. The component can also be referred to as a channel, a signal, a color component, and the like. The color component can also be referred to as a channel of a color space, a channel of a color space, a color component of a color space, and the like. The color value represents a digital representation value of the image color component of the image pixel. For example, for a YUV format image, the color value of the color component can include a U component and a V component of a YUV space. For an RGB format image, the color value can include an R component, a G component, and a B component of an RGB space. The color value of the color component can also be understood as a corresponding color component value, a color channel value, a color component value, and the like.

[0078] 3) Brightness value:

[0079] A digital representation of a luminance component of an image pixel, the luminance value can be used to represent the Y component of YUV space. It can also be used to represent the R component, G component and B component of RGB space.

[0080] 4) lookup table (LUT):

[0081] The lookup table can be any form of lookup table that can be understood by those skilled in the art. Optionally, a one-dimensional (1D) lookup table is used in the embodiments of the present application. Optionally, the lookup table includes a series of input data and output data, and the input data and the output data have a one-to-one correspondence. The output data in the lookup table can be in the form of table item values, and the input data can be represented as lookup values. The lookup values can not be displayed in the lookup table, and the lookup values can be represented in the form of table item indexes or table item subscripts. That is, the lookup table includes one or more table item values, and each table item value corresponds to a lookup value, and by inputting the lookup value, the table item value corresponding to the lookup value can be obtained.

[0082] It can be understood that the lookup table can be in the form of a table, or in other forms that can represent the correspondence between the input data and the output data.

[0083] In the embodiments of the present application, the first lookup table, the second lookup table or the third lookup table are used to represent a plurality of lookup tables for distinction, and the concept of each lookup table can refer to the description of the 4) point of the present application.

[0084] Based on the above description, as shown in Figure 3 , the image color processing method provided by the embodiments of the present application is described as follows. The method can be executed by the terminal device as shown in Figure 1 , or can be executed by other devices with image color processing function.

[0085] S301, determining color values of a plurality of color components of a pixel of a to-be-processed image.

[0086] S302, determining ratios of a luminance value of the pixel of the to-be-processed image to the color values of the plurality of color components.

[0087] For example, the determination method of the luminance value of the pixel is not limited in the embodiments of the present application. For YUV space, the luminance value can be the luminance value of the Y component of YUV space. For RGB space, the luminance value of the Y component can be calculated according to the color values of the R component, the G component and the B component. For example, the color value of the Y component can be calculated according to the formula Y=a 11 *R+a 12 *G+a 13 *B. Wherein, a 11 , a 12 , a 13are fixed coefficients. Those skilled in the art can understand that a 11 , a 12 , a 13 The value of Y can be selected in various ways, and the embodiments of the present application do not limit the value of Y. For example, Y=0.2126*R+0.7152*G+0.0722*B or Y=0.2627*R+0.6780*G+0.0593*B.

[0088] For the YUV space, including two color components, the ratio of the luminance value Y of a pixel to the color value of the two color components can be represented as Y / U and Y / V, respectively. For the RGB space, including three color components, the ratio of the luminance value Y of a pixel to the color value of the three color components can be represented as Y / R, Y / G, and Y / B, respectively.

[0089] S303, determining the first color adjustment coefficient of the pixel of the to-be-processed image according to the ratio obtained in S302 and the first lookup table.

[0090] Optionally, the first lookup table includes or indicates a mapping relationship between the color adjustment coefficient and the preset ratio. The preset ratio can be used as input data, and the color adjustment coefficient can be used as output data.

[0091] S304, performing color processing on the pixel of the to-be-processed image according to the first color adjustment coefficient to obtain a target image.

[0092] It can be understood that the to-be-processed image can include a plurality of pixels, and each pixel can be processed according to the flow shown in FIG. 3 to obtain a target image. Figure 3

[0093] Figure 3 In the embodiments, the first color adjustment coefficient is determined according to the ratio of the luminance value of the pixel of the to-be-processed image to the color value of the color component, so that the color processing on the to-be-processed image can reduce the color deviation phenomenon of the image subjected to color processing and improve the quality of the image subjected to color processing. In the embodiments, Figure 3 The steps of the embodiments can be implemented by the hardware circuit of the terminal device. For example, the first color adjustment coefficient can be determined by the first lookup table, the processing of integer data can be implemented, the execution process of the image color processing flow can be implemented by the hardware circuit, and the practical application possibility of the image color processing method can be improved.

[0094] Some optional implementation manners of the embodiments will be further introduced below. Figure 3

[0095] The input data of the first lookup table can be a floating-point number, an integer number, or a fixed-point number. The input data of the first lookup table is taken as a fixed-point number for example.​​

[0096] First, introduce the possible implementation of the generation process of the lookup table.

[0097] The value range of the input data of the lookup table can be determined according to the bit width of the color value, and the value range of the input data of the lookup table can be less than or equal to the value range determined by the bit width of the color value. When the color value is an integer value, generally, the color value is N bits, N is a positive integer, for example, the color value is 8 bits, 10 bits, 12 bits, 14 bits or 16 bits. The value range of the color value is (0~2 N -1) or (1~2 N ). For example, when the value of the RGB image color value is 10 bits, the value range of the color value is (0~2 10 -1).

[0098] The lookup table value of the lookup table is taken as the input data, and the output data is the table item value of the lookup table. In the embodiment of the application, the mapping relationship between the table item value and the lookup table value of the lookup table satisfies the first power function. That is, the lookup table value is input into the first power function to obtain the corresponding table item value.

[0099] When the lookup table value is a fixed-point value, the lookup table can be generated in the following way.

[0100] According to the maximum value of the value range determined by the bit width of the color value, the lookup table value (i.e. the fixed-point value) is dequantized to obtain a floating-point value. For example, according to the maximum value of the value range determined by the bit width of the color value is 2 N -1, the lookup table value is M, and the floating-point value M1 is obtained by M / (2 N -1). The floating-point value is determined based on the function value of the first power function, for example, the floating-point value M1 is substituted into the first power function to obtain M2. M2 is a floating-point value. According to the preset quantization coefficient, the function value is quantized to obtain the table item value of the lookup table. The data obtained after quantization of M2 is a fixed-point value.

[0101] The lookup table value of the lookup table is traversed, and the table item value corresponding to each lookup table value can be obtained according to the above method, so as to generate the lookup table.

[0102] The lookup table value of the lookup table is the input data of the lookup table, which is used to obtain the corresponding table item value according to the lookup table value. The index value of the lookup table is the serial number of the table item value, which is generally generated according to the order of natural numbers from small to large or from large to small. The lookup table value can be determined according to the index value and the step length between the index values.

[0103] In one possible embodiment, Figure 3The value range of the first lookup table value of the first lookup table described in the embodiment is determined by the bit width of the color value. For example, the color value is N bits, and the value range of the color value is (0~2 N -1), and the maximum value is 2 N -1. The first lookup table value can be set to a value in 0~2 N -1. The sequence number of the first table value in the first lookup table can be referred to as the index value of the first lookup table. For example, the first lookup table includes L table values, and the sequence number of the table value in the first lookup table is 0~L-1 or (1~L), L is a positive integer. The index value of the first lookup table is 0~L-1 or (1~L). The step between every two index values in the lookup table can be 1 or an integer greater than 1. The first lookup table value is determined based on the index value of the first lookup table and the step between the index values. When the first lookup table value is 2 N , the first lookup table value corresponds to the index value one by one, and the step is 1. The step can also be greater than 1, and the first lookup table value = index value x step.

[0104] For example, the color value is 12 bits, the value range of the color value is 0~4095, and the maximum value is 4095. The index value can be 0~4095 or 1~4096. Assuming that the index value can be 0~1023, the step is 4, and the lookup table value M is (0, 4, 8, 12, 16, 20, …, 4092) in turn.

[0105] Divide each fixed-point value in (0, 4, 8, 12, 16, 20, …, 4092) by 4095 to obtain the floating-point value M1 corresponding to each fixed-point value.

[0106] The possible implementation of the generation process of the above lookup table is applicable to the first lookup table.

[0107] In another possible embodiment, the value range determined by the bit width of the color value includes a first value range and at least one second value range. That is, the value range determined by the bit width of the color value can include multiple subsets. Each subset is a value range, and the union of multiple subsets is the value range determined by the bit width of the color value, or the union of multiple subsets can also be smaller than the value range determined by the bit width of the color value. Generally, two subsets are taken as an example, that is, the value range determined by the bit width of the color value includes a first value range and a second value range. Figure 3 The value range of the first lookup table value of the first lookup table described in the embodiment is the first value range. For example, the color value is N bits, and the value range of the color value is (0~2 N -1), and the maximum value is 2 N -1. The second value range is (0~N1), and the first value range is (N1+1~2 N-1), the minimum value of the first value range is greater than the maximum value of the second value range. The value range of the table lookup value of the first lookup table is (N1+1~2 N -1), the first table lookup value can be set to the value in (N1+1~2 N -1). The sequence number of the first table entry value in the first lookup table can be referred to as the index value of the first lookup table. For example, the first lookup table includes L table entry values, and the sequence number of the table entry value in the first lookup table is 0~L-1 or (1~L), L being a positive integer. The index value of the first lookup table is 0~L-1 or (1~L). The step length between every two index values in the first lookup table can be 1 or an integer greater than 1. The first table lookup value is determined based on the index value of the first lookup table and the step length between index values. The first table lookup value can correspond to the index value one by one, that is, the step length is 1. The step length can also be greater than 1, and in this case, the first table lookup value of the first lookup table is determined based on the index value of the first lookup table, the step length between index values of the first lookup table, and the maximum value of the second value range, for example, the first table lookup value = index value × step length + N1. N1 is the maximum value of the second value range. If the value range determined by the bit width of the color value includes the first value range and multiple second value ranges, Figure 3 In the embodiment, the value range of the table lookup value of the first lookup table is the first value range, and the first table lookup value = index value × step length + N1. N1 is the maximum value of all value ranges before the first value range.

[0108] Similarly to the first lookup table, a second lookup table can be generated according to the second value range, and the value range of the table lookup value of the second lookup table corresponds to the second value range. The value range of the table lookup value of the second lookup table is (0~N1), and the second table lookup value can be set to the value in (0~N1). The sequence number of the second table entry value in the second lookup table can be referred to as the index value of the second lookup table. For example, the second lookup table includes L1 table entry values, and the sequence number of the table entry value in the second lookup table is 0~L1-1 or (1~L1), L1 being a positive integer. The index value of the second lookup table is 0~L1-1 or (1~L1). The step length between every two index values in the second lookup table can be 1 or an integer greater than 1. The second table lookup value is determined based on the index value of the second lookup table and the step length between index values. The second table lookup value can correspond to the index value one by one, that is, the step length is 1. The step length can also be greater than 1, and in this case, the second table lookup value of the second lookup table is determined based on the index value of the first lookup table and the step length between index values of the first lookup table, for example, the second table lookup value = index value × step length.

[0109] Optionally, the step length between index values of the first lookup table and the step length between index values of the second lookup table can be the same or different.

[0110] For example, the color value is 12 bits, the color value is in the range of 0-4095, and the maximum value is 4095. The second value range is (0-255), and the first value range is (256-4095). The second lookup table has 64 entries, the step between the index values of the second lookup table is 256 / 64=4, and the entry values of the second lookup table are (0, 4, 8, 12, 16, 20, …, 252). The first lookup table has 128 entries, the step between the index values of the first lookup table is (4095-256) / 128=30, and the entry values of the second lookup table are (256, 286, 316, …, 4066).

[0111] The index value of the second lookup table can be 0-63 or 1-64. The index value of the first lookup table can be 0-127 or 1-128.

[0112] Divide each fixed-point value in the first lookup table (256, 286, 316, …, 4066) by 4095 to obtain the floating-point value M1 corresponding to each fixed-point value. Divide each fixed-point value in the second lookup table (0, 4, 8, 12, 16, 20, …, 252) by 4095 to obtain the floating-point value M2 corresponding to each fixed-point value.

[0113] The possible implementation of the generation process of the lookup table described above can be applied to the first lookup table or the second lookup table.

[0114] When the value range determined by the bit width of the color value includes the first value range and at least one second value range, the first lookup table corresponds to the first value range. In this case, before S303, the first lookup table corresponding to the first value range in which the value is located can also be determined. For example, a threshold value can be set, and the value range in which the value is located is determined according to the comparison result of the value and the threshold value, and the lookup table corresponding to the value range is further determined. When the value is less than the threshold value, it is determined that the value is in the second value range, and the second lookup table corresponding to the second value range is determined, and the color adjustment coefficient corresponding to the value is determined according to the value and the second lookup table. When the value is greater than or equal to the threshold value, it is determined that the value is in the first value range, and the first lookup table corresponding to the first value range is determined, and the first color adjustment coefficient corresponding to the value is determined according to the value and the first lookup table. Based on the above example, the color value is 12 bits, the color value is in the range of 0-4095, and the maximum value is 4095. The second value range is (0-255), and the first value range is (256-4095). The threshold value can be set to 256.

[0115] Of course, the color adjustment coefficient can also be determined according to the following comparison manner. When the ratio is less than or equal to a threshold value, a second value range in which the ratio is located is determined, a second lookup table corresponding to the second value range is determined, and the color adjustment coefficient corresponding to the ratio is determined according to the ratio and the second lookup table. When the ratio is greater than the threshold value, a first value range in which the ratio is located is determined, a first lookup table corresponding to the first value range is determined, and the first color adjustment coefficient corresponding to the ratio is determined according to the ratio and the first lookup table. Based on the above example, the color value is 12 bits, the value range of the color value is 0-4095, and the maximum value is 4095. The second value range is (0-255), and the first value range is (256-4095). The threshold value can be set to 255.

[0116] The following describes a possible implementation manner of determining the first color adjustment coefficient of the pixel according to the ratio and the first lookup table in S303.

[0117] The first lookup table includes a mapping relationship between the color adjustment coefficient and the preset ratio. It can be understood that the preset ratio is a lookup table value of the first lookup table, and the color adjustment coefficient is table item data corresponding to the lookup table value in the first lookup table.

[0118] In S303, the first color adjustment coefficient of the pixel is determined according to the ratio and the first lookup table. The preset ratio of the first lookup table can include the ratio, and the first color adjustment coefficient corresponding to the ratio can be determined according to the mapping relationship between the color adjustment coefficient and the preset ratio.

[0119] However, the preset ratio of the first lookup table can not include the ratio, and optionally, the embodiment of the present application can determine the first color adjustment coefficient corresponding to the ratio by an interpolation method.

[0120] The interpolation method is a method of estimating unknown data from known discrete data in numerical analysis in the field of mathematics. In the embodiment of the present application, the interpolation method used to determine the first color adjustment coefficient corresponding to the ratio can be an interpolation method, an extrapolation method, a linear interpolation method, a nonlinear interpolation method, a nearest interpolation method, a bilinear quadratic interpolation method, a cubic interpolation method, or any one of a Lanczos interpolation method. The specific interpolation method can be selected according to the actual situation.

[0121] Optionally, the first preset ratio and the second preset ratio can be determined in the first lookup table, the first coefficient and the second coefficient corresponding to the first preset ratio and the second preset ratio can be determined according to the mapping relationship between the color adjustment coefficient and the preset ratio, and the first color adjustment coefficient corresponding to the ratio can be obtained by interpolating the first coefficient and the second coefficient.

[0122] The first preset ratio and the second preset ratio can be two ratios adjacent to the ratio, for example, if an interpolation method is used, the ratio is between the first preset ratio and the second preset ratio, and in the preset ratios, the ratio is adjacent to both the first preset ratio and the second preset ratio. For another example, if an extrapolation method is used, the first preset ratio and the second preset ratio are both smaller than the ratio, and in the preset ratios, the ratio, the first preset ratio and the second preset ratio are adjacent to each other; or, the first preset ratio and the second preset ratio are both greater than the ratio, and in the preset ratios, the ratio, the first preset ratio and the second preset ratio are adjacent to each other.

[0123] The linear interpolation method is described below.

[0124] The step of the first lookup table (LUT1) is 2 step , the number of entries of the first lookup table is NUM, and max is the input value of the lookup table interpolation.

[0125] First, calculate the interpolation index: i_int = ((max >> step));

[0126] Second, calculate the interpolation weight: i_dec = ((max & (((1 << step) - 1))));

[0127] Third, calculate the final quantization interpolation: C1 = (LUT1[i_int] * ((1 << step) - i_dec) + LUT1[iClip(i_int + 1, 0, NUM - 1)] * i_dec + (1 << (step - 1))) >> step.

[0128] The following is an example of how to perform linear interpolation on the first lookup table (LUT) to obtain the color adjustment coefficient corresponding to the ratio.

[0129] 1. The value of the ratio (Radio) divided by the step (step) and rounded is the index value A: A = Radio / step;

[0130] 2. The value of the first lookup table value corresponding to the index value A (data1) is the first preset ratio: data1 = LUT[A];

[0131] 3. The value of the first lookup table value corresponding to the index value A+1 (data2) is the second preset ratio: data2 = LUT[A+1];

[0132] 4. The value of the ratio (Radio) modulo the step (step) is dec, dec = Radio%step.

[0133] 5. Final interpolation data3: data3 = (data1 * (step - dec) + data2 * dec) / step. data3 is the color adjustment coefficient corresponding to the ratio.

[0134] The following example illustrates how to perform linear interpolation on the first lookup table (LUT) to obtain a color adjustment coefficient corresponding to a ratio when the value range determined by the bit width of the color value includes a first value range and at least one second value range, and the first lookup table corresponds to the first value range.

[0135] 1. Assume the threshold is thres. The value obtained by subtracting thres from the ratio (Radio) is Radio1: Radio1 = Radio-thres.

[0136] 2. The value Radio1 divided by the step size step is rounded to the integer value that is the index value A: A = Radio1 / step.

[0137] 3. The index value A corresponds to the table lookup value data1, which is the first preset ratio: data1 = LUT[A].

[0138] 4. The lookup table value data2 corresponding to the index value A+1 is the second preset ratio: data2=LUT[A+1].

[0139] 5. The value dec obtained by dividing the ratio Radio1 modulo the step size step: dec=Radio1%step.

[0140] 6. Final difference data3:

[0141] data3 = (data1*(step-dec)+data2*dec) / step. data3 is the color adjustment coefficient corresponding to the ratio.

[0142] In the embodiment of the present application, the process of generating the first lookup table is a software process, which can be implemented by software and can be packaged as firmware. Figure 3 Each step of the embodiment is a hardware process and can be implemented by a hardware circuit.

[0143] Based on this, for example, when the terminal device performs color processing on a plurality of consecutive frames of images to be processed, the hardware circuit of the terminal device can process each frame of the image to be processed according to Average luminance value The various steps of the embodiment are processed to obtain a target image corresponding to each frame of the image to be processed. In the interval between each two consecutive frames, the firmware / software of the terminal device can generate a first lookup table. Of course, the terminal device's separation of software and hardware in the image color processing process is not limited to the implementation methods exemplified in this paragraph.

[0144] The first power function is described as follows.

[0145] The first power function can be expressed as f(x)=x b , where b is the function coefficient of the first power function. The coefficient b of the first power function can be determined by a look-up table using image or image sequence statistical information, which can include maximum value, minimum value, average value, standard deviation and histogram distribution information of the image or image sequence.

[0146] For example, as a specific embodiment, the person skilled in the art can establish the correspondence between the exponent of the first power function and the average brightness value of the image to be processed based on experimental data or experience. Here, the average brightness value of the image to be processed can refer to the average brightness of the image to be processed or the image sequence to be processed. As an example, the correspondence can be shown in Table 1 or Table 2.

[0147] The average brightness value in Table 1 or Table 2 ranges from 0 to 1.

[0148] Table 1

[0149] Exponent of the first power function 0.1 0.25 0.3 0.55 0.6 Average luminance value 1.2 1.0 0.8 0.6 0.2

[0150] Table 2

[0151] Exponent of the first power function 0.1 0.3 0.5 Average luminance value 0.0 0.1 0.2

[0152] Taking Table 1 as an example, as shown in Table 1, when the average brightness value of the image to be processed is obtained, the average brightness value can be the average value of the Y component of the image to be processed, or the average value of other components of the image to be processed. When the average brightness value is less than 0.1, the exponent of the first power function can be 1.2; when the average brightness value is greater than 0.6, the exponent of the first power function can be 0.2. When the average brightness value is between the two table values, the exponent value of the first power function can be obtained by interpolation. The embodiments of the present application do not limit the interpolation method. For example, linear interpolation, quadratic linear interpolation and the like can be adopted. For example, when the average brightness value is between 0.55 and 0.6, the following linear interpolation method can be adopted to obtain the exponent value of the first power function:

[0153] output=0.6+(0.2-0.6)*(input-0.55) / (0.6-0.55).

[0154] Wherein, the output represents the exponent value of the first power function, and the input represents the average brightness value of the image to be processed or the image sequence to be processed.

[0155] The power function in the embodiments of the present application can also be replaced by a linear function, for example, the linear function can be f(x)=cx+d.

[0156] It can be understood that the pixels of the image to be processed in the embodiments of the present application have multiple color components, therefore, a ratio can be obtained for each color value of each color component in S302, that is, multiple ratios are obtained. Then for the multiple ratios in S303, each ratio corresponds to a first lookup table. The multiple first lookup tables corresponding to the multiple ratios can be different, that is, the mapping relationship of the color adjustment coefficients and the preset ratios included or indicated by the multiple first lookup tables can be different. The mapping relationship between the table entry values of the first lookup table and the lookup table values satisfies the first power function. Then the exponential values of the multiple first power functions corresponding to the multiple ratios can be different, of course, there can also be the same case.

[0157] The optional implementation of 304 is described below.

[0158] In S304, the color of the pixel of the image to be processed is processed according to the first color adjustment coefficient, to obtain a target image.

[0159] Optional implementation 1:

[0160] For the RGB space, the following formula (1) can be used to process the color of the image to be processed:

[0161]

[0162] Wherein, Y represents the luminance value of the image to be processed, R, G and B respectively represent the color value of the R component, the color value of the G component and the color value of the B component of the image to be processed, R', G' and B' respectively represent the color value of the R component, the color value of the G component and the color value of the B component of the target image, a1 represents the first color adjustment coefficient corresponding to the R component, a2 represents the first color adjustment coefficient corresponding to the G component, and a3 represents the first color adjustment coefficient corresponding to the B component. a1, a2 or a3 can be a floating point value or a fixed point value.

[0163] For the YUV space, the following formula (2) can be used to process the color of the image to be processed:

[0164]

[0165] Wherein, u and v respectively represent the color value of the U component and the color value of the V component of the image to be processed, u' and v' respectively represent the color value of the U component and the color value of the V component of the target image, a4 represents the first color adjustment coefficient corresponding to the U component, and a5 represents the first color adjustment coefficient corresponding to the V component.

[0166] In optional implementation 1, the first color adjustment coefficient can be preset. For example, the first color adjustment coefficient can be obtained through experimental data calibration. For example, a mapping relationship between the first color adjustment coefficient and the color value of the color component of the pixel can be counted based on experimental data, and the first color adjustment coefficient can be determined based on the mapping relationship.

[0167] Based on analysis of experimental data, the first color adjustment coefficient corresponding to the pixel of the to-be-processed image is determined to perform color processing on the to-be-processed image, which can improve the quality of the image subjected to color processing.

[0168] Optional implementation 2:

[0169] The second color adjustment coefficient of the pixel of the to-be-processed image is determined, the first color adjustment coefficient is multiplied by the second color adjustment coefficient, and the pixel of the to-be-processed image is subjected to color processing according to the product of the multiplication.

[0170] The second color adjustment coefficient can be a given color adjustment coefficient of the to-be-processed image, or can be determined according to other manners. For example, the to-be-processed image can be an image subjected to dynamic range adjustment processing, and the dynamic range adjustment processing represents compression or stretching processing on the electrical signal value (for example, Y component, R component, G component, B component) of the image. The dynamic range adjustment processing on the image can cause color deviation of the image. The second color adjustment coefficient can be determined according to the electrical signal ratio. The electrical signal ratio can be the electrical signal ratio of the electrical signal value of each pixel after the dynamic range adjustment processing and the electrical signal value before the dynamic range adjustment processing. For example, in the process of converting between high dynamic range (HDR) and standard dynamic range (SDR), the dynamic range adjustment of the image is involved. The electrical signal value can be the Y component in the YUV space, or the R component, the G component, or the B component in the RGB space.

[0171] For example, in the YUV color space, the dynamic range adjustment processing on the electrical signal value of the to-be-processed image can be as shown in the following formula (3):

[0172] Y2=cY1 formula (3)

[0173] Wherein, the electrical signal value before the dynamic range adjustment processing is Y1, the electrical signal value after the dynamic range adjustment processing is Y2, and c is the electrical signal ratio before and after the dynamic range adjustment processing.

[0174] For another example, in the RGB color space, the dynamic range adjustment processing on the color value of the to-be-processed image can be as shown in the following formula (4):

[0175]

[0176] wherein the color value before the dynamic range adjustment processing is R1, G1, B1, the color value after the dynamic range adjustment processing is R2, G2, B2, and f is the ratio of the electrical signal before and after the dynamic range adjustment processing. Optionally, f can be the ratio of the maximum component in RGB.

[0177] Optionally, determining the second color adjustment coefficient according to the electrical signal ratio includes various manners. For example, the electrical signal ratio can be directly determined as the second color adjustment coefficient. For another example, the second color adjustment coefficient corresponding to the electrical signal ratio can be determined by looking up a table. Specifically, the second color adjustment coefficient can be determined according to the electrical signal ratio and a lookup table (denoted as a third lookup table). The third lookup table can be generated in the manner as described above for the first lookup table. The third lookup table includes or indicates a mapping relationship between the color adjustment coefficient and the preset ratio, and the mapping relationship between the color adjustment coefficient and the preset ratio conforms to the second power function. Alternatively, the second color adjustment coefficient can be determined according to the electrical signal ratio and the second power function, and the second color adjustment coefficient can be a value obtained by substituting the electrical signal ratio into the second power function. The process of determining the second color adjustment coefficient according to the electrical signal ratio and the third lookup table can be implemented by a hardware circuit, and the process of generating the third lookup table can be implemented by firmware / software.

[0178] wherein the second power function can be expressed as f(x) = x d , and d is a function coefficient of the second power function. The value of d can be a fixed value selected by a person skilled in the art based on experimental data or experience, or determined by a lookup table using image or image sequence statistical information. The image or image sequence statistical information can include the maximum value, minimum value, average value, standard deviation, and histogram distribution information of the image or image sequence.

[0179] For example, as a specific embodiment, a person skilled in the art can establish a corresponding relationship between the index of the second power function and the average luminance value of the image to be processed based on experimental data or experience. Here, the average luminance value of the image to be processed can refer to the average value of the luminance of the image to be processed or the sequence of images to be processed. As an example, the corresponding relationship can be as shown in Table 3 or Table 4. The average luminance value in Table 3 or Table 4 is represented in a normalized manner, and its range is [0, 1]. Wherein, 1 represents the maximum value of the luminance value, and 0 represents the minimum value of the luminance value.

[0180] Table 3

[0181] Exponent of the second power function 0.1 0.25 0.3 0.55 0.6 Average luminance value 0.1 0.15 0.2 0.25 0.3

[0182] Table 4

[0183] Exponent of the second power function 0.1 0.5 Figure 4 -0.1 -0.3

[0184] For the convenience and brevity of description, in the method corresponding to Table 2, the method for searching the exponent of the second power function can refer to the detailed description related to Table 1, which will not be repeated here.

[0185] On the basis of the optional implementation 2, the target image in S304 can be obtained according to the following manner.

[0186] If the plurality of color components include R component, G component and B component in RGB space, the target image is obtained according to the following formula (5):

[0187]

[0188] Wherein, R, G and B respectively represent the color value of R component, the color value of G component and the color value of B component of the pixel, R', G' and B' respectively represent the color value of R component, the color value of G component and the color value of B component of the corresponding pixel in the target image, Y represents the luminance value of the pixel, AlphyR0 represents the first color adjustment coefficient corresponding to the R component of the pixel, AlphyG0 represents the first color adjustment coefficient corresponding to the G component of the pixel, AlphyB0 represents the first color adjustment coefficient corresponding to the B component of the pixel, Alphy1 represents the second color adjustment coefficient, A1 is the quantization coefficient of Alphy1, A2 is the quantization coefficient of AlphyR0, A3 is the quantization coefficient of AlphyG0, and A4 is the quantization coefficient of AlphyB0.

[0189] If the plurality of color components include U component and V component in YUV space, the target image is obtained according to the following formula (6):

[0190]

[0191] Wherein, U and V respectively represent the color value of U component and the color value of V component of the pixel, U' and V' respectively represent the color value of U component and the color value of V component of the corresponding pixel in the target image, AlphyU0 represents the first color adjustment coefficient corresponding to the U component of the pixel, AlphyV0 represents the first color adjustment coefficient corresponding to the V component of the pixel, Alphy1 represents the second color adjustment coefficient, A1 is the quantization coefficient of Alphy1, A2 is the quantization coefficient of AlphyU0, and A3 is the quantization coefficient of AlphyV0.

[0192] Based on the above embodiments, in order to further understand the image color processing method provided by the embodiments of the present application, as shown in Figure 4 Taking the image in RGB format as an example, an optional embodiment of a specific scene is introduced. Figure 4In the embodiments, the process of any pixel of the to-be-processed image is described, and each pixel of the to-be-processed image can refer to Figure 4 The method shown in the operation finally obtains a target image corresponding to the to-be-processed image.

[0193] S401, color values R, G and B of three color components of a pixel of the to-be-processed image and an electrical signal ratio a of the to-be-processed image are obtained.

[0194] The electrical signal ratio a can be an electrical signal ratio between an electrical signal value of each pixel of the to-be-processed image after the dynamic range adjustment processing and an electrical signal value before the dynamic range adjustment processing.

[0195] S402, a luminance value Y of the pixel of the to-be-processed image is calculated according to the color values R, G and B.

[0196] For example, Y can be determined according to the formula Y=a 11 *R+a 12 *G+a 13 *B.

[0197] S403, the electrical signal ratio a is substituted into a lookup table 1 to obtain a second color adjustment coefficient Alphy1.

[0198] The mapping relationship between the color adjustment coefficient and the preset ratio in the lookup table 1 conforms to a second power function f(x)=x d .

[0199] Optionally, if the bit width of the color value determines a value range including multiple value ranges, each value range corresponds to a generated lookup table, before the electrical signal ratio a is substituted into the lookup table 1, it is also necessary to determine the value range where the electrical signal ratio a is located, and select the lookup table corresponding to the value range where the electrical signal ratio a is located. Figure 4 The optional step is shown in a dashed box.

[0200] The coefficient d can be determined by a lookup table using image or image sequence statistical information. For example, the coefficient d can be determined according to table 2. Alternatively, d can be a fixed value selected according to experience, such as 0.2.

[0201] S404, ratios Y / R, Y / G and Y / B of the luminance value Y and the color values R, G and B of the three color components are respectively calculated.

[0202] S405, Y / R, Y / G and Y / B are respectively substituted into a lookup table 2, a lookup table 3 and a lookup table 4 to obtain first color adjustment coefficients AlphyR0, AlphyG0 and AlphyB0 corresponding to the three color components respectively.

[0203] The mapping relationship between the color adjustment coefficient and the preset ratio in the lookup table 2, the lookup table 3 and the lookup table 4 conforms to a first power function, and the first power function is f(x) = x b It can be understood that the exponent in the first power function to which the mapping relationship between the color adjustment coefficient and the preset ratio in the lookup table 2, the lookup table 3 and the lookup table 4 conforms can be different.

[0204] The exponent b can be determined by using a lookup table according to image or image sequence statistical information. For example, the exponent b can be determined according to table 1.

[0205] It should be noted that the execution order of S403, S404 and S405 is not limited, and the order can be exchanged or performed simultaneously.

[0206] Optionally, if the bit width of the color value determines a value range including multiple value ranges, each value range corresponds to a generated lookup table, then before Y / R is substituted into the lookup table 2, it is also necessary to determine the value range in which Y / R is located, and select the lookup table corresponding to the value range in which Y / R is located. Similarly, before Y / G and Y / B are substituted into the lookup table 3 and the lookup table 4, it is also necessary to determine the value range in which Y / G and Y / B are located respectively, and select the lookup table corresponding to the value range in which Y / G and Y / B are located. Of course, the number of lookup tables corresponding to Y / R, Y / G and Y / B can be inconsistent, for example, Y / R corresponds to multiple lookup tables, and Y / G and Y / B each correspond to one lookup table. Only when multiple lookup tables correspond to Y / R, Y / G and Y / B, it is necessary to compare the difference value with the threshold value before being substituted into the difference table. In addition, the threshold values compared by Y / R, Y / G and Y / B can be the same or different. In Figure 5 The optional step is not illustrated in the foregoing.

[0207] The preset quantization coefficients A1, A2, A3, A4, Alphy1, AlphyR0, AlphyG0, AlphyB0 are substituted into formula (5) for calculation to obtain the color values R', G' and B' corresponding to the three color channels of the pixel after color processing. Specifically, the calculation can be realized by S406-S409.

[0208] S406, Alphy1 is multiplied by AlphyR0, AlphyG0 and AlphyB0 respectively to obtain three products BetaR, BetaG and BetaB.

[0209] S407, BetaR, BetaG and BetaB are multiplied by (R-Y), (G-Y) and (B-Y) respectively to obtain (R-Y)', (G-Y)' and (B-Y)'.

[0210] S408, divide or shift (R-Y)' by A1 and A2, divide or shift (G-Y)' by A1 and A3, divide or shift (B-Y)' by A1 and A4, to obtain (R-Y)", (G-Y)", and (B-Y)", respectively.

[0211] wherein, shift operation means shifting the index to the left, for example, A is 2 R1 , Z is 2 R2 , shift operation of a number Z by A means shifting A to the left by R1, and the operation result is 2 R2-R1 The operation result of shift operation is the same as that of division operation.

[0212] S409, add Y to (R-Y)", (G-Y)", and (B-Y)", respectively, to obtain R', G', and B'.

[0213] It should be noted that the examples in each application scenario in the present application only represent some possible implementation manners, and are for better understanding and description of the method of the present application. Those skilled in the art can obtain some evolved examples according to the image color processing method provided in the application.

[0214] To implement the functions in the method provided in the embodiments of the present application, the terminal device can include hardware structures and / or software modules to implement the above functions in the form of hardware structures, software modules, or hardware structures plus software modules. Whether a certain function in the above functions is implemented in the form of hardware structure, software module, or hardware structure plus software module depends on specific application and design constraints of the technical solution.

[0215] Based on the same technical concept, as shown in Figure 6 The present application also provides an image color processing apparatus 500, which can be a mobile terminal or any device with image processing function. In one design, the image color processing apparatus 500 can include a module corresponding to each method / operation / step / action in the above method embodiments, which can be a hardware circuit, software, or a combination of hardware circuit and software. In one design, the image color processing apparatus 500 can include a determination module 501 and a processing module 502. The hardware circuit is referred to as hardware or c pipe.

[0216] The determining module 501 is configured to determine color values of a plurality of color components of a pixel of an image to be processed, determine a ratio of a luminance value of the pixel to the color values of the plurality of color components, and determine a first color adjustment coefficient of the pixel according to the ratio and a first lookup table. The processing module 502 is configured to perform color processing on the pixel according to the first color adjustment coefficient to obtain a target image. In this case, the determining module 501 and the processing module 502 can be hardware circuits.

[0217] Optionally, when the first color adjustment coefficient of the pixel is determined according to the ratio and the first lookup table, the determining module 501 is specifically configured to: when the preset ratio includes the ratio, determine the first color adjustment coefficient corresponding to the ratio according to the mapping relationship; and when the preset ratio does not include the ratio, determine a first preset ratio and a second preset ratio in the first lookup table, determine a first coefficient and a second coefficient corresponding to the first preset ratio and the second preset ratio respectively according to the mapping relationship, and perform interpolation operation on the first coefficient and the second coefficient to obtain the first color adjustment coefficient corresponding to the ratio. The determining module 501 can be a hardware circuit.

[0218] Optionally, the first lookup table value is a fixed-point value, and when the first table item value of the first lookup table is determined, the determining module 501 is specifically configured to: perform dequantization on the fixed-point value to obtain a floating-point value according to a maximum value of a value range determined by a bit width of the color value, determine a function value of the floating-point value based on the first power function, and perform quantization on the function value according to a preset quantization coefficient to obtain the first table item value of the first lookup table. In this case, the determining module 501 can be software.

[0219] Optionally, the determining module 501 is further configured to determine the first lookup table corresponding to a first value range in which the ratio is located, and the value range determined by the bit width of the color value includes the first value range and a second value range corresponding to a second lookup table.

[0220] The determining module 501 and the processing module 502 can also be configured to perform other corresponding steps or operations of the method embodiments described above, which will not be repeated here.

[0221] The division of the modules in the embodiments of the present application is illustrative, and is merely a logical function division. In actual implementation, another division manner can be used. In addition, each functional module in each embodiment of the present application can be integrated in one processor, or can be physically separated, or two or more modules can be integrated in one module. The integrated module can be implemented in the form of hardware or in the form of a software functional module.

[0222] Based on the same technical concept, such as Figure 1 As shown, an embodiment of the present application also provides an image color processing device 600. The image color processing device 600 includes a processor 601. The processor 601 is used to call a set of programs so that the above-mentioned method embodiment is executed. The image color processing device 600 also includes a memory 602, and the memory 602 is used to store program instructions and / or data executed by the processor 601. The memory 602 and the processor 601 are coupled. The coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units or modules, which can be electrical, mechanical or other forms, and is used for information exchange between devices, units or modules. The processor 601 may operate in conjunction with the memory 602. The processor 601 may execute program instructions stored in the memory 602. The memory 602 may be included in the processor 601.

[0223] The image color processing device 600 may be a system-on-a-chip. In the embodiments of the present application, the system-on-a-chip may consist of a chip or may include a chip and other discrete components. For example, the system-on-a-chip may be an application-specific integrated circuit (ASIC) chip, and the hardware portion of the image color processing device 600 may be a C-mode emulated by the ASIC core. The C-mode may achieve bit-for-bit consistency with the ASIC chip's performance.

[0224] Processor 601 is used to input the image to be processed into a first neural network for operation to obtain a first image, where the first image is a first component image of the image to be processed after being processed by the first neural network; and to perform vector concatenation on the first image and the image to be processed to obtain a first image matrix to be processed; and to input the first image matrix to be processed into a second neural network for operation to obtain a second image, where the second image is a second component image of the image to be processed after being processed by the second neural network; and based on the second image, a processed image is obtained.

[0225] The processor 601 may also be used to execute other corresponding steps or operations of the above method embodiment, which will not be described in detail here.

[0226] The processor 601 can be a general processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic component, a discrete hardware component, and can implement or execute the methods, steps and logical block diagrams disclosed in the embodiments of the present application. The general processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present application can be directly embodied as hardware processor execution or executed by a combination of hardware and software modules in the processor.

[0227] The memory 602 can be a non-volatile memory such as a hard disk drive (HDD) or a solid-state drive (SSD), and can also be a volatile memory such as a random-access memory (RAM). The memory can be any other medium capable of carrying or storing desired program codes in the form of instructions or data structures and capable of being accessed by a computer, but is not limited to this. The memory in the embodiments of the present application can also be a circuit or any other device capable of realizing a storage function, for storing program instructions and / or data.

[0228] Part or all of the operations and functions described in the above method embodiments of the present application can be completed by a chip or an integrated circuit.

[0229] The embodiments of the present application also provide a chip including a processor for supporting the image color processing device to realize the functions involved in the above method embodiments. In a possible design, the chip is connected with a memory or the chip includes a memory, and the memory is used to save necessary program instructions and data of the communication device.

[0230] The embodiments of the present application provide a computer readable storage medium storing a computer program, and the computer program includes instructions for executing the above method embodiments.

[0231] The embodiments of the present application provide a computer program product including instructions, which, when executed on a computer, cause the computer to execute the above method embodiments.

[0232] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can be in 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 codes.

[0233] The 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 such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0234] 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 function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0235] The 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 such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0236] While the preferred embodiments of the application have been described, additional variations and modifications can be employed by those skilled in the art. Therefore, the claimed application is intended to cover all such additional variations and modifications as fall within the true spirit and scope of the application. What is claimed is:

[0237] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims, the application can be practiced otherwise than as specifically described herein.

Claims

1. A method for image color processing, characterized in that: include: determining color values ​​of a plurality of color components of a pixel of the image to be processed; Determining ratios of the brightness value of the pixel to the color values ​​of the plurality of color components; determining a first color adjustment coefficient for the pixel based on the ratio and a first lookup table; performing color processing on the pixels according to the first color adjustment coefficient to obtain a target image; The mapping relationship between the first table entry value and the first lookup table value of the first lookup table satisfies a first power function, and the first lookup table value is a fixed-point value; Determining the value of the first table entry of the first lookup table includes: Dequantizing the fixed-point value according to a maximum value of a value range determined by a bit width of the color value to obtain a floating-point value; Determining a function value of the floating-point value based on the first power function; The function value is quantized according to a preset quantization coefficient to obtain a first table entry value of the first lookup table.

2. The method according to claim 1, wherein The first lookup table includes a mapping relationship between color adjustment coefficients and preset ratios.

3. The method according to claim 2, wherein Determining a first color adjustment coefficient of the pixel according to the ratio and a first lookup table includes: When the preset ratio includes the ratio: determining a first color adjustment coefficient corresponding to the ratio according to the mapping relationship; When the preset ratio does not include the ratio: determining a first preset ratio and a second preset ratio in the first lookup table; Determining, according to the mapping relationship, a first coefficient and a second coefficient corresponding to the first preset ratio and the second preset ratio, respectively; An interpolation operation is performed on the first coefficient and the second coefficient to obtain a first color adjustment coefficient corresponding to the ratio.

4. The method according to claim 3, wherein The interpolation operation includes any of the following types of operations: linear interpolation, approximate interpolation, bilinear quadratic interpolation, cubic interpolation or Lanczos interpolation.

5. The method according to any one of claims 1 to 4, characterized in that The first lookup table value is determined based on an index value of the first lookup table and a step size between index values ​​of the first lookup table.

6. The method according to any one of claims 1 to 4, wherein: The method further includes: determining the first lookup table corresponding to the first value range in which the ratio lies; The value range determined by the bit width of the color value includes the first value range and the second value range corresponding to the second lookup table.

7. The method according to claim 6, wherein The mapping relationship between the second table entry value and the second lookup value in the second lookup table satisfies the first power function.

8. The method according to claim 6, wherein The minimum value of the first value range is greater than the maximum value of the second value range; Correspondingly, the first lookup value of the first lookup table is determined based on the index value of the first lookup table, the step size between the index values ​​of the first lookup table, and the maximum value of the second value range.

9. The method according to claim 6, wherein The step length between index values ​​in the first lookup table is different from the step length between index values ​​in the second lookup table.

10. The method according to any one of claims 1 to 4, characterized in that: The performing color processing on the pixel according to the first color adjustment coefficient includes: determining a second color adjustment coefficient for the pixel; multiplying the first color adjustment coefficient by the second color adjustment coefficient; Color processing is performed on the pixel according to the product of the multiplication.

11. The method according to claim 10, wherein: The image to be processed is an image that has been processed by dynamic range adjustment; The determining the second color adjustment coefficient of the pixel includes: determining a ratio of an electrical signal of the pixel after the dynamic range adjustment process and before the dynamic range adjustment process; The second color adjustment coefficient is determined according to the electrical signal ratio.

12. The method according to claim 11, wherein The second color adjustment coefficient corresponding to the electrical signal ratio is determined by looking up a table.

13. The method according to claim 10, wherein The multiple color components include R component, G component, and B component in the RGB space, and the target image is obtained according to the following formula: Among them, R, G, and B respectively represent the color value of the R component, the color value of the G component, and the color value of the B component of the pixel, R', G', and B' respectively represent the color value of the R component, the color value of the G component, and the color value of the B component of the corresponding pixel in the target image, Y represents the brightness value of the pixel, AlphyR0 represents the first color adjustment coefficient corresponding to the R component of the pixel, AlphyG0 represents the first color adjustment coefficient corresponding to the G component of the pixel, AlphyB0 represents the first color adjustment coefficient corresponding to the B component of the pixel, Alphy1 represents the second color adjustment coefficient, A1 is the quantization coefficient of Alphy1, A2 is the quantization coefficient of AlphyR0, A3 is the quantization coefficient of AlphyG0, and A4 is the quantization coefficient of AlphyB0.

14. The method according to claim 10, wherein The multiple color components include a U component and a V component in a YUV space, and the target image is obtained according to the following formula: Among them, U and V respectively represent the color value of the U component and the color value of the V component of the pixel, U′ and V′ respectively represent the color value of the U component and the color value of the V component of the corresponding pixel in the target image, AlphyU0 represents the first color adjustment coefficient corresponding to the U component of the pixel, AlphyV0 represents the first color adjustment coefficient corresponding to the V component of the pixel, Alphy1 represents the second color adjustment coefficient, A1 is the quantization coefficient of Alphy1, A2 is the quantization coefficient of AlphyU0, and A3 is the quantization coefficient of AlphyV0.

15. An image color processing device, characterized in that: include: a determination module, configured to determine color values ​​of a plurality of color components of a pixel of an image to be processed; Determining ratios of the brightness value of the pixel to the color values ​​of the plurality of color components; determining a first color adjustment coefficient for the pixel based on the ratio and a first lookup table; a processing module, configured to perform color processing on the pixels according to the first color adjustment coefficient to obtain a target image; The mapping relationship between the first table entry value and the first lookup table value of the first lookup table satisfies a first power function, and the first lookup table value is a fixed-point value; The determining module is specifically configured to: Dequantizing the fixed-point value according to a maximum value of a value range determined by a bit width of the color value to obtain a floating-point value; Determining a function value of the floating-point value based on the first power function; The function value is quantized according to a preset quantization coefficient to obtain a first table entry value of the first lookup table.

16. The device according to claim 15, characterized in that The first lookup table includes a mapping relationship between color adjustment coefficients and preset ratios.

17. The device according to claim 16, wherein When determining the first color adjustment coefficient of the pixel according to the ratio and the first lookup table, the determining module is specifically configured to: When the preset ratio includes the ratio: determining a first color adjustment coefficient corresponding to the ratio according to the mapping relationship; When the preset ratio does not include the ratio: determining a first preset ratio and a second preset ratio in the first lookup table; Determining, according to the mapping relationship, a first coefficient and a second coefficient corresponding to the first preset ratio and the second preset ratio, respectively; An interpolation operation is performed on the first coefficient and the second coefficient to obtain a first color adjustment coefficient corresponding to the ratio.

18. The device according to claim 17, wherein The interpolation operation includes any of the following types of operations: linear interpolation, approximate interpolation, bilinear quadratic interpolation, cubic interpolation or Lanczos interpolation.

19. The device according to any one of claims 15 to 18, characterized in that The first lookup table value is determined based on an index value of the first lookup table and a step size between index values ​​of the first lookup table.

20. The device according to any one of claims 15 to 18, characterized in that The determining module is further configured to: determine the first lookup table corresponding to the first value range in which the ratio lies; The value range determined by the bit width of the color value includes the first value range and the second value range corresponding to the second lookup table.

21. The device according to claim 20, characterized in that The mapping relationship between the second table entry value and the second lookup value in the second lookup table satisfies the first power function.

22. The device according to claim 20, wherein The minimum value of the first value range is greater than the maximum value of the second value range; Correspondingly, the first lookup value of the first lookup table is determined based on the index value of the first lookup table, the step size between the index values ​​of the first lookup table, and the maximum value of the second value range.

23. The device according to claim 20, wherein The step length between index values ​​in the first lookup table is different from the step length between index values ​​in the second lookup table.

24. The device according to any one of claims 15 to 18, characterized in that When performing color processing on the pixel according to the first color adjustment coefficient, the processing module is specifically configured to: determining a second color adjustment coefficient for the pixel; multiplying the first color adjustment coefficient by the second color adjustment coefficient; Color processing is performed on the pixel according to the product of the multiplication.

25. The device according to claim 24, wherein The image to be processed is an image that has been processed by dynamic range adjustment; When determining the second color adjustment coefficient of the pixel, the determination module is specifically configured to: determining a ratio of an electrical signal of the pixel after the dynamic range adjustment process and before the dynamic range adjustment process; The second color adjustment coefficient is determined according to the electrical signal ratio.

26. The device according to claim 25, characterized in that The second color adjustment coefficient corresponding to the electrical signal ratio is determined by looking up a table.

27. The device according to claim 24, wherein The multiple color components include R component, G component, and B component in the RGB space, and the target image is obtained according to the following formula: Among them, R, G, and B respectively represent the color value of the R component, the color value of the G component, and the color value of the B component of the pixel, R', G', and B' respectively represent the color value of the R component, the color value of the G component, and the color value of the B component of the corresponding pixel in the target image, Y represents the brightness value of the pixel, AlphyR0 represents the first color adjustment coefficient corresponding to the R component of the pixel, AlphyG0 represents the first color adjustment coefficient corresponding to the G component of the pixel, AlphyB0 represents the first color adjustment coefficient corresponding to the B component of the pixel, Alphy1 represents the second color adjustment coefficient, A1 is the quantization coefficient of Alphy1, A2 is the quantization coefficient of AlphyR0, A3 is the quantization coefficient of AlphyG0, and A4 is the quantization coefficient of AlphyB0.

28. The device according to claim 24, wherein The multiple color components include a U component and a V component in a YUV space, and the target image is obtained according to the following formula: Among them, U and V respectively represent the color value of the U component and the color value of the V component of the pixel, U′ and V′ respectively represent the color value of the U component and the color value of the V component of the corresponding pixel in the target image, AlphyU0 represents the first color adjustment coefficient corresponding to the U component of the pixel, AlphyV0 represents the first color adjustment coefficient corresponding to the V component of the pixel, Alphy1 represents the second color adjustment coefficient, A1 is the quantization coefficient of Alphy1, A2 is the quantization coefficient of AlphyU0, and A3 is the quantization coefficient of AlphyV0.

29. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed on a neural network-based image processing device, the device executes the method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Image processing method and apparatus

    WO2018035691A1