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

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

Info

Publication number
CN112330564B
CN112330564B CN202011253511.6A CN202011253511A CN112330564B CN 112330564 B CN112330564 B CN 112330564B CN 202011253511 A CN202011253511 A CN 202011253511A CN 112330564 B CN112330564 B CN 112330564B
Authority
CN
China
Prior art keywords
ratio
channel
image
saturation
component
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.)
Active
Application number
CN202011253511.6A
Other languages
Chinese (zh)
Other versions
CN112330564A (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

Classifications

    • G06T5/90
    • 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

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 RGB images; converting the RGB image into a YUV image; pulling up a Y channel of the YUV image from a first luminance component to a second luminance 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, the saturation component is correspondingly compensated according to the comparison result, the phenomenon of color shearing caused by the compensation processing of the saturation of the image after the brightness processing of the image is avoided, the details of the image are protected, and the higher-quality image display is realized.

Description

Image processing method, 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, an image processing device, an electronic device, and a storage medium.
Background
"Y" in YUV color space represents brightness, i.e., gray scale value; and "U" and "V" denote image color saturation for specifying the color of the pixel. In the image or video processing process, in the YUV color space, the brightness and the saturation are well separated, but if only the brightness or the saturation is processed, the saturation and the brightness corresponding to the brightness or the saturation respectively are not processed, the problem of mismatch between the color and the brightness, such as color washing or oversaturation, occurs in the image.
In order to improve the above phenomenon, after the image is subjected to brightness processing, the saturation of the image is subjected to corresponding compensation processing, however, the compensation processing causes color clipping problems, which are specifically represented by darkening of the color or loss of detail in the image.
Disclosure of Invention
The invention provides an image processing method, an image processing device, electronic equipment 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 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 RGB images; converting the RGB image into a YUV image; pulling up a Y channel of the YUV image from a first luminance component to a second luminance 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 variation ratio is:wherein Ratio is a change Ratio, Y out For the second luminance component, Y in For the first luminance component, δ is a preset extremum that is not zero.
In some embodiments, the saturation component is calculated as: u (U) out =Ratio*U in ;V out =Ratio*V in The method comprises the steps of carrying out a first treatment on the surface of the Wherein U is in For the primary saturation component of the U channel, U out For the saturation component after the U channel compensation, V in For the primary saturation component of V channel, V out And compensating the saturation component for the V channel.
In some embodiments, the step of compensating for the saturation components of the U-channel and V-channel of the YUV image according to the variation ratio 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 for saturation components of a U channel and a V channel of the YUV image according to the first ratio or the second ratio.
In some embodiments, in the step of adjusting the variation ratio to a first ratio, comprising: acquiring brightness data of YUV images; acquiring a first gain coefficient corresponding to the brightness data; and adjusting the variation ratio to a first ratio according to the first gain coefficient.
In some embodiments, the first ratio is calculated by the formula: ratio L =Ratio*LUT y The method comprises the steps of carrying out a first treatment on the surface of the Wherein Ratio is L For a first ratio LUT y Is the first gain factor.
In some embodiments, in the step of adjusting the variation ratio to a second ratio, comprising: acquiring saturation data of YUV images; acquiring a second gain coefficient corresponding to the saturation data; and adjusting the variation ratio to a second ratio according to the second gain coefficient.
In some embodiments, the second ratio is calculated by the formula: ratio H =Ratio*LUT sat The method comprises the steps of carrying out a first treatment on the surface of the Wherein Ratio is H For a second ratio LUT sat Is 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 the RGB image; the conversion module is used for converting the RGB image into a YUV image; a pull-up module for pulling up the Y channel of the YUV image from the first luminance component to the second luminance component; the calculating 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 a compensation module 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 present invention there is provided an electronic device comprising a processor, a memory and a program or instruction stored on said memory and executable on said processor, said program or instruction when executed by said 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 having stored thereon a program or instructions which, when executed by a processor, implement an image processing method as described above.
Compared with the prior art, the invention has the beneficial effects that: the change proportion of the brightness component of the Y channel is obtained, the change proportion is compared with a preset value, the saturation component is correspondingly compensated according to the comparison result, the phenomenon of color shearing caused by the compensation processing of the saturation of the image after the brightness processing of the image is avoided, the details of the image are protected, and the higher-quality image display is realized.
Drawings
Fig. 1 is a schematic flow chart of steps of an image processing method according to an embodiment of the present invention.
Fig. 2 is a schematic step flow diagram of step S15 shown in fig. 1.
Fig. 3 is a schematic step flow chart of step S22 shown in fig. 2.
Fig. 4 is a step flow diagram of step S23 shown in fig. 2.
Fig. 5 is a schematic structural diagram of a brightness 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 diagram of a specific structure of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions 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 will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
As shown in fig. 1, an embodiment of the present invention provides an image processing method, which is applied to an electronic device, and the method includes steps S11 to S15.
Step S11, an RGB image is acquired.
Step S12, converting the RGB image into a YUV image.
In the embodiment of the 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 can be seen in the prior art.
Step S13, pulling up the Y channel of the YUV image from the first luminance component to the second luminance component.
Step S14, calculating the change proportion of the brightness component of the Y channel according to the first brightness component and the second brightness component.
In the embodiment of the present invention, optionally, the calculation formula of the variation ratio is:wherein Ratio is a change Ratio, Y out For the second luminance component, Y in For the first luminance component, δ is a preset extremum that is not zero. Where δ is a minimum value for preventing the denominator from being zero.
And S15, compensating saturation components of a U channel and a V channel of the YUV image according to the change proportion.
In the embodiment of the present invention, optionally, the calculation formula of the saturation component is: u (U) out =Ratio*U in ;V out =Ratio*V in The method comprises the steps of carrying out a first treatment on the surface of the Wherein U is in For the primary saturation component of the U channel, U out For the saturation component after the U channel compensation, V in For the primary saturation component of V channel, V out And compensating the saturation component for the V channel.
And the saturation component is correspondingly adjusted according to the change proportion of the brightness data, so that the color of the color-compensated image is kept, and the image quality is improved.
Referring to fig. 2, step S15 may further include steps S21 to S24.
Step S21, 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 judging the change proportion and comparing with 1.0, the Y channel of the YUV image can be known to be darkened or lightened.
And S22, when the change proportion is smaller than the preset value, adjusting the change proportion to be a first proportion.
In the embodiment of the present invention, when the variation ratio is determined to be smaller than the preset value (i.e., 1.0), it is indicated that the image is darkened, and in order to prevent the image color from being darkened, the variation ratio needs to be adjusted to a first ratio, and the saturation component is adjusted by the first ratio.
Referring to fig. 3, step S22 includes steps S31 to S32.
Step S31, obtaining luminance data of the YUV image.
In the embodiment of the invention, the brightness data can be calculated in any color space. Specifically, for example, 709 color gamut of YUV color space, the calculation mode of brightness data is as follows:
Y=0.213*R in +0.715*G in +0.072*B in
step S32, obtaining a first gain coefficient corresponding to the brightness data.
The electronic device is preset with a Look-up table (LUT) in which a number of discrete coordinate points are stored, where the coordinate points are sampling points on the luminance mapping curve. The abscissa of the coordinate point is the brightness data, namely the input of the brightness mapping curve, and the ordinate of the coordinate point is the first gain coefficient, namely the output of the brightness mapping curve. It should be appreciated that since the mapping relationship in the luminance look-up table is a set of discrete points, if the input luminance data is not among the discrete points, the input luminance data may be interpolated based on the known luminance data, thereby obtaining the first gain coefficient corresponding to the luminance data.
In an embodiment of the present invention, the luminance look-up table represents a simplest luminance mapping curve as shown in fig. 5.
And step S33, adjusting the change proportion to be 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 L =Ratio*LUT y The method comprises the steps of carrying out a first treatment on the surface of the Wherein Ratio is L For a first ratio LUT y Is the first gain factor.
When the change proportion is smaller than a preset value, the change proportion is adjusted to be a first gain coefficient, and when the Y channel is darkened, the image color is prevented from darkening.
With continued reference to fig. 2.
Step S23, when the change proportion is larger than or equal to the preset value, the change proportion is adjusted to be a second proportion.
In the embodiment of the present invention, when the variation ratio is determined to be greater than or equal to the preset value (i.e., 1.0), it is indicated that the image is to be lightened, and in order to prevent oversaturation of the image color, the variation ratio needs to be adjusted to a second ratio, and the saturation component is adjusted by the second ratio.
Referring to fig. 4, step S23 includes steps S41 to S43.
Step S41, obtaining saturation data of the YUV image.
In the embodiment of the invention, the saturation data can be calculated in any color space. Specifically, as HSV color space, when MAX (R in ,G in ,B in )-MIN(R in ,G in ,B in ) When not equal to 0, the saturation data is calculated byWhen MAX (R in ,G in ,B in )-MIN(R in ,G in ,B in ) When=0, the saturation data is calculated by sat=0, wherein MAX represents threeThe maximum value of the numbers, MIN, represents the minimum value of the three numbers.
Step S42, obtaining a second gain coefficient corresponding to the saturation data.
The electronic device is preset with a Look-up table (LUT) of saturation, 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, namely the input of the saturation mapping curve, and the ordinate of the coordinate point is the second gain coefficient, namely the output of the saturation mapping curve. It should be appreciated that since the mapping relationship in the saturation lookup table is a set of discrete points, if the input saturation data is not among the discrete points, the input saturation data may be interpolated based on the known saturation data to obtain the second gain coefficient corresponding to the saturation data.
In an 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 proportion to be a second proportion according to the second gain coefficient.
In the embodiment of the present invention, the calculation formula of the second ratio is: ratio H =Ratio*LUT sat The method comprises the steps of carrying out a first treatment on the surface of the Wherein Ratio is H For a second ratio LUT sat Is the second gain factor.
When the change proportion is larger than a preset value, the change proportion is adjusted to be a second gain coefficient, and when the Y channel is lightened, oversaturation of the image color is prevented.
As shown in fig. 7, an embodiment of the present invention provides an image processing apparatus, which includes an acquisition module 71, a conversion module 72, a pull-up module 73, a calculation module 74, and a compensation 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 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 can be seen in 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 variation 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 invention, the calculation formula of the change ratio is as follows:wherein Ratio is a change Ratio, Y out For the second luminance component, Y in For the first luminance component, δ is a preset extremum that is not zero. Where δ is a minimum value for preventing the denominator from being zero.
The compensation module 75 compensates the saturation components of the U-channel and V-channel of the YUV image according to the variation ratio.
In the embodiment of the invention, the calculation formula of the saturation component is as follows: u (U) out =Ratio*U in ;V out ×Ratio*V in The method comprises the steps of carrying out a first treatment on the surface of the Wherein U is in For the primary saturation component of the U channel, U out For the saturation component after the U channel compensation, V in For the primary saturation component of V channel, V out And compensating the saturation component for the V channel.
In some embodiments of the present invention, 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 judging the change proportion and comparing with 1.0, the Y channel of the YUV image can be known to be darkened or lightened.
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 the variation ratio is determined to be smaller than the preset value (i.e., 1.0), it is indicated that the image is darkened, and in order to prevent the image color from being darkened, the variation ratio needs to be adjusted to a first ratio, and the saturation component is adjusted by the first ratio.
The first adjusting unit comprises a first acquisition subunit, a second acquisition subunit and a first adjusting subunit.
The acquisition subunit is used for acquiring brightness data of the YUV image.
In the embodiment of the invention, the brightness data can be calculated in any color space. Specifically, for example, 709 color gamut of YUV color space, the calculation mode of brightness data is as follows:
Y=0.213*R in +0.715*G in +0.072*B in
the second obtaining subunit is configured to obtain a first gain coefficient corresponding to the luminance data.
The electronic device is preset with a Look-up table (LUT) in which a number of discrete coordinate points are stored, where the coordinate points are sampling points on the luminance mapping curve. The abscissa of the coordinate point is the brightness data, namely the input of the brightness mapping curve, and the ordinate of the coordinate point is the first gain coefficient, namely the output of the brightness mapping curve. It should be appreciated that since the mapping relationship in the luminance look-up table is a set of discrete points, if the input luminance data is not among the discrete points, the input luminance data may be interpolated based on the known luminance data, thereby obtaining the first gain coefficient corresponding to the luminance data.
In an embodiment of the present invention, the luminance look-up table represents a simplest luminance mapping curve as shown in fig. 5.
The first adjusting subunit is configured to adjust the variation ratio to a first ratio according to the first gain coefficient.
In the embodiment of the present invention, the calculation formula of the first ratio is: ratio L =Ratio*LUT y The method comprises the steps of carrying out a first treatment on the surface of the Wherein Ratio is L For a first ratio LUT y Is the first gain factor.
And the second adjusting unit is used for adjusting the change proportion to be a second proportion when judging that the change proportion is larger than or equal to the preset value.
In the embodiment of the present invention, when the variation ratio is determined to be greater than or equal to the preset value (i.e., 1.0), it is indicated that the image is to be lightened, and in order to prevent oversaturation of the image color, the variation ratio needs to be adjusted to a second ratio, and the saturation component is adjusted by the second ratio.
The second adjusting unit comprises a third acquiring subunit, a fourth acquiring subunit and a second adjusting subunit.
The third acquisition subunit is configured to acquire saturation data of the YUV image.
In the embodiment of the invention, the saturation data can be calculated in any color space. Specifically, as HSV color space, when MAX (R in ,G in ,B in )-MIN(R in ,G in ,B in ) When not equal to 0, the saturation data is calculated byWhen MAX (R in ,G in ,B in )-MIN(R in ,G in ,B in ) When=0, the saturation data is calculated in such a manner that sat=0, where MAX represents the maximum value of three numbers and MIN represents the minimum value of three numbers.
The fourth obtaining subunit is configured to obtain a second gain coefficient corresponding to the saturation data.
The electronic device is preset with a Look-up table (LUT) of saturation, 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, namely the input of the saturation mapping curve, and the ordinate of the coordinate point is the second gain coefficient, namely the output of the saturation mapping curve. It should be appreciated that since the mapping relationship in the saturation lookup table is a set of discrete points, if the input saturation data is not among the discrete points, the input saturation data may be interpolated based on the known saturation data to obtain the second gain coefficient corresponding to the saturation data.
In an 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 variation 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 H =Ratio*LUT sat The method comprises the steps of carrying out a first treatment on the surface of the Wherein Ratio is H For a second ratio LUT sat Is 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 application programs 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 storage partitions, where the plurality of storage partitions include a system partition and a target partition, and the processor 801 in the electronic device 800 loads instructions corresponding to the processes of one or more application programs into the memory 802 according to the following steps, and the processor 801 executes the application programs stored in the memory 802, so as to implement various functions:
acquiring RGB images;
converting the RGB image into a YUV image;
pulling up a Y channel of the YUV image from a first luminance component to a second luminance 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 saturation components of a U channel and a V channel of the YUV image according to the change proportion.
Referring to fig. 9, fig. 9 shows a specific block diagram 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 above embodiment. The electronic device 900 may be a cell phone or tablet. The electronic device 900 also includes the following components.
The RF circuit 910 is configured to receive and transmit electromagnetic waves, and to perform mutual conversion between the electromagnetic waves and the electrical signals, so as to communicate with a communication network or other devices. The RF circuitry 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 the like. The RF circuitry 910 may communicate with various networks such as the internet, intranets, wireless networks, or with other devices via wireless networks. The wireless network may include 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 communications (Global System for Mobile Communication, GSM), enhanced mobile communications technology (Enhanced Data GSM Environment, EDGE), wideband code division multiple access technology (Wideband Code Division Multiple Access, WCDMA), code division multiple access technology (Code Division Access, CDMA), time division multiple access technology (Time Division Multiple Access, TDMA), wireless fidelity technology (Wireless Fidelity, wi-Fi) (e.g., american society of electrical and electronic engineers standard IEEE802.11a, IEEE 802.11.11 b, IEEE802.11g, and/or IEEE802.11 n), internet telephony (Voice over Internet Protocol, voIP), worldwide interoperability for microwave access (Worldwide Interoperability for Microwave Access, wi-Max), other protocols for mail, instant messaging, and short messaging, and any other suitable communication protocols, even those not currently developed.
The memory 920 may be used to store software programs and modules, such as program instructions/modules corresponding to the image processing methods in the above embodiments, and the processor 980 executes various functional applications and data processing, i.e., functions for implementing the image processing methods, by running the software programs and modules stored in the memory 920. Memory 920 may include high-speed random access memory, but 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, memory 920 may further include memory located remotely from processor 980, which may be connected to electronic device 900 by 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 to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 930 may comprise a touch-sensitive surface 931 and other input devices 932. The touch-sensitive surface 931, also referred to as a touch display screen or touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on or thereabout the touch-sensitive surface 931 using a finger, stylus, or any other suitable object or accessory) and actuate the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 931 may include two portions, a touch detection device and a touch controller. The touch detection device detects the touch azimuth 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 detection device and converts it into touch point coordinates, which are then sent to the processor 980, and can receive commands from the processor 980 and execute them. In addition, the touch-sensitive surface 931 may be implemented in various types of resistive, capacitive, infrared, surface acoustic wave, and the like. In addition to the touch-sensitive surface 931, the input unit 930 may also include other input devices 932. 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, mouse, joystick, etc.
The display unit 940 may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of the electronic device 900, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 940 may include a display panel 941, and alternatively, 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 upon detection of a touch operation thereon or thereabout, the touch-sensitive surface 931 is passed 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 depending on 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 may be integrated with the display panel 941 to implement the input and output functions.
The electronic device 900 may also include at least one sensor 950, such as a light sensor, a 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 the backlight when the electronic device 900 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile phone is stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the electronic device 900 are not described in detail herein.
Audio circuitry 960, speaker 961, microphone 962 may provide an audio interface between a user and electronic device 900. Audio circuit 960 may transmit the received electrical signal converted from audio data to speaker 961, where it is converted to a sound signal by speaker 961 for output; on the other hand, microphone 962 converts the collected sound signals into electrical signals, which are received by audio circuit 960 and converted into audio data, which are processed by audio data output processor 980 for transmission to, for example, another terminal via RF circuit 910 or for output to memory 920 for further processing. Audio circuitry 960 may also include an ear bud jack to provide communication of a peripheral ear bud with electronic device 900.
The electronic device 900 may facilitate user email, web browsing, streaming media access, etc. via a transmission module 970 (e.g., wi-Fi module), 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 can be omitted entirely as required within the scope not changing the essence of the invention.
Processor 980 is a control center for electronic device 900, and uses various interfaces and lines to connect the various parts of the overall handset, performing various functions of electronic device 900 and processing data by running or executing software programs and/or modules stored in memory 920, and invoking data stored in memory 920, thereby performing overall monitoring of the handset. Optionally, processor 980 may include one or more processing cores; in some embodiments, processor 980 may integrate an application processor with a modem processor, where the application processor primarily handles operating systems, user interfaces, applications programs, and the like, and the modem processor 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 through a power management system to perform functions such as managing charging, discharging, and power consumption by the power management system. The power source 990 may also include one or more of any components, such as a direct current or alternating current power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the electronic device 900 may further include a camera (e.g., front camera, rear camera), a bluetooth module, etc., which will not be described in detail herein. In particular, 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, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for:
acquiring RGB images;
converting the RGB image into a YUV image;
pulling up a Y channel of the YUV image from a first luminance component to a second luminance 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 saturation components of a U channel and a V channel of the YUV image according to the change proportion.
In the implementation, each module may be implemented as an independent entity, or may be combined arbitrarily, and implemented as the same entity or several entities, and the implementation of each module may be referred to the foregoing method embodiment, which is not described herein again.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions or by controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a readable storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any one of the image processing methods provided by the embodiment of the present invention.
Wherein the readable storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps in any image processing method provided by the embodiment of the present invention can be executed due to the instructions stored in the readable storage medium, so that the beneficial effects that can be achieved by any image processing method provided by the embodiment of the present invention can be achieved, and detailed descriptions of the previous embodiments are omitted herein. The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
The invention has the beneficial effects that: the change proportion of the brightness component of the Y channel is obtained, the change proportion is compared with a preset value, the saturation component is correspondingly compensated according to the comparison result, the phenomenon of color shearing caused by the compensation processing of the saturation of the image after the brightness processing of the image is avoided, the details of the image are protected, and the higher-quality image display is realized.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
The image processing method, system, readable storage medium and electronic device provided by the embodiments of the present invention are described in detail, and specific examples are applied to illustrate the principles and embodiments of the present invention, and the description of the above embodiments is only used to help understand the technical solution and core idea of the present invention; those of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (8)

1. An image processing method, comprising:
acquiring RGB images;
converting the RGB image into a YUV image;
pulling up a Y channel of the YUV image from a first luminance component to a second luminance 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, comprising:
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, adjusting the change proportion to be a first proportion comprises the following steps: acquiring brightness data of YUV images; acquiring a first gain coefficient corresponding to the brightness data; and adjusting the variation ratio to a first ratio according to the first gain coefficient;
when the change proportion is judged to be greater than or equal to the preset value, adjusting the change proportion to be a second proportion comprises the following steps: acquiring saturation data of YUV images; acquiring a second gain coefficient corresponding to the saturation data; and adjusting the variation ratio to a second ratio according to the second gain coefficient; and
and compensating saturation components of a U channel and a V channel of the YUV image according to the first proportion or the second proportion.
2. The image processing method according to claim 1, wherein the calculation formula of the change ratio is:
wherein Ratio is a change Ratio, Y out For the second luminance component, Y in For the first luminance component, δ is a preset extremum that is not zero.
3. The image processing method according to claim 1, wherein the saturation component has a calculation formula of:
U out =Ratio*U in
V out =Ratio*V in
wherein U is in For the primary saturation component of the U channel, U out For the saturation component after the U channel compensation, V in Is the original saturation component of the V-channel,V out and compensating the saturation component for the V channel.
4. The image processing method according to claim 1, wherein the calculation formula of the first ratio is:
Ratio L =Ratio*LUT y
wherein Ratio is L For a first ratio LUT y Is the first gain factor.
5. The image processing method according to claim 1, wherein the calculation formula of the second ratio is:
Ratio H =Ratio*LUT sat
wherein Ratio is H For a second ratio LUT sat Is the second gain factor.
6. An image processing apparatus, comprising:
the acquisition module is used for acquiring the RGB image;
the conversion module is used for converting the RGB image into a YUV image;
a pull-up module for pulling up the Y channel of the YUV image from the first luminance component to the second luminance component;
the calculating 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 saturation components of a U channel and a V channel of the YUV image according to the change proportion;
the compensation module includes: the device comprises a judging unit, a first adjusting unit, a second adjusting unit and a compensating unit;
the judging unit is used for judging whether the change proportion is smaller than a preset value or not;
the first adjusting unit is used for adjusting the change proportion to be a first proportion when judging that the change proportion is smaller than the preset value;
the first adjustment unit includes: the device comprises a first acquisition subunit, a second acquisition subunit and a first adjustment subunit;
a first obtaining subunit, configured to obtain luminance data of a YUV image;
the second acquisition subunit is used for acquiring a first gain coefficient corresponding to the brightness data;
a first adjustment subunit, configured to adjust the variation ratio to a first ratio according to the first gain coefficient;
the second adjusting unit includes: a third acquisition subunit, a fourth acquisition subunit, and a second adjustment subunit;
a third obtaining subunit, configured to obtain saturation data of the YUV image;
a fourth obtaining subunit, configured to obtain a second gain coefficient corresponding to the saturation data;
and the second adjusting subunit is used for adjusting the changing proportion to be a second proportion according to the second gain coefficient.
7. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the image processing method according to any one of claims 1 to 5.
8. A readable storage medium, wherein a program or instructions is stored on the readable storage medium, which when executed by a processor, implements the image processing method according to any one of claims 1 to 5.
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 CN112330564A (en) 2021-02-05
CN112330564B true 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)

Families Citing this family (2)

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

Citations (4)

* 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
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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6533656B2 (en) * 2013-10-22 2019-06-19 株式会社ジャパンディスプレイ Image processing apparatus, image display apparatus, electronic apparatus, and image processing method
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 (4)

* 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
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

Also Published As

Publication number Publication date
CN112330564A (en) 2021-02-05
WO2022100082A1 (en) 2022-05-19

Similar Documents

Publication Publication Date Title
US10269129B2 (en) Color adjustment method and device
CN111179861B (en) Brightness calibration method and device, storage medium and terminal
CN109361867B (en) Filter processing method and mobile terminal
CN112532958B (en) Image processing method, device, electronic equipment and readable storage medium
CN112308806A (en) Image processing method, image processing device, electronic equipment and readable storage medium
US11050942B2 (en) Screen fill light photographing method for mobile terminal, system and mobile terminal
CN110855313B (en) Signal control method and electronic equipment
US11955098B2 (en) Determining compensation value
WO2019129092A1 (en) Frame rate-lowered photographing method, mobile terminal and storage medium
CN112330564B (en) Image processing method, device, electronic equipment and readable storage medium
CN109274441B (en) Tuning method and terminal equipment
CN109727212B (en) Image processing method and mobile terminal
CN111182236A (en) Image synthesis method and device, storage medium and terminal equipment
US11915633B2 (en) Screen color temperature control method, apparatus, storage medium, and mobile terminal
CN111225315B (en) Audio playing device, audio playing method and electronic equipment
CN110099434B (en) Power adjustment method, terminal equipment and computer readable storage medium
CN111459447B (en) Volume adjustment display method and electronic equipment
CN110730013B (en) Method for improving transmission stray and mobile terminal
CN111368238A (en) Status bar adjusting method and device, mobile terminal and storage medium
CN112867171B (en) WIFI connection method and device, storage medium and mobile terminal
US20230097372A1 (en) Display image compensation method, device, electronic equipment, and storage medium
WO2021017707A1 (en) Power determining method and terminal device
CN108632468B (en) Method for adjusting CABC level and mobile terminal
CN111629263A (en) Display picture compensation method and device, electronic equipment and storage medium
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
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 yisiwei 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.

GR01 Patent grant
GR01 Patent grant