CN108198142B - Color adjustment method, terminal and computer readable storage medium - Google Patents

Color adjustment method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN108198142B
CN108198142B CN201711460565.8A CN201711460565A CN108198142B CN 108198142 B CN108198142 B CN 108198142B CN 201711460565 A CN201711460565 A CN 201711460565A CN 108198142 B CN108198142 B CN 108198142B
Authority
CN
China
Prior art keywords
parameter
color
adjustment
preset
parameters
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
CN201711460565.8A
Other languages
Chinese (zh)
Other versions
CN108198142A (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 SHUKE WANGWEI TECHNOLOGY Co.,Ltd.
Original Assignee
Beijing Shuke Wangwei Technology 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 Shuke Wangwei Technology Co ltd filed Critical Beijing Shuke Wangwei Technology Co ltd
Priority to CN201711460565.8A priority Critical patent/CN108198142B/en
Publication of CN108198142A publication Critical patent/CN108198142A/en
Application granted granted Critical
Publication of CN108198142B publication Critical patent/CN108198142B/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
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention discloses a color adjusting method, a terminal and a computer readable storage medium, wherein the color adjusting method comprises the following steps: acquiring at least two color parameters corresponding to at least two preset regions in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value; determining a first adjusting parameter corresponding to the current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter; judging whether to adjust the color of the current scene or not according to the at least two color parameters and the first blue adjusting parameter; if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters; and carrying out color adjustment on the current scene according to the target adjustment parameters. The color adjusting method provided by the embodiment of the invention can effectively perform anti-purple processing when the color of the blue sky scene is adjusted, thereby overcoming the defect of color distortion.

Description

Color adjustment method, terminal and computer readable storage medium
Technical Field
The present invention relates to terminal technologies, and in particular, to a color adjustment method, a terminal, and a computer-readable storage medium.
Background
The purpose of performing automatic white balance (awb) processing is to uniformly compensate for color deviation caused by a color temperature environment and deviation of color channel gain inherent to a terminal by changing the gain of a color channel of the terminal, so that an obtained image can correctly reflect the real color of an object.
In the prior art, when a blue sky scene is color-adjusted, if adjustment parameters obtained by calculation according to awb are adjusted, a phenomenon that the blue sky is purple due to excessive compensation on a blue channel and a red channel often exists, and thus a defect of color distortion is caused.
Disclosure of Invention
In view of this, embodiments of the present invention provide a color adjustment method, a terminal, and a computer-readable storage medium, which can effectively perform anti-violet processing when performing color adjustment on a blue sky scene, so as to overcome the defect of color distortion.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a color adjusting method, which comprises the following steps:
acquiring at least two color parameters corresponding to at least two preset regions in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value;
determining a first adjusting parameter corresponding to the current scene according to the at least two color parameters; wherein the first adjustment parameter comprises a first blue adjustment parameter and a first red adjustment parameter;
judging whether to adjust the color of the current scene according to the at least two color parameters and the first blue adjustment parameter;
if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters;
and carrying out color adjustment on the current scene according to the target adjustment parameter.
In the foregoing solution, the determining whether to perform color adjustment on the current scene according to the color parameter and the first blue adjustment parameter includes:
judging whether a first judgment condition for color adjustment is met or not according to the first blue adjustment parameter and a preset adjustment parameter threshold;
judging whether a second judgment condition for color adjustment is met or not according to the at least two color parameters and a preset color parameter threshold;
and when the first judgment condition is judged to be met and the second judgment condition is judged to be met, judging to perform color adjustment on the current scene.
In the foregoing solution, the determining whether a first determination condition for performing color adjustment is satisfied according to the first blue adjustment parameter and a preset adjustment parameter threshold includes:
when the first blue adjusting parameter is greater than or equal to the preset adjusting parameter threshold, judging that the first judging condition is met;
and when the first blue adjusting parameter is smaller than the preset adjusting parameter threshold, judging that the first judging condition is not met.
In the foregoing solution, the determining whether a second determination condition for color adjustment is satisfied according to the at least two color parameters and a preset color parameter threshold includes:
determining an average color parameter corresponding to the current scene according to at least two B values corresponding to the at least two color parameters;
when the average color parameter is greater than or equal to the preset color parameter threshold, determining that the second determination condition is satisfied;
and when the average color parameter is smaller than the preset color parameter threshold value, judging that the second judgment condition is not met.
In the foregoing solution, if it is determined that color adjustment is performed on the current scene, determining a target adjustment parameter according to the first adjustment parameter, the first preset color temperature parameter, and the second preset color temperature parameter includes:
acquiring a second adjusting parameter corresponding to the first preset color temperature parameter and a third adjusting parameter corresponding to the second preset color temperature parameter;
determining a standard adjusting parameter according to the first adjusting parameter, the second adjusting parameter and the third adjusting parameter;
and determining the target adjusting parameter according to the first adjusting parameter and the standard adjusting parameter.
In the foregoing solution, before determining the standard adjustment parameter according to the first adjustment parameter, the second adjustment parameter, and the third adjustment parameter, the method further includes:
and acquiring the brightness parameter corresponding to the current scene.
In the foregoing solution, the determining a standard adjustment parameter according to the first adjustment parameter, the second adjustment parameter, and the third adjustment parameter includes:
determining an average adjusting parameter according to the second adjusting parameter and the third adjusting parameter;
when the brightness parameter is smaller than or equal to a first preset brightness threshold value, determining the standard adjusting parameter according to the first adjusting parameter and the third adjusting parameter;
when the brightness parameter is greater than or equal to a second preset brightness threshold value, determining the target adjusting parameter according to the first adjusting parameter and the second adjusting parameter;
and when the brightness parameter is greater than the first preset brightness threshold and less than the second preset brightness threshold, determining the standard adjusting parameter according to the first adjusting parameter and the average adjusting parameter.
In the foregoing solution, the determining the target adjustment parameter according to the first adjustment parameter and the standard adjustment parameter includes:
determining a first target parameter according to the first blue adjustment parameter and the second blue adjustment parameter;
determining a second target parameter according to the first red adjustment parameter and the second red adjustment parameter;
determining the first target parameter and the second target parameter as the target adjustment parameter.
An embodiment of the present invention provides a terminal, including: a processor, a memory, and a communication bus; the communication bus is used for realizing connection communication between the processor and the memory; the processor is configured to execute the data transmission program stored in the memory to implement the color adjustment method as described above.
An embodiment of the present invention provides a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement a color adjustment method as described above.
According to the technical scheme of the embodiment of the invention, at least two color parameters corresponding to at least two preset regions in a current scene are obtained; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value; determining a first adjusting parameter corresponding to the current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter; judging whether to adjust the color of the current scene or not according to the at least two color parameters and the first blue adjusting parameter; if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters; and carrying out color adjustment on the current scene according to the target adjustment parameters. Therefore, the color adjustment method, the terminal and the computer-readable storage medium provided by the embodiment of the invention can judge whether the current scene needs color adjustment or not, if the current scene needs color adjustment, the target adjustment parameter can be further determined, and then the current scene is color-adjusted according to the target adjustment parameter, so that the anti-violet processing can be effectively performed, and the defect of color distortion can be overcome.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of an alternative mobile terminal for implementing various embodiments of the present invention;
fig. 2 is a diagram of a communication network system architecture according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of RGB values corresponding to different colors according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating RGB values corresponding to different colors according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a plurality of colors based on three primary colors according to an embodiment of the present invention;
FIG. 6 is a first flowchart illustrating an implementation of a color adjustment method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram illustrating a second implementation flow of a color adjustment method according to an embodiment of the present invention;
FIG. 8 is a third schematic flow chart illustrating an implementation of a color adjustment method according to an embodiment of the present invention;
FIG. 9 is a schematic diagram illustrating a fourth implementation flow of a color adjustment method according to an embodiment of the present invention;
FIG. 10 is a schematic diagram illustrating an implementation flow of a color adjustment method according to an embodiment of the present invention;
fig. 11 is a schematic flow chart illustrating a sixth implementation of the color adjustment method according to the embodiment of the present invention;
fig. 12 is a schematic flow chart illustrating an implementation of the color adjustment method according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of an optional mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: a Radio Frequency (RF) unit 101, a WIreless-Fidelity (Wi-Fi) module 102, an audio output unit 103, an audio/video (a/V) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the color of the uplink is adjusted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access 2000(Code Division Multiple Access 2000, CDMA2000), Wideband Code Division Multiple Access (WCDMA), Time Division-Synchronous Code Division Multiple Access (TD-SCDMA), Frequency Division duplex Long Term Evolution (FDD-LTE), and Time Division duplex Long Term Evolution (TDD-LTE), etc.
Wi-Fi belongs to a short-distance wireless transmission technology, and a mobile terminal can help a user to receive and send emails, browse webpages, access streaming media and the like through a Wi-Fi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the Wi-Fi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the Wi-Fi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the Wi-Fi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a 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 fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of 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 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 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, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a User Equipment (UE) 201, an Evolved UMTS Terrestrial radio access Network (E-UTRAN) 202, an Evolved Packet Core (EPC) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include a Mobility Management Entity (MME) 2031, a Home Subscriber Server (HSS) 2032, other MMEs 2033, a Serving GateWay (SGW) 2034, a packet data network GateWay (PDN GateWay, PGW)2035, and a Policy and Charging Rules Function (PCRF) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IP Multimedia Subsystem (IMS), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
Example one
In the embodiment of the present invention, the RGB color scheme is a color standard in the industry, and various colors are obtained by changing three color channels of red (R), green (G), and blue (B) and superimposing them with each other, where RGB represents colors of the three channels of red, green, and blue, and the standard includes almost all colors that can be perceived by human vision, and is one of the most widely used color systems.
Fig. 3 is a schematic diagram of RGB values corresponding to different colors in the embodiment of the present invention, as shown in fig. 3, for different colors, the corresponding RGB values are also different, wherein the maximum value of R, G, and B is 255, and the minimum value is 0.
Fig. 4 is a schematic diagram illustrating distribution of RGB values corresponding to different colors according to an embodiment of the invention, and as shown in fig. 4, the distribution of the RGB values corresponding to different colors is different.
Fig. 5 is a schematic diagram of a plurality of colors based on three primary colors in an embodiment of the present invention, as shown in fig. 5, all colors in nature can be obtained by mixing the three primary colors of red, green, and blue according to different proportions, for example, yellow can be obtained by mixing red and green according to a certain proportion.
Fig. 6 is a first schematic flow chart illustrating an implementation process of a color adjustment method according to an embodiment of the present invention, as shown in fig. 6, in an embodiment of the present invention, a method for a terminal to perform color adjustment may include the following steps:
step 101, acquiring at least two color parameters corresponding to at least two preset areas in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value.
In an embodiment of the present invention, the terminal may first acquire at least two color parameters corresponding to at least two preset regions in a current scene. The color parameter may be an RGB value corresponding to the current scene, that is, a red R value, a green G value, and a blue B value.
In an embodiment of the present invention, the terminal may be a shooting terminal configured with a camera, for example, the terminal may be a mobile phone, a smart camera, a tablet computer, or the like configured with a camera.
It should be noted that, in the embodiment of the present invention, the terminal may divide the current scene into a plurality of preset regions, and then extract color parameters from each of the preset regions, so as to obtain a plurality of color parameters, where one preset region corresponds to one color parameter. For example, the terminal may divide the current scene into 64 × 32 preset regions, so as to obtain 64 × 32 color parameters.
Step 102, determining a first adjusting parameter corresponding to a current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter.
In an embodiment of the present invention, after the terminal acquires the at least two color parameters corresponding to the at least two preset regions in the current scene, a first adjustment parameter corresponding to the current scene may be determined according to the at least two color parameters.
Further, in an embodiment of the present invention, after the terminal obtains the at least two color parameters, the terminal may output the at least two color parameters to a preset calculation model, so as to obtain at least two adjustment parameters according to the at least two color parameters, and then determine the first adjustment parameter corresponding to the current scene according to the at least two adjustment parameters.
It should be noted that, in the embodiment of the present invention, the first adjusting parameter may include a first blue adjusting parameter and a first red adjusting parameter. Specifically, in an embodiment of the present invention, the first blue adjustment parameter may be used to compensate for a B value in the current scene; meanwhile, the first red adjustment parameter may be used to compensate for the R value in the current scene.
Further, in the embodiment of the present invention, the terminal may obtain the adjustment parameter through the color parameter calculation according to the awb algorithm. Specifically, in the embodiment of the present invention, the terminal may calculate the adjustment parameters (D1, D2) according to formula (1) and formula (2),
D1=R/G (1)
D2=B/G (2)
wherein R is the R value of the red channel of the terminal, B is the B value of the blue channel of the terminal, and G is the G value of the green channel of the terminal.
It should be noted that, in the embodiment of the present invention, D1 may be used to represent a warm color temperature, and correspondingly, D2 may be used to represent a cold color temperature.
It should be noted that, in the embodiment of the present invention, the terminal may obtain a plurality of adjustment parameters by calculation according to the plurality of color parameters corresponding to the preset region in the current scene. And one preset area in the current scene corresponds to one adjusting parameter.
And 103, judging whether to adjust the color of the current scene according to the at least two color parameters and the first blue adjusting parameter.
In an embodiment of the present invention, after determining the first adjustment parameter corresponding to the current scene according to the at least two color parameters, the terminal may determine whether to perform color adjustment on the current scene according to the at least two color parameters and the first blue adjustment parameter.
It should be noted that, in the embodiment of the present invention, after the terminal acquires the at least two color parameters and the first adjustment parameter corresponding to the current scene, the terminal needs to determine the current scene according to the at least two color parameters and the first adjustment parameter to determine whether the current scene is a blue sky scene, so as to determine whether to perform color adjustment for anti-violet processing on the current scene.
Further, in an embodiment of the present invention, the B value of the at least two color parameters and the first blue adjustment parameter of the first adjustment parameter may both represent blue information in the current scene, so that whether the current scene is a blue sky scene may be determined according to the B value and the first blue adjustment parameter.
And step 104, if the current scene is judged to be color-adjusted, determining target adjusting parameters according to the first adjusting parameters, the first preset color temperature parameters and the second preset color temperature parameters.
In an embodiment of the present invention, after the terminal determines whether to perform color adjustment on the current scene according to the color parameter and the first adjustment parameter, if it determines to perform color adjustment on the current scene, the terminal may determine a target adjustment parameter for performing the color adjustment according to the adjustment parameter, the first preset color temperature parameter, and the second preset color temperature parameter.
Specifically, in the embodiment of the present invention, after determining whether the current scene is a blue sky scene, if the current scene is determined to be a blue sky scene, the terminal may further determine that color adjustment needs to be performed on the current scene.
It should be noted that, in an embodiment of the present invention, the first preset color temperature parameter and the second preset color temperature parameter may be parameters preset by the terminal for characterizing a color temperature of a light source. Specifically, in an embodiment of the present invention, the first preset color temperature parameter may be 5000k color temperature, i.e. D50, where according to ISO 3664: 2000, D50 light source is the color temperature of the observed color in the true sense.
It should be noted that, in the embodiment of the present invention, the first preset color temperature parameter corresponds to a second adjusting parameter, and meanwhile, the second preset color temperature parameter corresponds to a third adjusting parameter. In an embodiment of the invention, the second adjustment parameter is slightly larger than the third adjustment parameter.
Further, in an embodiment of the present invention, the target adjustment parameter is an adjustment parameter corresponding to the terminal performing the anti-violet processing on the current scene.
And 105, carrying out color adjustment on the current scene according to the target adjustment parameters.
In an embodiment of the present invention, if it is determined that color adjustment is performed on the current scene, after the terminal determines the target adjustment parameter according to the adjustment parameter, the first preset color temperature parameter, and the second preset color temperature parameter, color adjustment may be performed on the current scene according to the target adjustment parameter, so as to perform anti-violet processing on the current scene.
In an embodiment of the present invention, the terminal may compensate the B value and the R value in the current scene to different degrees by using the target adjustment parameter, and specifically, the target adjustment parameter may compensate the B value to a large extent and compensate the R value to a small extent, so as to perform the anti-violet processing to avoid making the blue sky in the current scene more violet.
The color adjusting method provided by the embodiment of the invention obtains at least two color parameters corresponding to at least two preset areas in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value; determining a first adjusting parameter corresponding to the current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter; judging whether to adjust the color of the current scene or not according to the at least two color parameters and the first blue adjusting parameter; if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters; and carrying out color adjustment on the current scene according to the target adjustment parameters. Therefore, the color adjustment method provided by the embodiment of the invention can judge whether the current scene needs color adjustment or not, further determine the target adjustment parameter if the current scene needs color adjustment, and then adjust the color of the current scene according to the target adjustment parameter, so that the anti-violet processing can be effectively performed, and the defect of color distortion can be overcome.
Example two
Based on the first embodiment, fig. 7 is a schematic flow chart illustrating an implementation process of a color adjustment method according to an embodiment of the present invention, as shown in fig. 7, in an embodiment of the present invention, the method for the terminal to determine whether to perform color adjustment on the current scene according to at least two color parameters and the first blue adjustment parameter may include the following steps:
and 103a, judging whether a first judgment condition for color adjustment is met according to the first blue adjustment parameter and a preset adjustment parameter threshold.
In an embodiment of the present invention, the first adjustment parameter may include the first blue adjustment parameter and the first red adjustment parameter, and the terminal may determine whether a first determination condition for performing the color adjustment is satisfied according to the first blue adjustment parameter and a preset adjustment parameter threshold after acquiring the first adjustment parameter.
Further, in an embodiment of the present invention, the first blue adjustment parameter may represent blue information in the current scene, so that the terminal may determine whether the current scene is a blue sky scene according to the first blue adjustment parameter and the preset adjustment parameter threshold.
In an embodiment of the present invention, further, if the first blue adjustment parameter is greater than or equal to the preset adjustment parameter threshold, the terminal may regard the current scene as a blue sky scene, and may determine that the first determination condition for performing the color adjustment is satisfied.
And 103b, judging whether a second judgment condition for color adjustment is met according to the at least two color parameters and a preset color parameter threshold.
In an embodiment of the present invention, after the terminal acquires the at least two color parameters, it may determine whether a second determination condition for performing the color adjustment is satisfied according to at least two B values of the at least two color parameters and a preset color parameter threshold value.
Further, in an embodiment of the present invention, the B value of the at least two color parameters may represent blue information in the current scene, so that the terminal may determine whether the current scene is a blue sky scene according to the B value and the preset color parameter threshold, so as to further determine that the second determination condition for performing the color adjustment is satisfied.
And 103c, judging to perform color adjustment on the current scene when the first judgment condition is judged to be met and the second judgment condition is judged to be met.
In an embodiment of the present invention, after the terminal determines whether a first determination condition for performing color adjustment is satisfied according to the first blue adjustment parameter and the preset adjustment parameter threshold, and determines whether a second determination condition for performing color adjustment is satisfied according to the color parameter and the preset color parameter threshold, if it is determined that the first determination condition is satisfied and it is determined that the second determination condition is satisfied, the terminal may determine to perform the color adjustment on the current scene.
It should be noted that, in the embodiment of the present invention, if the terminal determines that the first determination condition and the second determination condition are satisfied, the terminal may determine that the current scene is a blue sky scene, and thus may determine that anti-violet processing needs to be performed on the current scene, that is, it is determined that the color adjustment needs to be performed on the current scene.
As can be seen from the above description, in steps 103a to 103c, the terminal determines whether a first determination condition for performing color adjustment is satisfied according to the first blue adjustment parameter and a preset adjustment parameter threshold; judging whether a second judgment condition for color adjustment is met or not according to the at least two color parameters and a preset color parameter threshold; and when the first judgment condition is judged to be met and the second judgment condition is judged to be met, judging to perform color adjustment on the current scene. Therefore, the color adjustment method provided by the embodiment of the invention can judge whether the current scene needs color adjustment or not, further determine the target adjustment parameter if the current scene needs color adjustment, and then adjust the color of the current scene according to the target adjustment parameter, so that the anti-violet processing can be effectively performed, and the defect of color distortion can be overcome.
EXAMPLE III
Based on the second embodiment, fig. 8 is a schematic flow chart illustrating an implementation process of the color adjustment method according to the third embodiment of the present invention, as shown in fig. 8, in the embodiment of the present invention, the method for the terminal to determine whether the second determination condition for performing color adjustment is satisfied according to the at least two color parameters and the preset color parameter threshold may include the following steps:
step 201, determining an average color parameter corresponding to the current scene according to at least two B values corresponding to at least two color parameters.
In an embodiment of the present invention, after the terminal obtains the at least two color parameters, the terminal may determine an average color parameter corresponding to the current scene according to at least two B values of the at least two color parameters.
It should be noted that, in the embodiment of the present invention, a plurality of the preset regions in the current scene correspond to a plurality of color parameters, that is, a plurality of the preset regions correspond to a plurality of B values. Further, the terminal may perform an average calculation on the plurality of B values corresponding to the plurality of preset regions in the current scene, so as to obtain the average color parameter corresponding to the current scene.
Step 202, when the average color parameter is greater than or equal to the preset color parameter threshold, determining that a second determination condition is satisfied.
In an embodiment of the present invention, after determining the average color parameter corresponding to the current scene according to the at least two B values, if the average color parameter is greater than or equal to the preset color parameter threshold, the terminal may determine that a second determination condition for performing the color adjustment is satisfied.
It should be noted that, in the embodiment of the present invention, after the terminal determines the average color parameter, the terminal may compare the average color parameter with the preset color parameter, and if the average color parameter is greater than or equal to the preset color parameter threshold, the terminal may regard the current scene as a blue sky scene, so as to further determine that the second determination condition is satisfied.
And step 203, judging that the second judgment condition is not met when the average color parameter is smaller than the preset color parameter threshold value.
In an embodiment of the present invention, after the terminal determines the average color parameter corresponding to the current scene according to the B value, if the average color parameter is smaller than the preset color parameter threshold, the terminal may determine that the second determination condition for performing the color adjustment is not satisfied.
It should be noted that, in the embodiment of the present invention, after the terminal determines the average color parameter, the terminal may compare the average color parameter with the preset color parameter, and if the average color parameter is smaller than the preset color parameter threshold, the terminal may regard that the current scene is not a blue sky scene, so as to further determine that the second determination condition is not satisfied.
The color adjusting method provided by the embodiment of the invention obtains at least two color parameters corresponding to at least two preset areas in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value; determining a first adjusting parameter corresponding to the current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter; judging whether to adjust the color of the current scene or not according to the at least two color parameters and the first blue adjusting parameter; if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters; and carrying out color adjustment on the current scene according to the target adjustment parameters. Therefore, the color adjustment method provided by the embodiment of the invention can judge whether the current scene needs color adjustment or not, further determine the target adjustment parameter if the current scene needs color adjustment, and then adjust the color of the current scene according to the target adjustment parameter, so that the anti-violet processing can be effectively performed, and the defect of color distortion can be overcome.
Example four
Based on the first embodiment, fig. 9 is a schematic flow chart of a fourth implementation of the color adjustment method according to the first embodiment of the present invention, as shown in fig. 9, in the embodiment of the present invention, if it is determined that the color adjustment is performed on the current scene, the method for the terminal to determine the target adjustment parameter according to the first adjustment parameter, the first preset color temperature parameter, and the second preset color temperature parameter may include the following steps:
and 104a, acquiring a second adjusting parameter corresponding to the first preset color temperature parameter and a third adjusting parameter corresponding to the second preset color temperature parameter.
In an embodiment of the present invention, after the terminal determines whether to perform color adjustment on the current scene according to the color parameter and the first adjustment parameter, if it is determined that the current scene is color-adjusted, the terminal may first obtain a second adjustment parameter corresponding to the first preset color temperature parameter and a third adjustment parameter corresponding to the second preset color temperature parameter.
It should be noted that, in an embodiment of the present invention, the first preset color temperature parameter and the second preset color temperature parameter may be parameters preset by the terminal for characterizing a color temperature of a light source. Specifically, in an embodiment of the present invention, the first preset color temperature parameter may be 5000k color temperature, i.e. D50, where according to ISO 3664: 2000, D50 light source is the color temperature of the observed color in the true sense.
It should be noted that, in the embodiment of the present invention, the first preset color temperature parameter corresponds to a second adjusting parameter, and meanwhile, the second preset color temperature parameter corresponds to a third adjusting parameter. In an embodiment of the invention, the second adjustment parameter is slightly larger than the third adjustment parameter.
And 104b, determining a standard adjusting parameter according to the first adjusting parameter, the second adjusting parameter and the third adjusting parameter.
In an embodiment of the present invention, after the terminal obtains the second tuning parameter corresponding to the first preset color temperature parameter and the third tuning parameter corresponding to the second preset color temperature parameter, the terminal may determine a standard tuning parameter according to the first tuning parameter, the second tuning parameter and the third tuning parameter.
It should be noted that, in an embodiment of the present invention, the standard adjusting parameter may be an adjusting parameter determined by the terminal according to the luminance parameter, the color parameter, the first color adjusting parameter and a preset color temperature parameter corresponding to the current scene.
Specifically, in an embodiment of the present invention, the standard tuning parameter may be combined with the first tuning parameter, so that the terminal determines the target tuning parameter.
And 104c, determining a target adjusting parameter according to the first adjusting parameter and the standard adjusting parameter.
In an embodiment of the present invention, after determining the standard tuning parameter according to the first tuning parameter, the second tuning parameter, and the third tuning parameter, the terminal may determine the target tuning parameter according to the first tuning parameter and the standard tuning parameter.
It should be noted that, in the embodiment of the present invention, after determining the standard adjusting parameter, the terminal may combine the first adjusting parameter and the standard adjusting parameter to determine the target adjusting parameter corresponding to the current scene.
Specifically, in the embodiment of the present invention, the terminal may perform a purple bias process on the current scene according to the target adjustment parameter. The target adjustment parameter may be an adjustment parameter that compensates more for the blue channel and compensates less for the red channel.
According to the above description, through the steps 104a to 104c, the terminal obtains a second adjusting parameter corresponding to the first preset color temperature parameter and a third adjusting parameter corresponding to the second preset color temperature parameter; determining a standard adjusting parameter according to the first adjusting parameter, the second adjusting parameter and the third adjusting parameter; and determining a target adjusting parameter according to the first adjusting parameter and the standard adjusting parameter. Therefore, the color adjustment method provided by the embodiment of the invention can judge whether the current scene needs color adjustment or not, further determine the target adjustment parameter if the current scene needs color adjustment, and then adjust the color of the current scene according to the target adjustment parameter, so that the anti-violet processing can be effectively performed, and the defect of color distortion can be overcome.
Fig. 10 is a schematic flow chart of an implementation of the color adjustment method according to an embodiment of the present invention, as shown in fig. 10, in an embodiment of the present invention, before the terminal determines the standard adjustment parameter according to the first adjustment parameter, the second adjustment parameter, and the third adjustment parameter, that is, before step 104b, the method for the terminal to perform color adjustment may further include the following steps:
and step 104d, acquiring a brightness parameter corresponding to the current scene.
In an embodiment of the present invention, before determining the standard adjusting parameter according to the first adjusting parameter, the second adjusting parameter, and the third adjusting parameter, the terminal may first acquire the brightness parameter corresponding to the current scene.
It should be noted that, in the embodiment of the present invention, the terminal may determine a specific method for calculating the standard adjustment parameter according to the brightness parameter corresponding to the current scene and a preset brightness parameter threshold range, and therefore, the terminal may obtain the brightness parameter before determining the standard adjustment parameter.
The color adjusting method provided by the embodiment of the invention obtains at least two color parameters corresponding to at least two preset areas in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value; determining a first adjusting parameter corresponding to the current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter; judging whether to adjust the color of the current scene or not according to the at least two color parameters and the first blue adjusting parameter; if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters; and carrying out color adjustment on the current scene according to the target adjustment parameters. Therefore, the color adjustment method provided by the embodiment of the invention can judge whether the current scene needs color adjustment or not, further determine the target adjustment parameter if the current scene needs color adjustment, and then adjust the color of the current scene according to the target adjustment parameter, so that the anti-violet processing can be effectively performed, and the defect of color distortion can be overcome.
EXAMPLE five
Based on the fourth embodiment, fig. 11 is a sixth implementation flowchart of the color adjustment method according to the sixth embodiment of the present invention, as shown in fig. 11, in the embodiment of the present invention, the method for the terminal to determine the standard adjustment parameter according to the first adjustment parameter, the second adjustment parameter, and the third adjustment parameter may include the following steps:
and step 301, determining an average adjusting parameter according to the second adjusting parameter and the third adjusting parameter.
In an embodiment of the present invention, after the terminal obtains the second tuning parameter corresponding to the first preset color temperature parameter and the third tuning parameter corresponding to the second preset color temperature parameter, the terminal may determine an average tuning parameter according to the second tuning parameter and the third tuning parameter.
Specifically, in an embodiment of the present invention, the terminal may perform an average operation on the second adjustment parameter and the third adjustment parameter, so as to determine a calculation result as the average adjustment parameter.
And step 302, when the brightness parameter is less than or equal to the first preset brightness threshold, determining a standard adjusting parameter according to the first adjusting parameter and the third adjusting parameter.
In an embodiment of the present invention, after determining the brightness parameter of the current scene, if the current brightness parameter is less than or equal to a first preset brightness threshold, the terminal may determine the standard adjustment parameter according to the first adjustment parameter and the third adjustment parameter.
In an embodiment of the present invention, the terminal may preset a brightness threshold range, where the brightness threshold range may be a range formed by a first preset brightness threshold and a second preset brightness threshold.
Specifically, in the embodiment of the present invention, the second preset luminance threshold is greater than the first preset luminance threshold. For example, the terminal may preset the first preset brightness threshold to be 95 and the second preset brightness threshold to be 190.
Further, in an embodiment of the present invention, if the brightness parameter is less than or equal to the first preset brightness threshold, the terminal may determine the standard tuning parameter according to the first tuning parameter and the third tuning parameter corresponding to the second preset color temperature parameter.
Specifically, in an embodiment of the present invention, the terminal may perform a difference operation on the first adjustment parameter according to the third adjustment parameter, so as to calculate and obtain the standard adjustment parameter.
And step 303, when the brightness parameter is greater than or equal to a second preset brightness threshold, determining a target adjusting parameter according to the first adjusting parameter and the third adjusting parameter.
In an embodiment of the present invention, after determining the brightness parameter of the current scene, if the current brightness parameter is greater than or equal to a second preset brightness threshold, the terminal may determine the standard adjustment parameter according to the first adjustment parameter and the second adjustment parameter.
Further, in an embodiment of the present invention, if the brightness parameter is greater than or equal to the second preset brightness threshold, the terminal may determine the standard tuning parameter according to the first tuning parameter and the second tuning parameter corresponding to the first preset color temperature parameter.
Specifically, in an embodiment of the present invention, the terminal may perform a difference operation on the first adjustment parameter according to the second adjustment parameter, so as to calculate and obtain the standard adjustment parameter.
And step 304, when the brightness parameter is greater than the first preset brightness threshold and less than the second preset brightness threshold, determining a standard adjusting parameter according to the first adjusting parameter and the average adjusting parameter.
In an embodiment of the present invention, after determining the brightness parameter of the current scene, if the current brightness parameter is greater than the first preset brightness threshold and smaller than the second preset brightness threshold, the terminal may determine the standard adjustment parameter according to the first adjustment parameter and the average adjustment parameter.
Further, in an embodiment of the present invention, if the brightness parameter is greater than the first preset brightness threshold and less than the second preset brightness threshold, the terminal may perform a difference operation on the first adjustment parameter according to the average adjustment parameter, so as to calculate and obtain the standard adjustment parameter.
The color adjusting method provided by the embodiment of the invention obtains at least two color parameters corresponding to at least two preset areas in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value; determining a first adjusting parameter corresponding to the current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter; judging whether to adjust the color of the current scene or not according to the at least two color parameters and the first blue adjusting parameter; if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters; and carrying out color adjustment on the current scene according to the target adjustment parameters. Therefore, the color adjustment method provided by the embodiment of the invention can judge whether the current scene needs color adjustment or not, further determine the target adjustment parameter if the current scene needs color adjustment, and then adjust the color of the current scene according to the target adjustment parameter, so that the anti-violet processing can be effectively performed, and the defect of color distortion can be overcome.
EXAMPLE six
Based on the second embodiment and the fifth embodiment, fig. 12 is a seventh implementation flow diagram of the color adjustment method according to the second embodiment of the present invention, as shown in fig. 12, in the second embodiment of the present invention, the standard adjustment parameter includes a second blue adjustment parameter and a second red adjustment parameter, and the method for the terminal to determine the target adjustment parameter according to the first adjustment parameter and the standard adjustment parameter may include the following steps:
step 401, determining a first target parameter according to the first blue adjustment parameter and the second blue adjustment parameter.
In an embodiment of the present invention, after determining the standard tuning parameter based on the first tuning parameter, the second tuning parameter, and the third tuning parameter, the terminal may determine the first target parameter based on a first blue tuning parameter of the first tuning parameter and a second blue tuning parameter of the standard parameter.
It should be noted that, in the embodiment of the present invention, the first adjusting parameter may include a first blue adjusting parameter. Specifically, in the embodiment of the present invention, the first blue adjustment parameter may be used to compensate the B value in the current scene.
It should be noted that, in the embodiment of the present invention, the standard tuning parameter includes a second blue tuning parameter. Specifically, in the embodiment of the present invention, the second blue adjustment parameter may be used to compensate the B value in the current scene.
Further, in the embodiment of the present invention, when the first blue adjustment parameter is (B/G)1The second blue adjustment parameter is (B/G)Standard of meritIn this case, the terminal may compare the first blue adjustment parameter with the second blue adjustment parameter, and determine a smaller blue adjustment parameter of the first blue adjustment parameter and the second blue adjustment parameter as the first target parameter. For example, if (B/G)1Less than (B/G)Standard of meritThen the terminal may determine the first blue adjustment parameter as the first target parameter.
Step 402, determining a second target parameter according to the first red color adjustment parameter and the second red color adjustment parameter.
In an embodiment of the present invention, after determining the standard tuning parameter according to the first tuning parameter, the second tuning parameter, and the third tuning parameter, the terminal may determine the second target parameter according to a first red tuning parameter of the first tuning parameter and a second red tuning parameter of the standard parameter.
It should be noted that, in the embodiment of the present invention, the first adjustment parameter may include a first red adjustment parameter. Specifically, in the embodiment of the present invention, the first red adjustment parameter may be used to compensate the R value in the current scene.
It should be noted that, in the embodiment of the present invention, the standard adjustment parameter includes a second red adjustment parameter. Specifically, in the embodiment of the present invention, the second red adjustment parameter may be used to compensate the R value in the current scene.
Further, in the embodiment of the present invention, when the first red adjustment parameter is (R/G)1The second red color adjustment parameter is (R/G)Standard of meritIn this case, the terminal may compare the first red color adjustment parameter with the second red color adjustment parameter, and determine a larger red color adjustment parameter of the first red color adjustment parameter and the second red color adjustment parameter as the second target parameter. For example, if (R/G)1Greater than (R/G)Standard of meritThen the terminal may determine the first red adjustment parameter as the second target parameter.
And step 403, determining the first target parameter and the second target parameter as target adjusting parameters.
In an embodiment of the present invention, the terminal may determine the first target parameter according to the first blue adjustment parameter and the second blue adjustment parameter, and may determine the first target parameter and the second target parameter as the target adjustment parameters after determining the second target parameter according to the first red adjustment parameter and the second red adjustment parameter.
It should be noted that, in the embodiment of the present invention, the terminal may compensate the B value in the current scene according to the first target parameter, and compensate the R value in the current scene according to the second target parameter, so that the B value may be enhanced to a greater extent, the R value may be enhanced to a lesser extent, and the anti-violet processing on the current scene may be further implemented.
The color adjusting method provided by the embodiment of the invention obtains at least two color parameters corresponding to at least two preset areas in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value; determining a first adjusting parameter corresponding to the current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter; judging whether to adjust the color of the current scene or not according to the at least two color parameters and the first blue adjusting parameter; if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters; and carrying out color adjustment on the current scene according to the target adjustment parameters. Therefore, the color adjustment method provided by the embodiment of the invention can judge whether the current scene needs color adjustment or not, further determine the target adjustment parameter if the current scene needs color adjustment, and then adjust the color of the current scene according to the target adjustment parameter, so that the anti-violet processing can be effectively performed, and the defect of color distortion can be overcome.
EXAMPLE seven
Based on the first to sixth embodiments, fig. 13 is a schematic diagram of a composition structure of the terminal according to the first to sixth embodiments of the present invention, and in practical applications, based on the same inventive concept of the first to sixth embodiments, as shown in fig. 13, the terminal 3 according to the first to sixth embodiments of the present invention includes: a processor 31, a memory 32, and a communication bus 33. It should be noted that, in the embodiment of the present invention, the processor 31 and the memory 32 in fig. 13 correspond to the processor 110 and the memory 109 in the above-mentioned first drawing, respectively. In the process of the specific embodiment, the PRocessoR 31 may be at least one of an Application Specific Integrated CiRcuit (ASIC), a Digital Signal PRocessoR (DSP), a Digital Signal PRocessing Device (DSPD), a PRogRammable Logic Device (PLD), a Field PRogRammable Gate ARRay (FPGA), a CentRal PRocessing Unit (CPU), a controller, a microcontroller, and a microprocessor. It will be appreciated that the electronic devices used to implement the processor functions described above may be other devices, and embodiments of the present invention are not limited in particular.
In the embodiment of the present invention, the communication bus 33 is used for realizing connection communication between the processor 31 and the memory 32; the processor 31 is configured to execute the color adjustment program stored in the memory 32 to implement the following steps:
acquiring at least two color parameters corresponding to at least two preset regions in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value; determining a first adjusting parameter corresponding to the current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter; judging whether to adjust the color of the current scene or not according to the at least two color parameters and the first blue adjusting parameter; if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters; and carrying out color adjustment on the current scene according to the target adjustment parameters.
In an embodiment of the present invention, the processor 31 is specifically configured to determine whether a first determination condition for performing color adjustment is satisfied according to the first blue adjustment parameter and a preset adjustment parameter threshold; judging whether a second judgment condition for color adjustment is met or not according to the at least two color parameters and a preset color parameter threshold; and when the first judgment condition is judged to be met and the second judgment condition is judged to be met, judging to perform color adjustment on the current scene.
In an embodiment of the present invention, further, the processor 31 is specifically configured to determine that a first determination condition is satisfied when the first blue adjustment parameter is greater than or equal to a preset adjustment parameter threshold; and when the first blue adjusting parameter is smaller than a preset adjusting parameter threshold value, judging that the first judging condition is not met.
In an embodiment of the present invention, further, the processor 31 is specifically configured to determine an average color parameter corresponding to the current scene according to at least two B values corresponding to at least two color parameters; when the average color parameter is greater than or equal to the preset color parameter threshold value, judging that a second judgment condition is met; and when the average color parameter is smaller than the preset color parameter threshold value, judging that the second judgment condition is not met.
In an embodiment of the present invention, further, the processor 31 is specifically configured to obtain a second tuning parameter corresponding to the first preset color temperature parameter and a third tuning parameter corresponding to the second preset color temperature parameter; determining a standard adjusting parameter according to the first adjusting parameter, the second adjusting parameter and the third adjusting parameter; and determining a target adjusting parameter according to the first adjusting parameter and the standard adjusting parameter.
In an embodiment of the present invention, the processor 31 is further configured to obtain a brightness parameter corresponding to the current scene before determining the standard adjustment parameter according to the first adjustment parameter, the second adjustment parameter, and the third adjustment parameter.
In an embodiment of the present invention, further, the processor 31 is specifically configured to determine an average adjustment parameter according to the second adjustment parameter and the third adjustment parameter; when the brightness parameter is smaller than or equal to a first preset brightness threshold value, determining a standard adjusting parameter according to the first adjusting parameter and the third adjusting parameter; when the brightness parameter is greater than or equal to a second preset brightness threshold value, determining a target adjusting parameter according to the first adjusting parameter and the second adjusting parameter; and when the brightness parameter is greater than the first preset brightness threshold and less than the second preset brightness threshold, determining a standard adjusting parameter according to the first adjusting parameter and the average adjusting parameter.
In an embodiment of the present invention, further, the standard tuning parameter includes a second blue tuning parameter and a second red tuning parameter, and the processor 31 is specifically configured to determine the first target parameter according to the first blue tuning parameter and the second blue tuning parameter; determining a second target parameter according to the first red adjustment parameter and the second red adjustment parameter; and determining the first target parameter and the second target parameter as target adjustment parameters.
The terminal provided by the embodiment of the invention acquires at least two color parameters corresponding to at least two preset areas in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value; determining a first adjusting parameter corresponding to the current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter; judging whether to adjust the color of the current scene or not according to the at least two color parameters and the first blue adjusting parameter; if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters; and carrying out color adjustment on the current scene according to the target adjustment parameters. Therefore, the terminal provided by the embodiment of the invention can judge whether the current scene needs to be color-adjusted or not, and if the current scene needs to be color-adjusted, the terminal can further determine the target adjustment parameters and then adjust the color of the current scene according to the target adjustment parameters, so that the anti-ultraviolet processing can be effectively performed, and the defect of color distortion can be overcome.
The embodiment of the present invention provides a computer-readable storage medium, where one or more programs are stored, where the one or more programs are executable by one or more processors and applied to a terminal, and when the program is executed by the processors, the method according to the first to sixth embodiments is implemented.
Specifically, the program instructions corresponding to the color adjustment method in the present embodiment may be stored on a storage medium such as an optical disc, a hard disc, a usb disk, etc., and when the program instructions corresponding to the color adjustment method in the storage medium are read or executed by an electronic device, the method includes the following steps:
acquiring at least two color parameters corresponding to at least two preset regions in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value;
determining a first adjusting parameter corresponding to the current scene according to at least two color parameters; wherein the first adjusting parameter comprises a first blue adjusting parameter and a first red adjusting parameter;
judging whether to adjust the color of the current scene or not according to the at least two color parameters and the first blue adjusting parameter;
if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters;
and carrying out color adjustment on the current scene according to the target adjustment parameters.
In an embodiment of the present invention, further, when determining whether to perform color adjustment on the current scene according to at least two color parameters and the first blue adjustment parameter, the one or more programs are executed by the one or more processors, and the following steps are specifically implemented:
judging whether a first judgment condition for color adjustment is met or not according to the first blue adjustment parameter and a preset adjustment parameter threshold;
judging whether a second judgment condition for color adjustment is met or not according to the at least two color parameters and a preset color parameter threshold;
and when the first judgment condition is judged to be met and the second judgment condition is judged to be met, judging to perform color adjustment on the current scene.
In an embodiment of the present invention, further, when determining whether the first determination condition for performing color adjustment is satisfied according to the first blue adjustment parameter and a preset adjustment parameter threshold, the one or more programs are executed by the one or more processors, and the following steps are specifically implemented:
when the first blue adjusting parameter is larger than or equal to a preset adjusting parameter threshold value, judging that a first judgment condition is met;
and when the first blue adjusting parameter is smaller than a preset adjusting parameter threshold value, judging that the first judging condition is not met.
In an embodiment of the present invention, further, when determining whether a second determination condition for performing color adjustment is satisfied according to at least two color parameters and a preset color parameter threshold, the one or more programs are executed by the one or more processors, and the following steps are specifically implemented:
determining an average color parameter corresponding to the current scene according to at least two B values corresponding to at least two color parameters;
when the average color parameter is greater than or equal to a preset color parameter threshold value, judging that a second judgment condition is met;
and when the average color parameter is smaller than the preset color parameter threshold value, judging that the second judgment condition is not met.
In an embodiment of the present invention, further, if it is determined that color adjustment is performed on the current scene, when the target adjustment parameter is determined according to the first adjustment parameter, the first preset color temperature parameter, and the second preset color temperature parameter, the one or more programs are executed by the one or more processors, and the following steps are specifically implemented:
acquiring a second adjusting parameter corresponding to the first preset color temperature parameter and a third adjusting parameter corresponding to the second preset color temperature parameter;
determining a standard adjusting parameter according to the first adjusting parameter, the second adjusting parameter and the third adjusting parameter;
and determining a target adjusting parameter according to the first adjusting parameter and the standard adjusting parameter.
In an embodiment of the present invention, further, before determining the standard tuning parameter according to the first tuning parameter, the second tuning parameter, and the third tuning parameter, the one or more programs may be further executable by the one or more processors to implement the following steps:
and acquiring a brightness parameter corresponding to the current scene.
In an embodiment of the present invention, further, when determining the standard adjustment parameter according to the first adjustment parameter, the second adjustment parameter, and the third adjustment parameter, the one or more programs are executed by the one or more processors, and the following steps are specifically implemented:
determining an average adjusting parameter according to the second adjusting parameter and the third adjusting parameter;
when the brightness parameter is smaller than or equal to a first preset brightness threshold value, determining a standard adjusting parameter according to the first adjusting parameter and the third adjusting parameter;
when the brightness parameter is greater than or equal to a second preset brightness threshold value, determining a target adjusting parameter according to the first adjusting parameter and the second adjusting parameter;
and when the brightness parameter is greater than the first preset brightness threshold and less than the second preset brightness threshold, determining a standard adjusting parameter according to the first adjusting parameter and the average adjusting parameter.
In an embodiment of the present invention, further, the standard tuning parameters include a second blue tuning parameter and a second red tuning parameter, and when the target tuning parameter is determined according to the first tuning parameter and the standard tuning parameter, the one or more programs are executed by the one or more processors, and specifically implement the following steps:
determining a first target parameter according to the first blue adjusting parameter and the second blue adjusting parameter;
determining a second target parameter according to the first red adjustment parameter and the second red adjustment parameter;
and determining the first target parameter and the second target parameter as target adjusting parameters.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A color adjustment method, comprising:
acquiring at least two color parameters corresponding to at least two preset regions in a current scene; wherein, one preset area corresponds to one color parameter; the color parameters are a red channel R value, a green channel G value and a blue channel B value;
determining a first adjusting parameter corresponding to the current scene according to the at least two color parameters; wherein the first adjustment parameter comprises a first blue adjustment parameter and a first red adjustment parameter;
judging whether to adjust the color of the current scene according to the at least two color parameters and the first blue adjustment parameter;
if the current scene is judged to be subjected to color adjustment, determining target adjustment parameters according to the first adjustment parameters, the first preset color temperature parameters and the second preset color temperature parameters;
and carrying out color adjustment on the current scene according to the target adjustment parameter.
2. The method of claim 1, wherein said determining whether to color-tune the current scene according to the at least two color parameters and the first blue tuning parameter comprises:
judging whether a first judgment condition for color adjustment is met or not according to the first blue adjustment parameter and a preset adjustment parameter threshold;
judging whether a second judgment condition for color adjustment is met or not according to the at least two color parameters and a preset color parameter threshold;
and when the first judgment condition is judged to be met and the second judgment condition is judged to be met, judging to perform color adjustment on the current scene.
3. The method according to claim 2, wherein the determining whether a first determination condition for color adjustment is satisfied according to the first blue adjustment parameter and a preset adjustment parameter threshold comprises:
when the first blue adjusting parameter is greater than or equal to the preset adjusting parameter threshold, judging that the first judging condition is met;
and when the first blue adjusting parameter is smaller than the preset adjusting parameter threshold, judging that the first judging condition is not met.
4. The method according to claim 2, wherein said determining whether a second determination condition for performing color adjustment is satisfied according to the at least two color parameters and a preset color parameter threshold comprises:
determining an average color parameter corresponding to the current scene according to at least two B values corresponding to the at least two color parameters;
when the average color parameter is greater than or equal to the preset color parameter threshold, determining that the second determination condition is satisfied;
and when the average color parameter is smaller than the preset color parameter threshold value, judging that the second judgment condition is not met.
5. The method of claim 1, wherein if it is determined to perform color adjustment on the current scene, determining a target adjustment parameter according to the first adjustment parameter, a first preset color temperature parameter and a second preset color temperature parameter comprises:
acquiring a second adjusting parameter corresponding to the first preset color temperature parameter and a third adjusting parameter corresponding to the second preset color temperature parameter;
determining a standard adjusting parameter according to the first adjusting parameter, the second adjusting parameter and the third adjusting parameter;
and determining the target adjusting parameter according to the first adjusting parameter and the standard adjusting parameter.
6. The method of claim 5, wherein prior to determining a standard tuning parameter based on the first tuning parameter, the second tuning parameter, and the third tuning parameter, the method further comprises:
and acquiring the brightness parameter corresponding to the current scene.
7. The method of claim 6, wherein determining a standard tuning parameter based on the first tuning parameter, the second tuning parameter, and the third tuning parameter comprises:
determining an average adjusting parameter according to the second adjusting parameter and the third adjusting parameter;
when the brightness parameter is smaller than or equal to a first preset brightness threshold value, determining the standard adjusting parameter according to the first adjusting parameter and the third adjusting parameter;
when the brightness parameter is greater than or equal to a second preset brightness threshold value, determining the target adjusting parameter according to the first adjusting parameter and the second adjusting parameter;
and when the brightness parameter is greater than the first preset brightness threshold and less than the second preset brightness threshold, determining the standard adjusting parameter according to the first adjusting parameter and the average adjusting parameter.
8. The method of claim 6, wherein the standard tuning parameters comprise a second blue tuning parameter and a second red tuning parameter, and wherein determining the target tuning parameter based on the first tuning parameter and the standard tuning parameter comprises:
determining a first target parameter according to the first blue adjustment parameter and the second blue adjustment parameter;
determining a second target parameter according to the first red adjustment parameter and the second red adjustment parameter;
determining the first target parameter and the second target parameter as the target adjustment parameter.
9. A terminal, comprising: a processor, a memory, and a communication bus; the communication bus is used for realizing connection communication between the processor and the memory; the processor is configured to execute a data transmission program stored in the memory to implement the method of any one of claims 1-8.
10. A computer-readable storage medium, having one or more programs stored thereon, the one or more programs being executable by one or more processors to perform the method of any of claims 1-8.
CN201711460565.8A 2017-12-28 2017-12-28 Color adjustment method, terminal and computer readable storage medium Active CN108198142B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711460565.8A CN108198142B (en) 2017-12-28 2017-12-28 Color adjustment method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711460565.8A CN108198142B (en) 2017-12-28 2017-12-28 Color adjustment method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108198142A CN108198142A (en) 2018-06-22
CN108198142B true CN108198142B (en) 2020-06-26

Family

ID=62585606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711460565.8A Active CN108198142B (en) 2017-12-28 2017-12-28 Color adjustment method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108198142B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3270024B2 (en) * 1999-06-28 2002-04-02 松下電器産業株式会社 Automatic white balance adjustment device
CN100499733C (en) * 2004-09-30 2009-06-10 富士胶片株式会社 Image correction device and method
CN103929631A (en) * 2013-01-15 2014-07-16 瑞昱半导体股份有限公司 White balance adjusting method using scene detection and device thereof
CN105528575A (en) * 2015-11-18 2016-04-27 首都师范大学 Sky detection algorithm based on context inference

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3270024B2 (en) * 1999-06-28 2002-04-02 松下電器産業株式会社 Automatic white balance adjustment device
CN100499733C (en) * 2004-09-30 2009-06-10 富士胶片株式会社 Image correction device and method
CN103929631A (en) * 2013-01-15 2014-07-16 瑞昱半导体股份有限公司 White balance adjusting method using scene detection and device thereof
CN105528575A (en) * 2015-11-18 2016-04-27 首都师范大学 Sky detection algorithm based on context inference

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
彩色数字相机成像***的关键性技术研究;郭惠楠;《中国博士学位论文全文数据库 信息科技辑》;20150415;第2015年卷(第04期);第I138-55页 *

Also Published As

Publication number Publication date
CN108198142A (en) 2018-06-22

Similar Documents

Publication Publication Date Title
CN107302663B (en) Image brightness adjusting method, terminal and computer readable storage medium
CN107731199B (en) Screen color temperature adjusting method, terminal and computer readable storage medium
CN107613489B (en) Wireless charging method, wireless hotspot device, terminal and storage medium
CN107705247B (en) Image saturation adjusting method, terminal and storage medium
CN108184105B (en) Method and device for adjusting brightness and computer readable storage medium
CN109032741B (en) Terminal screen brightness adjusting method, mobile terminal and storage medium
CN110417999B (en) Screen brightness adjusting method, mobile terminal and computer readable storage medium
CN107067842B (en) Color value adjusting method, mobile terminal and storage medium
CN107295270B (en) Image brightness value determination method and device, terminal and computer-readable storage medium
CN108200421B (en) White balance processing method, terminal and computer readable storage medium
CN108198150B (en) Method for eliminating image dead pixel, terminal and storage medium
CN108449203B (en) Parameter configuration method, network equipment and computer readable storage medium
CN108459799B (en) Picture processing method, mobile terminal and computer readable storage medium
CN112822538A (en) Screen projection display method, screen projection device, terminal and storage medium
CN112399215A (en) Screen projection parameter regulation and control method and device and computer readable storage medium
CN108536383B (en) Game control method, game control equipment and computer readable storage medium
CN111899695A (en) Backlight adjusting method, terminal device and readable storage medium
CN107241504B (en) Image processing method, mobile terminal and computer readable storage medium
CN107466081B (en) Wireless switching method and terminal
CN109462829B (en) Call transfer method, device and computer readable storage medium
CN108196924B (en) Brightness adjusting method, terminal and computer readable storage medium
CN107844353B (en) Display method, terminal and computer readable storage medium
CN109521979B (en) Display control method, terminal and computer-readable storage medium
CN108543306B (en) Game brightness control method and device and computer readable storage medium
CN107770373B (en) Screen saturation adjusting method and corresponding 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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200529

Address after: Room 601, floor 6, building 1, Lane ditch 1, Haidian District, Beijing 100089

Applicant after: BEIJING SHUKE WANGWEI TECHNOLOGY Co.,Ltd.

Address before: 518000 Guangdong Province, Shenzhen high tech Zone of Nanshan District City, No. 9018 North Central Avenue's innovation building A, 6-8 layer, 10-11 layer, B layer, C District 6-10 District 6 floor

Applicant before: NUBIA TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant