CN112330564A - Image processing method, image processing device, electronic equipment and readable storage medium - Google Patents

Image processing method, image processing device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112330564A
CN112330564A CN202011253511.6A CN202011253511A CN112330564A CN 112330564 A CN112330564 A CN 112330564A CN 202011253511 A CN202011253511 A CN 202011253511A CN 112330564 A CN112330564 A CN 112330564A
Authority
CN
China
Prior art keywords
ratio
channel
image
component
saturation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011253511.6A
Other languages
Chinese (zh)
Other versions
CN112330564B (en
Inventor
李永超
赵博
洪星智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Eswin Computing Technology Co Ltd
Haining Eswin IC Design Co Ltd
Original Assignee
Beijing Eswin Computing Technology Co Ltd
Haining Eswin IC Design Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Eswin Computing Technology Co Ltd, Haining Eswin IC Design Co Ltd filed Critical Beijing Eswin Computing Technology Co Ltd
Priority to CN202011253511.6A priority Critical patent/CN112330564B/en
Publication of CN112330564A publication Critical patent/CN112330564A/en
Priority to PCT/CN2021/098613 priority patent/WO2022100082A1/en
Application granted granted Critical
Publication of CN112330564B publication Critical patent/CN112330564B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Color Image Communication Systems (AREA)

Abstract

The invention provides an image processing method, an image processing device, an electronic device and a storage medium, wherein the image processing method comprises the following steps: acquiring an RGB image; converting the RGB image into a YUV image; raising a Y-channel of the YUV image from a first luma component to a second luma component; calculating the change proportion of the brightness component of the Y channel according to the first brightness component and the second brightness component; and compensating the saturation components of the U channel and the V channel of the YUV image according to the change proportion. According to the invention, the change proportion of the brightness component of the Y channel is obtained, the change proportion is compared with the preset value, and the saturation component is correspondingly compensated according to the comparison result, so that the phenomenon of color shearing caused when the saturation of the image is compensated after the brightness of the image is processed is avoided, the details of the image are protected, and the image display with higher quality is realized.

Description

Image processing method, image processing device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method and apparatus, an electronic device, and a storage medium.
Background
"Y" in YUV color space represents brightness, i.e., a gray scale value; and "U" and "V" indicate image color saturation for specifying the color of the pixel. In the process of image or video processing, brightness and saturation are well separated in a YUV color space, but if only brightness or saturation is processed, and saturation and brightness corresponding to the brightness or the saturation are not processed, the problem of color and brightness mismatch is generated, for example, the phenomenon of color whitening or oversaturation occurs in an image.
In order to improve the above phenomenon, after the image is subjected to the brightness processing, the saturation of the image is compensated correspondingly, however, the compensation processing may cause a color clipping problem, which is embodied as the color in the image is darkened or the detail is lost.
Disclosure of Invention
The invention provides an image processing method, an image processing device, an electronic device and a storage medium, which are used for solving the problem that after brightness processing is carried out on an image, corresponding compensation processing is carried out on the saturation of the image, but color shearing phenomenon is caused by the compensation processing.
According to a first aspect of the present invention, there is provided an image processing method comprising: acquiring an RGB image; converting the RGB image into a YUV image; raising a Y-channel of the YUV image from a first luma component to a second luma component; calculating the change proportion of the brightness component of the Y channel according to the first brightness component and the second brightness component; and compensating the saturation components of the U channel and the V channel of the YUV image according to the change proportion.
In some embodiments, the calculation formula of the change ratio is:
Figure BDA0002772369740000011
wherein Ratio is a variation Ratio, YoutIs the second luminance component, Yinδ is a predetermined extremum that is not zero for the first luminance component.
In some embodiments, the calculation formula of the saturation component is: u shapeout=Ratio*Uin;Vout=Ratio*Vin(ii) a Wherein, UinIs the original saturation component of the U channel, UoutFor the saturation component, V, compensated for the U channelinIs the original saturation component of the V channel, VoutThe saturation component compensated for the V channel.
In some embodiments, the step of compensating the saturation components of the U-channel and the V-channel of the YUV image according to the varying scale includes: judging whether the change proportion is smaller than a preset value or not; when the change proportion is judged to be smaller than the preset value, the change proportion is adjusted to be a first proportion; when the change proportion is judged to be larger than or equal to the preset value, the change proportion is adjusted to be a second proportion; and compensating the saturation components of the U channel and the V channel of the YUV image according to the first proportion or the second proportion.
In some embodiments, the step of adjusting the change ratio to the first ratio includes: acquiring brightness data of the YUV image; acquiring a first gain coefficient corresponding to the brightness data; and adjusting the change proportion to a first proportion according to the first gain coefficient.
In some embodiments, the first ratio is calculated by the formula: ratio (R)L=Ratio*LUTy(ii) a Wherein RatioLIn a first ratio, LUTyIs the first gain factor.
In some embodiments, the step of adjusting the change ratio to the second ratio includes: acquiring saturation data of the YUV image; acquiring a second gain coefficient corresponding to the saturation data; and adjusting the change proportion to a second proportion according to the second gain coefficient.
In some embodiments, the second ratio is calculated by the formula: ratio (R)H=Ratio*LUTsat(ii) a Wherein RatioHIn a second ratio, LUTsatIs the second gain factor.
According to a second aspect of the present invention, there is provided an image processing apparatus comprising: the acquisition module is used for acquiring an RGB image; the conversion module is used for converting the RGB image into a YUV image; the pull-up module is used for pulling up the Y channel of the YUV image from a first brightness component to a second brightness component; the calculation module is used for calculating the change proportion of the brightness component of the Y channel according to the first brightness component and the second brightness component; and the compensation module is used for compensating the saturation components of the U channel and the V channel of the YUV image according to the change proportion.
According to a third aspect of the invention, the invention provides an electronic device comprising a processor, a memory and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the image processing method as described above.
According to a fourth aspect of the present invention, there is provided a readable storage medium on which a program or instructions are stored, which when executed by a processor, implement the image processing method as described above.
Compared with the prior art, the invention has the beneficial effects that: by acquiring the change proportion of the brightness component of the Y channel, comparing the change proportion with a preset value and correspondingly compensating the saturation component according to the comparison result, the phenomenon of color shearing caused when the saturation of the image is compensated after the brightness of the image is processed is avoided, the details of the image are protected, and the image display with higher quality is realized.
Drawings
Fig. 1 is a schematic flowchart illustrating steps of an image processing method according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating the step of step S15 shown in fig. 1.
Fig. 3 is a flowchart illustrating the step of step S22 shown in fig. 2.
Fig. 4 is a flowchart illustrating the step of step S23 shown in fig. 2.
Fig. 5 is a schematic structural diagram of a luminance mapping curve according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of a saturation mapping curve according to an embodiment of the present invention.
Fig. 7 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides an image processing method applied to an electronic device, where the method includes steps S11 to S15.
In step S11, an RGB image is acquired.
Step S12, converting the RGB image into a YUV image.
In the embodiment of the present invention, in the process of converting an RGB image into a YUV image, converting RGB to obtain a luminance signal Y channel and two saturation signals U and V channels, and specifically, converting RGB into YUV may refer to the prior art.
Step S13, raising the Y channel of the YUV image from the first luminance component to the second luminance component.
Step S14, calculating a change ratio of the luminance component of the Y channel according to the first luminance component and the second luminance component.
In the embodiment of the present invention, optionally, the calculation formula of the change ratio is:
Figure BDA0002772369740000041
wherein Ratio is a variation Ratio, YoutIs the second luminance component, Yinδ is a predetermined extremum that is not zero for the first luminance component. Where δ is a minimum value used to prevent the denominator from being zero.
And step S15, compensating the saturation components of the U channel and the V channel of the YUV image according to the change proportion.
In this embodiment of the present invention, optionally, the calculation formula of the saturation component is: u shapeout=Ratio*Uin;Vout=Ratio*Vin(ii) a Wherein, UinIs the original saturation component of the U channel, UoutFor the saturation component, V, compensated for the U channelinIs the original saturation component of the V channel, VoutThe saturation component compensated for the V channel.
And correspondingly adjusting the saturation component according to the change proportion of the brightness data, so that the color of the image after color compensation is maintained, and the image quality is improved.
Referring to fig. 2, step S15 may further include steps S21 through S24.
Step S21, determining whether the variation ratio is smaller than a predetermined value.
In the embodiment of the present invention, the preset value is preferably 1.0, but is not limited thereto. By comparing the change ratio with 1.0, the fact that the Y channel of the YUV image is darkened or brightened can be known.
And step S22, when the change proportion is judged to be smaller than the preset value, adjusting the change proportion to be a first proportion.
In the embodiment of the present invention, when it is determined that the change ratio is smaller than the preset value (i.e. 1.0), it indicates that the image is darkened, and in order to prevent the image color from being darkened, the change ratio needs to be adjusted to the first ratio, and the saturation component is adjusted by the first ratio.
Referring to fig. 3, step S22 includes steps S31 through S32.
Step S31, luminance data of the YUV image is acquired.
In the embodiment of the present invention, the luminance data may be calculated in any color space. Specifically, for example, in 709 color gamut of YUV color space, the luminance data is calculated in the following manner:
Y=0.213*Rin+0.715*Gin+0.072*Bin
step S32, a first gain coefficient corresponding to the luminance data is obtained.
A brightness lookup table (LUT) is preset in the electronic device, and a certain number of discrete coordinate points are stored in the LUT and are sampling points on the brightness mapping curve. The abscissa of the coordinate point is luminance data, i.e., the input of the luminance mapping curve, and the ordinate of the coordinate point is the first gain coefficient, i.e., the output of the luminance mapping curve. It should be understood that, since the mapping relationship in the luminance lookup table is a set of discrete points, if the input luminance data is not in the discrete points, the input luminance data may be interpolated based on the known luminance data, so as to obtain the first gain coefficient corresponding to the luminance data.
In the embodiment of the present invention, the luminance lookup table represents a simplest luminance mapping curve as shown in fig. 5.
Step S33, adjusting the change ratio to a first ratio according to the first gain factor.
In the embodiment of the present invention, the calculation formula of the first ratio is: ratio (R)L=Ratio*LUTy(ii) a Wherein RatioLIn a first ratio, LUTyIs the first gain factor.
When the change proportion is smaller than the preset value, the change proportion is adjusted to be the first gain coefficient, and when the Y channel is darkened, the image color is prevented from being darkened.
With continued reference to fig. 2.
In step S23, when it is determined that the change ratio is greater than or equal to the predetermined value, the change ratio is adjusted to a second ratio.
In the embodiment of the invention, when the change ratio is judged to be greater than or equal to the preset value (namely 1.0), the image is highlighted, in order to prevent the image from being oversaturated, the change ratio needs to be adjusted to be a second ratio, and the saturation component is adjusted through the second ratio.
Referring to fig. 4, step S23 includes steps S41 through S43.
Step S41, saturation data of the YUV image is acquired.
In the embodiment of the present invention, the saturation data may be a calculation method of any color space. Specifically, HSV color space, when MAX (R)in,Gin,Bin)-MIN(Rin,Gin,Bin) When not equal to 0, the saturation data is calculated in the following way
Figure BDA0002772369740000061
When MAX (R)in,Gin,Bin)-MIN(Rin,Gin,Bin) When the saturation data is 0, sat is 0, where MAX represents the maximum value of the three numbers and MIN represents the minimum value of the three numbers.
And step S42, acquiring a second gain coefficient corresponding to the saturation data.
The electronic device is preset with a saturation lookup table (LUT), and a certain number of discrete coordinate points are stored in the LUT, and the coordinate points are sampling points on the saturation mapping curve. The abscissa of the coordinate point is the saturation data, i.e., the input of the saturation mapping curve, and the ordinate of the coordinate point is the second gain coefficient, i.e., the output of the saturation mapping curve. It should be understood that, since the mapping relationship in the saturation lookup table is a set of discrete points, if the input saturation data is not in the discrete points, the input saturation data can be interpolated based on the known saturation data, so as to obtain the second gain coefficient corresponding to the saturation data.
In the embodiment of the present invention, the saturation lookup table represents a simplest saturation mapping curve as shown in fig. 6.
And step S43, adjusting the change ratio to a second ratio according to the second gain coefficient.
In the embodiment of the present invention, the calculation formula of the second ratio is: ratio (R)H=Ratio*LUTsat(ii) a Wherein RatioHIn a second ratio, LUTsatIs the second gain factor.
When the change proportion is larger than the preset value, the change proportion is adjusted to be the second gain coefficient, and therefore when the Y channel is lightened, the oversaturation of the image color is prevented.
As shown in fig. 7, the embodiment of the present invention provides an image processing apparatus, which includes an obtaining module 71, a converting module 72, a pull-up module 73, a calculating module 74, and a compensating module 75.
The acquisition module 71 is used for acquiring RGB images.
The conversion module 72 is configured to convert the RGB image into a YUV image.
In the embodiment of the present invention, in the process of converting an RGB image into a YUV image, converting RGB to obtain a luminance signal Y channel and two saturation signals U and V channels, and specifically, converting RGB into YUV may refer to the prior art.
The pull-up module 73 is configured to pull up the Y channel of the YUV image from the first luminance component to the second luminance component.
The calculating module 74 is configured to calculate a change ratio of the luminance component of the Y channel according to the first luminance component and the second luminance component.
In the embodiment of the present invention, the calculation formula of the change ratio is:
Figure BDA0002772369740000071
wherein Ratio is a variation Ratio, YoutIs the second luminance component, Yinδ is a predetermined extremum that is not zero for the first luminance component. Where δ is a minimum value used to prevent the denominator from being zero.
The compensation module 75 compensates the saturation components of the U channel and the V channel of the YUV image according to the change ratio.
In the embodiment of the present invention, the calculation formula of the saturation component is: u shapeout=Ratio*Uin;Vout×Ratio*Vin(ii) a Wherein, UinIs the original saturation component of the U channel, UoutFor the saturation component, V, compensated for the U channelinIs the original saturation component of the V channel, VoutThe saturation component compensated for the V channel.
In some embodiments of the present invention, optionally, the compensation module 75 includes a determination unit, a first adjustment unit, a second adjustment unit, and a compensation unit.
The judging unit is used for judging whether the change proportion is smaller than a preset value.
In the embodiment of the present invention, the preset value is preferably 1.0, but is not limited thereto. By comparing the change ratio with 1.0, the fact that the Y channel of the YUV image is darkened or brightened can be known.
The first adjusting unit is used for adjusting the change proportion to be a first proportion when the change proportion is judged to be smaller than the preset value.
In the embodiment of the present invention, when it is determined that the change ratio is smaller than the preset value (i.e. 1.0), it indicates that the image is darkened, and in order to prevent the image color from being darkened, the change ratio needs to be adjusted to the first ratio, and the saturation component is adjusted by the first ratio.
The first adjusting unit comprises a first acquiring subunit, a second acquiring subunit and a first adjusting subunit.
The acquiring subunit is used for acquiring brightness data of the YUV image.
In the embodiment of the present invention, the luminance data may be calculated in any color space. Specifically, for example, in 709 color gamut of YUV color space, the luminance data is calculated in the following manner:
Y=0.213*Rin+0.715*Gin+0.072*Bin
the second obtaining subunit is configured to obtain a first gain coefficient corresponding to the luminance data.
A brightness lookup table (LUT) is preset in the electronic device, and a certain number of discrete coordinate points are stored in the LUT and are sampling points on the brightness mapping curve. The abscissa of the coordinate point is luminance data, i.e., the input of the luminance mapping curve, and the ordinate of the coordinate point is the first gain coefficient, i.e., the output of the luminance mapping curve. It should be understood that, since the mapping relationship in the luminance lookup table is a set of discrete points, if the input luminance data is not in the discrete points, the input luminance data may be interpolated based on the known luminance data, so as to obtain the first gain coefficient corresponding to the luminance data.
In the embodiment of the present invention, the luminance lookup table represents a simplest luminance mapping curve as shown in fig. 5.
The first adjusting subunit is configured to adjust the change proportion to a first proportion according to the first gain coefficient.
In the embodiment of the present invention, the calculation formula of the first ratio is: ratio (R)L=Ratio*LUTy(ii) a Wherein RatioLIn a first ratio, LUTyIs the first gain factor.
The second adjusting unit is used for adjusting the change proportion to be a second proportion when the change proportion is judged to be larger than or equal to the preset value.
In the embodiment of the invention, when the change ratio is judged to be greater than or equal to the preset value (namely 1.0), the image is highlighted, in order to prevent the image from being oversaturated, the change ratio needs to be adjusted to be a second ratio, and the saturation component is adjusted through the second ratio.
The second adjusting unit comprises a third acquiring subunit, a fourth acquiring subunit and a second adjusting subunit.
And the third acquisition subunit is used for acquiring the saturation data of the YUV image.
In the embodiment of the present invention, the saturation data may be a calculation method of any color space. Specifically, HSV color space, when MAX (R)in,Gin,Bin)-MIN(Rin,Gin,Bin) When not equal to 0, the saturation data is calculated in the following way
Figure BDA0002772369740000081
When MAX (R)in,Gin,Bin)-MIN(Rin,Gin,Bin) When the saturation data is 0, sat is 0, where MAX represents the maximum value of the three numbers, and MIN represents the maximum value of the three numbersA minimum value.
The fourth obtaining subunit is configured to obtain a second gain coefficient corresponding to the saturation data.
The electronic device is preset with a saturation lookup table (LUT), and a certain number of discrete coordinate points are stored in the LUT, and the coordinate points are sampling points on the saturation mapping curve. The abscissa of the coordinate point is the saturation data, i.e., the input of the saturation mapping curve, and the ordinate of the coordinate point is the second gain coefficient, i.e., the output of the saturation mapping curve. It should be understood that, since the mapping relationship in the saturation lookup table is a set of discrete points, if the input saturation data is not in the discrete points, the input saturation data can be interpolated based on the known saturation data, so as to obtain the second gain coefficient corresponding to the saturation data.
In the embodiment of the present invention, the saturation lookup table represents a simplest saturation mapping curve as shown in fig. 6.
The second adjusting subunit is configured to adjust the change ratio to a second ratio according to the second gain coefficient.
In the embodiment of the present invention, the calculation formula of the second ratio is: ratio (R)H=Ratio*LUTsat(ii) a Wherein RatioHIn a second ratio, LUTsatIs the second gain factor.
Referring to fig. 8, an embodiment of the present invention further provides an electronic device 800, where the electronic device 800 may be a mobile phone, a tablet, a computer, or the like. As shown in fig. 8, the electronic device 800 includes a processor 801, a memory 802. The processor 801 is electrically connected to the memory 802.
The processor 801 is a control center of the electronic device 800, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or loading an application program stored in the memory 802 and calling data stored in the memory 802, thereby performing overall monitoring of the electronic device.
In this embodiment, the electronic device 800 is provided with a plurality of memory partitions, where the plurality of memory partitions includes a system partition and a target partition, and the processor 801 in the electronic device 800 loads instructions corresponding to processes of one or more application programs into the memory 802 according to the following steps, and the processor 801 runs the application programs stored in the memory 802, so as to implement various functions:
acquiring an RGB image;
converting the RGB image into a YUV image;
raising a Y-channel of the YUV image from a first luma component to a second luma component;
calculating the change proportion of the brightness component of the Y channel according to the first brightness component and the second brightness component; and
and compensating the saturation components of the U channel and the V channel of the YUV image according to the change proportion.
Referring to fig. 9, fig. 9 is a block diagram illustrating a specific structure of an electronic device 900 according to an embodiment of the present invention, where the electronic device 900 may be used to implement the image processing method provided in the foregoing embodiment. The electronic device 900 may be a mobile phone or a tablet. The electronic device 900 also includes the following components.
The RF circuit 910 is used for receiving and transmitting electromagnetic waves, and interconverting the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. RF circuit 910 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The RF circuit 910 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices over a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. The Wireless network may use various Communication standards, protocols, and technologies, including, but not limited to, Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (e.g., IEEE802.11a, IEEE802.11 b, IEEE 802.2.access, and/or IEEE802.11 n), Voice over Internet Protocol (VoIP), world wide Internet Microwave Access (Microwave for Wireless Communication), other suitable protocols for short message service (Max), and any other suitable protocols, and may even include those protocols that have not yet been developed.
The memory 920 may be used to store software programs and modules, such as program instructions/modules corresponding to the image processing method in the above-described embodiments, and the processor 980 may execute various functional applications and data processing, i.e., implement the functions of the image processing method, by running the software programs and modules stored in the memory 920. The memory 920 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 920 may further include memory located remotely from the processor 980, which may be connected to the electronic device 900 over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input unit 930 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 930 may include a touch-sensitive surface 931 as well as other input devices 932. The touch-sensitive surface 931, also referred to as a touch screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 931 (e.g., operations by a user on or near the touch-sensitive surface 931 using a finger, a stylus, or any other suitable object or attachment) and drive the corresponding connecting device according to a predetermined program. Alternatively, the touch sensitive surface 931 may include both a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 980, and can receive and execute commands sent by the processor 980. In addition, the touch sensitive surface 931 may be implemented in various types, such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 930 may also include other input devices 932 in addition to the touch-sensitive surface 931. In particular, other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 940 may be used to display information input by or provided to the user and various graphical user interfaces of the electronic device 900, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 940 may include a Display panel 941, and optionally, the Display panel 941 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 931 may overlay the display panel 941, and when a touch operation is detected on or near the touch-sensitive surface 931, the touch operation is transmitted to the processor 980 to determine the type of touch event, and the processor 980 then provides a corresponding visual output on the display panel 941 according to the type of touch event. Although in FIG. 9 the touch-sensitive surface 931 and the display panel 941 are implemented as two separate components, in some embodiments the touch-sensitive surface 931 and the display panel 941 may be integrated to implement input and output functions.
The electronic device 900 may also include at least one sensor 950, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 941 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 941 and/or a backlight when the electronic device 900 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which may be further configured to the electronic device 900, detailed descriptions thereof are omitted.
The audio circuitry 960, speaker 961, microphone 962 may provide an audio interface between a user and the electronic device 900. The audio circuit 960 may transmit the electrical signal converted from the received audio data to the speaker 961, and convert the electrical signal into a sound signal for output by the speaker 961; on the other hand, the microphone 962 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 960, and outputs the audio data to the processor 980 for processing, and then transmits the audio data to another terminal via the RF circuit 910, or outputs the audio data to the memory 920 for further processing. The audio circuit 960 may also include an earbud jack to provide communication of a peripheral headset with the electronic device 900.
The electronic device 900, via the transport module 970 (e.g., Wi-Fi module), may assist the user in sending and receiving e-mail, browsing web pages, accessing streaming media, etc., which provides wireless broadband internet access to the user. Although fig. 9 shows the transmission module 970, it is understood that it does not belong to the essential constitution of the electronic device 900 and may be omitted entirely within the scope not changing the essence of the invention as needed.
The processor 980 is a control center of the electronic device 900, connects various parts of the entire cellular phone using various interfaces and lines, and performs various functions of the electronic device 900 and processes data by operating or executing software programs and/or modules stored in the memory 920 and calling data stored in the memory 920, thereby integrally monitoring the cellular phone. Optionally, processor 980 may include one or more processing cores; in some embodiments, the processor 980 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 980.
The electronic device 900 also includes a power supply 990 (e.g., a battery) that provides power to the various components and, in some embodiments, may be logically coupled to the processor 980 via a power management system that provides management of charging, discharging, and power consumption. Power supply 990 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and the like.
Although not shown, the electronic device 900 may further include a camera (e.g., a front camera, a rear camera), a bluetooth module, etc., which are not described in detail herein. Specifically, in this embodiment, the display unit of the electronic device is a touch screen display, the electronic device further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:
acquiring an RGB image;
converting the RGB image into a YUV image;
raising a Y-channel of the YUV image from a first luma component to a second luma component;
calculating the change proportion of the brightness component of the Y channel according to the first brightness component and the second brightness component; and
and compensating the saturation components of the U channel and the V channel of the YUV image according to the change proportion.
In specific implementation, the above modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the above modules may refer to the foregoing method embodiments, which are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by instructions controlling associated hardware, and the instructions may be stored in a computer readable storage medium and loaded and executed by a processor. To this end, the present invention provides a readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the image processing methods provided by the embodiments of the present invention.
Wherein the readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the readable storage medium can execute the steps in any image processing method provided in the embodiment of the present invention, the beneficial effects that can be achieved by any image processing method provided in the embodiment of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again. The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
The invention has the beneficial effects that: by acquiring the change proportion of the brightness component of the Y channel, comparing the change proportion with a preset value and correspondingly compensating the saturation component according to the comparison result, the phenomenon of color shearing caused when the saturation of the image is compensated after the brightness of the image is processed is avoided, the details of the image are protected, and the image display with higher quality is realized.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The image processing method, the image processing system, the readable storage medium and the electronic device provided by the embodiments of the present invention are described in detail above, and a specific example is applied in the present disclosure to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the technical solution and the core idea of the present invention; those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (11)

1. An image processing method, comprising:
acquiring an RGB image;
converting the RGB image into a YUV image;
raising a Y-channel of the YUV image from a first luma component to a second luma component;
calculating the change proportion of the brightness component of the Y channel according to the first brightness component and the second brightness component; and
and compensating the saturation components of the U channel and the V channel of the YUV image according to the change proportion.
2. The image processing method according to claim 1, wherein the change ratio is calculated by the formula:
Figure FDA0002772369730000011
wherein Ratio is a variation Ratio, YoutIs the second luminance component, Yinδ is a predetermined extremum that is not zero for the first luminance component.
3. The image processing method according to claim 1, wherein the calculation formula of the saturation component is:
Uout=Ratio*Uin
Vout=Ratio*Vin
wherein, UinIs the original saturation component of the U channel, UoutFor the saturation component, V, compensated for the U channelinIs the original saturation component of the V channel, VoutThe saturation component compensated for the V channel.
4. The image processing method according to claim 1, wherein the step of compensating the saturation components of the U-channel and the V-channel of the YUV image according to the change ratio comprises:
judging whether the change proportion is smaller than a preset value or not;
when the change proportion is judged to be smaller than the preset value, the change proportion is adjusted to be a first proportion;
when the change proportion is judged to be larger than or equal to the preset value, the change proportion is adjusted to be a second proportion; and
and compensating the saturation components of the U channel and the V channel of the YUV image according to the first proportion or the second proportion.
5. The image processing method according to claim 4, wherein in the step of adjusting the change ratio to the first ratio, it comprises:
acquiring brightness data of the YUV image;
acquiring a first gain coefficient corresponding to the brightness data; and
and adjusting the change proportion to be a first proportion according to the first gain coefficient.
6. The image processing method according to claim 5, wherein the first ratio is calculated by the formula:
RatioL=Ratio*LUTy
wherein RatioLIn a first ratio, LUTyIs the first gain factor.
7. The image processing method according to claim 4, wherein in the step of adjusting the change ratio to the second ratio, it comprises:
acquiring saturation data of the YUV image;
acquiring a second gain coefficient corresponding to the saturation data; and
and adjusting the change proportion to be a second proportion according to the second gain coefficient.
8. The image processing method according to claim 7, wherein the second ratio is calculated by the formula:
RatioH=Ratio*LUTsat
wherein RatioHIn a second ratio, LUTsatIs the second gain factor.
9. An image processing apparatus characterized by comprising:
the acquisition module is used for acquiring an RGB image;
the conversion module is used for converting the RGB image into a YUV image;
the pull-up module is used for pulling up the Y channel of the YUV image from a first brightness component to a second brightness component;
the calculation module is used for calculating the change proportion of the brightness component of the Y channel according to the first brightness component and the second brightness component; and
and the compensation module is used for compensating the saturation components of the U channel and the V channel of the YUV image according to the change proportion.
10. An electronic device comprising a processor, a memory and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the image processing method according to any one of claims 1 to 8.
11. A readable storage medium, characterized in that the readable storage medium stores thereon a program or instructions which, when executed by a processor, implement the image processing method according to any one of claims 1 to 8.
CN202011253511.6A 2020-11-11 2020-11-11 Image processing method, device, electronic equipment and readable storage medium Active CN112330564B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011253511.6A CN112330564B (en) 2020-11-11 2020-11-11 Image processing method, device, electronic equipment and readable storage medium
PCT/CN2021/098613 WO2022100082A1 (en) 2020-11-11 2021-06-07 Image processing method and apparatus, electronic device, and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011253511.6A CN112330564B (en) 2020-11-11 2020-11-11 Image processing method, device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112330564A true CN112330564A (en) 2021-02-05
CN112330564B CN112330564B (en) 2023-08-22

Family

ID=74318510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011253511.6A Active CN112330564B (en) 2020-11-11 2020-11-11 Image processing method, device, electronic equipment and readable storage medium

Country Status (2)

Country Link
CN (1) CN112330564B (en)
WO (1) WO2022100082A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022100082A1 (en) * 2020-11-11 2022-05-19 海宁奕斯伟集成电路设计有限公司 Image processing method and apparatus, electronic device, and readable storage medium
WO2023284528A1 (en) * 2021-07-13 2023-01-19 深圳市洲明科技股份有限公司 Image enhancement method and apparatus, computer device, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102231264A (en) * 2011-06-28 2011-11-02 王洪剑 Dynamic contrast enhancement device and method
CN103617792A (en) * 2013-11-14 2014-03-05 天津三星电子有限公司 Method for adjusting image display of display terminal and display terminal
US20150109356A1 (en) * 2013-10-22 2015-04-23 Japan Display Inc. Image processing device, display device, electronic device and method for processing an image
CN106530252A (en) * 2016-11-08 2017-03-22 北京小米移动软件有限公司 Image processing method and device
CN110264972A (en) * 2019-06-26 2019-09-20 京东方科技集团股份有限公司 Acquisition methods, computer equipment and the computer-readable medium of brightness offset value

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109727216B (en) * 2018-12-28 2023-06-06 Oppo广东移动通信有限公司 Image processing method, device, terminal equipment and storage medium
CN112330564B (en) * 2020-11-11 2023-08-22 海宁奕斯伟集成电路设计有限公司 Image processing method, device, electronic equipment and readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102231264A (en) * 2011-06-28 2011-11-02 王洪剑 Dynamic contrast enhancement device and method
US20150109356A1 (en) * 2013-10-22 2015-04-23 Japan Display Inc. Image processing device, display device, electronic device and method for processing an image
CN103617792A (en) * 2013-11-14 2014-03-05 天津三星电子有限公司 Method for adjusting image display of display terminal and display terminal
CN106530252A (en) * 2016-11-08 2017-03-22 北京小米移动软件有限公司 Image processing method and device
CN110264972A (en) * 2019-06-26 2019-09-20 京东方科技集团股份有限公司 Acquisition methods, computer equipment and the computer-readable medium of brightness offset value

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022100082A1 (en) * 2020-11-11 2022-05-19 海宁奕斯伟集成电路设计有限公司 Image processing method and apparatus, electronic device, and readable storage medium
WO2023284528A1 (en) * 2021-07-13 2023-01-19 深圳市洲明科技股份有限公司 Image enhancement method and apparatus, computer device, and storage medium

Also Published As

Publication number Publication date
WO2022100082A1 (en) 2022-05-19
CN112330564B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN107038681B (en) Image blurring method and device, computer readable storage medium and computer device
CN112308806B (en) Image processing method, device, electronic equipment and readable storage medium
WO2020199878A1 (en) Display brightness adjusting method and related product
EP3370204A1 (en) Method for detecting skin region and device for detecting skin region
CN112532958B (en) Image processing method, device, electronic equipment and readable storage medium
CN109905812B (en) Input power control method and device and terminal equipment
US11050942B2 (en) Screen fill light photographing method for mobile terminal, system and mobile terminal
US11915633B2 (en) Screen color temperature control method, apparatus, storage medium, and mobile terminal
US20210127279A1 (en) Method of controlling radio resource management measurement of neighboring cell, mobile communication terminal, and network side device
CN111182236A (en) Image synthesis method and device, storage medium and terminal equipment
CN112330564B (en) Image processing method, device, electronic equipment and readable storage medium
US11955098B2 (en) Determining compensation value
CN111459447B (en) Volume adjustment display method and electronic equipment
CN111225315B (en) Audio playing device, audio playing method and electronic equipment
CN110099434B (en) Power adjustment method, terminal equipment and computer readable storage medium
CN109727212B (en) Image processing method and mobile terminal
CN108879856B (en) Charging method and terminal
CN111368238A (en) Status bar adjusting method and device, mobile terminal and storage medium
CN109348366B (en) Method for adjusting volume by using electrical parameters and mobile terminal
CN112867171B (en) WIFI connection method and device, storage medium and mobile terminal
CN117116203A (en) Screen brightness adjustment method and device, storage medium and electronic equipment
CN111510075B (en) Voltage adjustment method and device of power amplifier and electronic equipment
CN108632468B (en) Method for adjusting CABC level and mobile terminal
CN109309758B (en) Audio processing device, terminal equipment and signal processing method
CN112468725B (en) Photo shooting method and device, storage medium and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Room 263, block B, science and technology innovation center, 128 Shuanglian Road, Haining Economic Development Zone, Haining City, Jiaxing City, Zhejiang Province, 314400

Applicant after: Haining yisiwei IC Design Co.,Ltd.

Applicant after: Beijing ESWIN Computing Technology Co.,Ltd.

Address before: Room 263, block B, science and technology innovation center, 128 Shuanglian Road, Haining Economic Development Zone, Haining City, Jiaxing City, Zhejiang Province, 314400

Applicant before: Haining yisiwei IC Design Co.,Ltd.

Applicant before: Beijing yisiwei Computing Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant