Image processing method and device, electronic equipment and readable storage medium

By acquiring the YUV data of an image and converting it to RGB data using a preset color conversion formula, the problem of high algorithm complexity and large computational load in existing technologies is solved, achieving fast and high-quality image color enhancement suitable for mobile terminal devices.

CN114494051BActive Publication Date: 2025-12-19BIGO TECH PTE LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210043522.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-14
Publication Date
2025-12-19
Estimated Expiration
2042-01-14

AI Technical Summary

Technical Problem

Existing image color enhancement methods have high algorithm complexity and large computational load, which makes them unable to be processed in real time and affects the smoothness of mobile terminal devices.

Method used

By acquiring the YUV data of an image, determining its encoding standard and color encoding type, and using a preset color conversion formula, the YUV data is directly converted into RGB data to achieve color enhancement.

Benefits of technology

It reduces algorithm complexity and computational load, enabling the rapid acquisition of high-quality color-enhanced images without affecting the smoothness of mobile terminal devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494051B_ABST
    Figure CN114494051B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an image processing method and device, electronic equipment and readable storage medium, the method comprising: obtaining YUV data corresponding to an original image to be processed; determining an encoding standard and a color encoding type corresponding to the YUV data, wherein the color encoding type represents the type of numerical encoding range adopted when encoding the color of a pixel in the original image based on the encoding standard; and converting the YUV data into RGB data based on a preset color conversion formula according to the encoding standard and the color encoding type to obtain a target enhanced image. The method can quickly obtain a target enhanced image while ensuring image quality and not affecting the smoothness of a mobile terminal device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the technical field of image processing, and more particularly, to an image processing method and device, an electronic device, and a computer-readable storage medium. BACKGROUND

[0002] Color enhancement refers to adjusting contrast, saturation, brightness, etc. of an original image or a video frame in a video picture, so as to improve the quality of the image or the video picture and bring better subjective experience to users.

[0003] At present, when enhancing the color of an image, generally, either a data statistics-based method is used to adaptively adjust the image to obtain an enhanced image, or a machine learning method is used to pre-train an image enhancement neural network model to enhance the image to be processed based on the trained image enhancement neural network model to obtain an enhanced image.

[0004] However, the existing method has high algorithm complexity and relatively large data calculation amount when enhancing the image, so that the processing speed and the image quality cannot be considered at the same time, that is, the color of the image cannot be enhanced in real time while ensuring the highest image quality. In addition, with the popularization of mobile terminal devices, due to the limitation of hardware conditions of the mobile terminal devices, when the above method is implemented in the mobile terminal devices to enhance the image, the mobile terminal devices may be overheated, the power consumption may be increased, and even the system on chip (SOC) may be reduced in frequency, thereby affecting the fluency of the mobile terminal devices. SUMMARY

[0005] An object of the present disclosure is to provide an image processing method to solve the problem that the existing color enhancement of an image or a video may not be enhanced in real time and may affect the fluency of a mobile terminal device due to high algorithm complexity and large data calculation amount.

[0006] In a first aspect, an image processing method is provided, and the method comprises:

[0007] obtaining YUV data corresponding to an original image to be processed;

[0008] determining an encoding standard and a color encoding type corresponding to the YUV data, wherein the color encoding type represents a type of a numerical encoding range used when encoding the color of a pixel in the original image based on the encoding standard;

[0009] The YUV data is converted into RGB data based on a preset color conversion formula according to the encoding standard and the color encoding type, so as to obtain a target enhanced image.

[0010] In a second aspect, the present disclosure provides an image processing apparatus, comprising:

[0011] a data acquisition module configured to acquire YUV data corresponding to an original image to be processed;

[0012] an encoding information determination module configured to determine an encoding standard and a color encoding type corresponding to the YUV data, wherein the color encoding type represents a type of numerical encoding range adopted when encoding colors of pixels in the original image based on the encoding standard;

[0013] an image processing module configured to convert the YUV data into RGB data based on a preset color conversion formula according to the encoding standard and the color encoding type, so as to obtain a target enhanced image.

[0014] In a third aspect, the present disclosure also provides an electronic device, comprising:

[0015] a memory configured to store executable instructions;

[0016] a processor configured to control the electronic device to execute the method according to the first aspect of the present disclosure according to the instructions.

[0017] In a fourth aspect, the present disclosure also provides a computer-readable storage medium storing a computer program readable and executable by a computer, wherein the computer program is configured to execute the method according to the first aspect of the present disclosure when being read and executed by the computer.

[0018] An advantage of the embodiments of the present disclosure is that, according to the embodiments of the present disclosure, after an electronic device, especially a mobile terminal device, acquires YUV data corresponding to an original image to be processed, the electronic device does not need to perform data statistics on colors of each pixel in the YUV data to perform color enhancement, nor does it need to perform enhancement processing on the colors in the YUV data based on a pre-trained image enhancement neural network model, but only needs to determine an encoding standard and a color encoding type corresponding to the YUV data, and then directly converts the YUV data into RGB data based on a preset color conversion formula, so as to obtain a target enhanced image with color enhancement. The method provided by the embodiments of the present disclosure has relatively low algorithm complexity and relatively small calculation amount, and can quickly obtain a target enhanced image while ensuring image quality and not affecting the fluency of the mobile terminal device.

[0019] Other features of the present specification, and the advantages thereof over existing systems and methods will become more readily apparent from the following detailed description, when read in conjunction with the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings incorporated in and forming a part of the specification illustrate embodiments of the present specification and, together with the description, serve to explain the principles of the present specification.

[0021] Figure 1 is a flow diagram of an image processing method provided by an embodiment of the present disclosure.

[0022] Figure 2 is a detailed flow diagram of an image enhancement processing provided by an embodiment of the present disclosure.

[0023] Figure 3 is a first contrast diagram for illustrating image color enhancement effects.

[0024] Figure 4 is a second contrast diagram for illustrating image color enhancement effects.

[0025] Figure 5 is a principle block diagram of a user category recognition device provided by an embodiment of the present disclosure.

[0026] Figure 6 is a hardware structure diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. If it is considered that the relative arrangement, numerical expressions, and numerical values of components and steps set forth in these embodiments limit the scope of the present disclosure, unless otherwise specifically stated, the scope of the present disclosure is not limited thereto.

[0028] The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the scope of the present disclosure, its application, or uses.

[0029] Techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail herein, but should be considered as part of the specification, where appropriate.

[0030] In all of the examples shown and discussed herein, any specific values should be interpreted as merely exemplary, and not as a limitation. Thus, other examples of the exemplary embodiments can have different values.

[0031] It should be noted that like reference numerals and letters refer to like items in the drawings and that a discussion of an item in one drawing does not preclude further discussion of that item in a subsequent drawing. It should be noted that like reference numerals and letters refer to like items in the drawings and that a discussion of an item in one drawing does not preclude further discussion of that item in a subsequent drawing.

[0032] <Method embodiments>

[0033] Generally, due to the limitation of the collection scene or the collection device, the original image or the video picture may have problems such as overexposure, overexposure, dull color, low contrast, and misty feeling, especially in the live scene. Such problems may be more serious. Since the live picture is usually displayed in a mobile terminal device, such as a mobile phone, if the existing data statistics-based method or image enhancement neural network model is applied in the mobile terminal device to enhance the live picture, on the one hand, the real-time performance of image enhancement cannot be guaranteed, and on the other hand, the mobile terminal device may be overheated, the power consumption may be increased, and even the SOC may be reduced to affect the smoothness of the device.

[0034] To solve the above problems, the embodiments of the present disclosure provide an image processing method, which can not require a large amount of calculation, so as to achieve the effect of real-time color enhancement of the image or the video picture, such as the live picture, on the premise of guaranteeing the high quality of the image and the smoothness of the mobile terminal device. Please refer to Figure 1 , which is a flowchart of the image processing method provided by the embodiments of the present disclosure. The method can be implemented in an electronic device, which can be a server, such as a blade server, a rack-mounted server, etc. Preferably, the electronic device can be a mobile terminal device, such as a mobile phone, a tablet computer, etc. For convenience of description, in the embodiments of the present disclosure, the electronic device implementing the method is taken as a mobile phone, the method is applied in the live scene, and the original image to be processed is taken as a live picture for example.

[0035] As shown in Figure 1 , the method of the present embodiment can include the following steps S1100-S1300, which will be described in detail below.

[0036] Step S1100, obtaining YUV data corresponding to the original image to be processed.

[0037] The original image can be an image or a video frame in a video. For example, the original image can be a live picture captured by a host based on a camera on a mobile phone in a live scene, or it can also be a live picture viewed by an audience based on its mobile phone.

[0038] It should be noted that in the field of image processing, the color of a pixel can generally be described by a color space, which is a space coordinate formed by three independent variables when describing the color by three independent attributes. The color object being described is objectively existing, and different color spaces usually only measure the same color object from different angles. Color spaces can be generally divided into primary color color spaces and chrominance and luminance separation color spaces according to the structure. The common primary color color space is the RGB color space, in which R represents red, G represents green, and B represents blue. The common chrominance and luminance separation color space includes the YUV color space and the HSV color space, in which Y represents brightness, U and V represent chrominance in the YUV color space, and H represents hue, S represents saturation, and V represents lightness in the HSV color space.

[0039] Generally, after collecting image or video data, it is usually stored in RGB format. When transmitting image or video data, in order to reduce the amount of data transmission to reduce bandwidth consumption and improve transmission speed, the collected image or video data is usually converted to YUV format first, and the converted YUV data is encoded for transmission. The receiving end restores the YUV data by decoding after receiving the encoded data packet of the YUV data and performs original color format conversion processing to restore the original image or video data and render it.

[0040] For example, in a live streaming scenario, a common data processing process can be: 1. The host end collects a live streaming picture in RGB format; 2. The host end converts the live streaming picture in RGB format to YUV format to obtain corresponding YUV data; 3. The host end encodes the obtained YUV data and transmits the encoded data packet to the server based on the network; 4. The server receives the encoded packet and distributes it to the audience end; 5. The audience end receives the encoded packet, restores the YUV data, and converts it to RGB data by RGB format conversion; 6. The live streaming picture is rendered based on the RGB data for the audience to view.

[0041] In specific implementation, when converting the original image in RGB format to YUV format, the color of each pixel can be converted according to the corresponding conversion formula, and the detailed conversion method is not described here.

[0042] Step S1200, determining the encoding standard and color encoding type corresponding to the YUV data, wherein the color encoding type represents the type of numerical encoding range used when encoding the color by the encoding standard.

[0043] Generally, two different encoding standards are distinguished in a broad sense, namely, BT601 standard and BT709 standard, and under different encoding standards, at least two color encoding types are included according to the different numerical coding ranges adopted when encoding the colors, and the two color encoding types are specifically a first preset type and a second preset type, wherein the first preset type can be a FullRange type, and the second preset type can be a VideoRange type.

[0044] When encoding the colors of the pixels in the image based on different color encoding types, if the color encoding type is a FullRange type, then the numerical coding range of the YUV channel is [0, 255] when encoding the color of the pixel in the image; and if the color encoding type is a VideoRange type, then the numerical coding range of the Y channel is [16, 235], and the numerical coding range of the UV channel is [16, 240].

[0045] In a specific implementation, the YUV data corresponding to the original image is usually sent to the receiving end in the form of an encoded data packet, and the receiving end can obtain the YUV data by parsing the encoded packet, and obtain the encoding standard and the color encoding type corresponding to the YUV data by the data field in the encoded packet for indicating the encoding standard and the corresponding color encoding type.

[0046] It should be noted that if the method is directly performed by the electronic device alone, that is, the electronic device performs the method provided in this embodiment to enhance the original image after obtaining the original image, then because the encoding standard and the corresponding color encoding type can be determined when the original image is converted from RGB format to YUV format YUV data.

[0047] Of course, the above is only an example of how to determine the encoding standard and the color encoding type of the YUV data, and in a specific implementation, the encoding standard and the color encoding type of the YUV data can also be determined by other methods, which will not be described here.

[0048] Step S1300, converting the YUV data into RGB data according to the encoding standard and the color encoding type to obtain a target enhanced image.

[0049] After determining the encoding standard and color encoding type of the YUV data corresponding to the original image based on the above steps, the image processing method provided by the embodiment of the present disclosure adjusts the color conversion formula when converting the YUV data to RGB data, and performs color conversion on the YUV data in a "deliberate mismatch" manner, so that the color of the target enhanced image in RGB format obtained by conversion is more vivid, and the fogging feeling is relieved, and the contrast is improved. The following will explain in detail how to adjust the color conversion formula to realize color enhancement processing.

[0050] Specifically, when converting YUV data to RGB data, the conversion formula is often different according to the different encoding standards and color encoding types.

[0051] Generally, when converting YUV data of a color encoding type of a first preset type, i.e., a FullRange type, to RGB data, the color of each pixel is usually converted based on the following formula 1; and when converting YUV data of a color encoding type of a second preset type, i.e., a VideoRange type, to RGB data, the color of each pixel is usually converted based on the following formula 2.

[0052]

[0053]

[0054] wherein C L , C F are 3*3 color matrices under the VideoRange type and the FullRange type of the BT601 standard and the BT709 standard respectively, and the color matrices have different parameters under different encoding standards and different color encoding types.

[0055] Please refer to Figure 2 , which is a detailed flowchart of the image enhancement processing provided by the embodiment of the present disclosure.

[0056] As Figure 2 shown, in one embodiment, the YUV data is converted to RGB data based on a preset color conversion formula according to the encoding standard and the color encoding type to obtain a target enhanced image, including: determining whether the color encoding type is a first preset type; and step S1310, in the case that the color encoding type is the first preset type, the YUV data is converted to RGB data based on a preset color conversion formula to obtain the target enhanced image; wherein the preset color conversion formula is a color conversion formula corresponding to a second preset type under the encoding standard.

[0057] Specifically, in a case that the color encoding type of the YUV data corresponding to the original image is determined as the first preset type, i.e., the FullRange type, the color conversion of the YUV data can be performed using the color conversion formula corresponding to the second preset type, i.e., the VideoRange type, under the encoding standard, i.e., the above-mentioned formula 2, to enhance the color of the pixels in the original image, and then obtain the target enhanced image.

[0058] For example, if the encoding standard of the YUV data corresponding to the original image is the BT601 standard, and the color encoding type of the YUV data is originally the FullRange type, the color conversion of the YUV data can be directly performed based on the color conversion formula corresponding to the VideoRange type under the BT601 standard, i.e., the above-mentioned formula 2.

[0059] For another example, if the encoding standard of the YUV data corresponding to the original image is the BT709 standard, and the color encoding type of the YUV data is originally the FullRange type, the color conversion of the YUV data can be directly performed based on the color conversion formula corresponding to the VideoRange type under the BT709 standard, i.e., the above-mentioned formula 2.

[0060] Please continue to refer to Figure 2 In one embodiment, the converting the YUV data into the RGB data according to the encoding standard and the color encoding type to obtain the target enhanced image further includes: in a case that the color encoding type is not the first preset type, performing step S1320 of converting the color encoding type of the YUV data from the second preset type to the first preset type based on the color type conversion formula corresponding to the first preset type under the encoding standard; and then performing step S1330 of converting the converted YUV data into the RGB data based on the preset color conversion formula to obtain the target enhanced image.

[0061] Specifically, in a case that the color encoding type of the YUV data corresponding to the original image is determined as the second preset type, i.e., the VideoRange type, the YUV data of the VideoRange type can be converted into the YUV data of the FullRange type; and then the color conversion of the YUV data converted into the FullRange type is performed based on the above-mentioned formula 2 to obtain the target enhanced image.

[0062] That is, in the embodiments of the present disclosure, the key point is to perform color conversion on YUV data based on a color conversion formula with "intentional mismatch", that is, for YUV data with a color encoding type of a first preset type, namely, a FullRange type, a color conversion formula of a second preset type, namely, a VideoRange type, is used to perform color conversion on the YUV data, and if the original color encoding type of the YUV data corresponding to the original image is not the FullRange type, the YUV data is first converted to the FullRange type, and then color conversion is performed on the YUV data based on the color conversion formula of the VideoRange type with mismatch, so as to achieve the effect of color enhancement.

[0063] For example, if the encoding standard of the YUV data corresponding to the original image is the BT601 standard, and the color encoding type of the YUV data is originally the VideoRange type, the YUV data of the VideoRange type is first converted to YUV data of the FullRange type, and then color conversion is performed on the converted YUV data of the FullRange type based on the color conversion formula corresponding to the VideoRange type under the BT601 standard, namely, the above formula 2.

[0064] For example, if the encoding standard of the YUV data corresponding to the original image is the BT709 standard, and the color encoding type of the YUV data is originally the VideoRange type, the YUV data of the VideoRange type is first converted to YUV data of the FullRange type, and then color conversion is performed on the converted YUV data of the FullRange type based on the color conversion formula corresponding to the VideoRange type under the BT709 standard, namely, the above formula 2.

[0065] It should be noted that, in specific implementation, in order to further reduce the amount of calculation, in an embodiment, the conversion of the YUV data into RGB data according to the encoding standard and the color encoding type to obtain the target enhanced image further includes: obtaining a target color conversion formula by merging a color type conversion formula corresponding to the first preset type under the encoding standard and the preset color conversion formula; and converting the YUV data into RGB data based on the target color conversion formula to obtain the target enhanced image in a case where the color encoding type is not the first preset type.

[0066] Specifically, in a case where the YUV data corresponding to the original image is of a second preset type, namely, a VideoRange type, the two steps of color type conversion and color conversion can be merged into one step to reduce the amount of calculation and improve the processing speed, and how to merge the two steps will be described in detail below.

[0067] First, when converting YUV data of type VideoRange to type FullRange, the following formula 3 can be obtained from formulas 1 and 2 above:

[0068]

[0069] Rewriting Formula 3 in homogeneous coordinate form, we obtain Formula 4:

[0070]

[0071] Then in record In this case, Formula 4 above can be expressed as Formula 5 below:

[0072]

[0073] Therefore, according to Formula 5 above, the formula for converting YUV data of type VideoRange to type FullRange is as follows: Formula 6:

[0074]

[0075] Having obtained Formula 6 above, Formula 7 can be used to represent how to convert the converted FullRange type YUV data into RGB data based on the mismatched VideoRange type color conversion formula:

[0076]

[0077] Then record In this case, Formula 7 above can be expressed as Formula 8 below:

[0078]

[0079] Among them, because C′ L T L (C′ F T F ) -1 C′ L The color matrices under different encoding standards are constants, so they can be pre-calculated and determined. Thus, when performing the above conversion, the target color conversion formula, i.e., the above formula 8, can be used to directly perform color conversion on YUV data that are not of the FullRange type under different encoding standards, so as to quickly obtain the target enhanced image.

[0080] It should be noted that in actual application, the embodiment of the present disclosure can be applied in a live broadcast scene, that is, color enhancement can be performed on a live broadcast picture watched by a host end and a viewer end in a live broadcast scene, so as to provide a high-quality live broadcast picture for the host and the viewer to watch without reducing the fluency of the mobile terminal device used by the host and the viewer, that is, in an embodiment, the original image to be processed can be a live broadcast picture; after the target enhanced image corresponding to the live broadcast picture is obtained, the method further includes: displaying the target enhanced image to display the enhanced live broadcast picture for a user to watch.

[0081] As can be known from the above description, the image processing method provided by the embodiment of the present disclosure does not need additional calculation overhead when performing color enhancement on the pixels in the image, and the calculation amount is relatively small, so that the original image can be quickly enhanced under the premise of guaranteeing the image quality and not affecting the fluency of the mobile terminal device. In order to better illustrate the effect of the method provided by the embodiment of the present disclosure, please see Figure 3 and Figure 4 which are respectively a first comparison diagram and a second comparison diagram for illustrating the image color enhancement effect. As shown in Figure 3 and Figure 4 After the color enhancement of the original image is performed based on the embodiment of the present disclosure, the contrast and saturation of the image are improved to a certain extent, and the original foggy feeling of the image is significantly relieved, and the overall clarity of the image is improved.

[0082] In summary, after the electronic device, especially the mobile terminal device, obtains the YUV data corresponding to the original image to be processed, the method provided by the embodiment of the present disclosure can not need to perform data statistics on the color of each pixel in the YUV data to perform color enhancement, nor need to perform enhancement processing on the color in the YUV data based on the image enhancement neural network model obtained by pre-training, but only needs to determine the encoding standard and color encoding type corresponding to the YUV data, and then directly converts the YUV data into RGB data based on the preset color conversion formula, so as to obtain the target enhanced image with color enhancement. The algorithm complexity of the method provided by the embodiment of the present disclosure is relatively low, and the calculation amount is also small, so that the target enhanced image can be quickly obtained under the premise of guaranteeing the image quality and not affecting the fluency of the mobile terminal device.

[0083] <Device Embodiment>

[0084] Corresponding to the above method embodiment, in the present embodiment, an image processing device is also provided, as shown in Figure 5 The device 500 can include a data acquisition module 510, an encoding information determination module 520, and an image processing module 530.

[0085] The data acquisition module 510 is configured to acquire YUV data corresponding to the original image to be processed; the encoding information determination module 520 is configured to determine an encoding standard and a color encoding type corresponding to the YUV data, wherein the color encoding type represents a type of numerical encoding range adopted when encoding the color of a pixel in the original image based on the encoding standard; and the image processing module 530 is configured to convert the YUV data into RGB data based on a preset color conversion formula according to the encoding standard and the color encoding type, to obtain a target enhanced image.

[0086] <Device Embodiment>

[0087] In this embodiment, an electronic device is also provided, which comprises the device as described above. Figure 6 The electronic device 600 can comprise a processor 620 and a memory 610 configured to store executable instructions, and the processor 620 is configured to execute the electronic device according to the control of the instructions to perform the method according to any embodiment of the present disclosure.

[0088] <Computer-readable storage medium embodiment>

[0089] The present embodiment provides a computer-readable storage medium, which stores executable instructions, and the executable instructions are executed by a processor to perform the method described in any method embodiment of the present specification.

[0090] The flowcharts and block diagrams in the drawings show the possible implementation architecture, function and operation of the system, method and computer program product according to the embodiments of the present specification. In this regard, each block in the flowchart or block diagram can represent a module, a program segment or a part of instructions, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks can also occur in different order from that noted in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that hardware implementation, software implementation and implementation by combining software and hardware are equivalent.

[0091] Having described above several embodiments of the present specification, any modifications and variations that fall within the scope of the described embodiments are also intended to be within the scope of the present specification. As will be apparent to those of ordinary skill in the art, many modifications and variations of the present specification are possible in light of the above teachings. The choice of words in this document is intended to convey the best of the principles, practical application, or technical improvement in the art to which it pertains, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present application is defined by the claims appended hereto.

Claims

1. An image processing method, characterized by, The method comprises the following steps: acquiring YUV data corresponding to a to-be-processed original image; determining an encoding standard and a color encoding type corresponding to the YUV data, wherein the color encoding type represents a type of numerical encoding range adopted when encoding the color of a pixel in the original image based on the encoding standard; converting the YUV data into RGB data based on a preset color conversion formula according to the encoding standard and the color encoding type, to obtain a target enhanced image; wherein the color encoding type comprises a first preset type and a second preset type, the first preset type comprises a FullRange type, and the second preset type comprises a VideoRange type; the step of converting the YUV data into RGB data based on a preset color conversion formula according to the encoding standard and the color encoding type, to obtain a target enhanced image, comprises: determining whether the color encoding type is the first preset type; in a case where the color encoding type is the first preset type, converting the YUV data into RGB data based on the preset color conversion formula, to obtain the target enhanced image; wherein the preset color conversion formula is a color conversion formula corresponding to the second preset type under the encoding standard.

2. The method of claim 1, wherein, the step of converting the YUV data into RGB data based on a preset color conversion formula according to the encoding standard and the color encoding type, to obtain a target enhanced image, further comprises: in a case where the color encoding type is not the first preset type, converting the color encoding type of the YUV data from the second preset type to the first preset type based on a color type conversion formula corresponding to the first preset type under the encoding standard; converting the converted YUV data into RGB data based on the preset color conversion formula, to obtain the target enhanced image.

3. The method of claim 1, wherein, the step of converting the YUV data into RGB data based on a preset color conversion formula according to the encoding standard and the color encoding type, to obtain a target enhanced image, further comprises: obtaining a target color conversion formula by merging the color type conversion formula corresponding to the first preset type under the encoding standard and the preset color conversion formula; in a case where the color encoding type is not the first preset type, converting the YUV data into RGB data based on the target color conversion formula, to obtain the target enhanced image.

4. The method of claim 1, wherein, The original image comprises a live picture; after the target enhanced image is obtained, the method further comprises: displaying the target enhanced image.

5. The method of claim 1, wherein, The encoding standard comprises at least one of a BT601 standard and a BT709 standard.

6. An image processing apparatus characterized by comprising: The method comprises the following steps: a data acquisition module configured to acquire YUV data corresponding to a to-be-processed original image; The coding information determination module is configured to determine a coding standard and a color coding type corresponding to the YUV data, wherein the color coding type represents a type of a numerical coding range adopted when colors of pixels in the original image are coded based on the coding standard, the color coding type comprises a first preset type and a second preset type, the first preset type comprises a FullRange type, and the second preset type comprises a VideoRange type. The image processing module is configured to convert the YUV data into RGB data based on a preset color conversion formula according to the coding standard and the color coding type, so as to obtain a target enhanced image. The image processing module is further configured to determine whether the color coding type is the first preset type, and convert the YUV data into RGB data based on the preset color conversion formula to obtain the target enhanced image in a case where the color coding type is the first preset type, wherein the preset color conversion formula is a color conversion formula corresponding to the second preset type under the coding standard.

7. An electronic device, comprising: The electronic device comprises: a memory configured to store executable instructions; a processor configured to control execution of the electronic device according to the instructions to perform the method of any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program readable and executable by a computer, and the computer program is configured to perform the method of any one of claims 1-5 when being read and executed by the computer. The computer readable storage medium stores a computer program readable and executable by a computer, and the computer program is configured to perform the method of any one of claims 1-5 when being read and executed by the computer.

Citation Information

Patent Citations

  • Fast Filtered YUV to RGB Conversion

    US20080180456A1

  • Video processing method and apparatus, storage medium, and computer device

    WO2021104079A1