CN108196924B - Brightness adjusting method, terminal and computer readable storage medium - Google Patents

Brightness adjusting method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN108196924B
CN108196924B CN201711461006.9A CN201711461006A CN108196924B CN 108196924 B CN108196924 B CN 108196924B CN 201711461006 A CN201711461006 A CN 201711461006A CN 108196924 B CN108196924 B CN 108196924B
Authority
CN
China
Prior art keywords
brightness
weight value
preset
screen occupation
threshold
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
CN201711461006.9A
Other languages
Chinese (zh)
Other versions
CN108196924A (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.)
Nubia Technology Co Ltd
Original Assignee
Nubia 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201711461006.9A priority Critical patent/CN108196924B/en
Publication of CN108196924A publication Critical patent/CN108196924A/en
Application granted granted Critical
Publication of CN108196924B publication Critical patent/CN108196924B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation

Abstract

The embodiment of the invention discloses a brightness adjusting method, a terminal and a computer readable storage medium, wherein the brightness adjusting method comprises the following steps: acquiring a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image; determining a screen occupation ratio corresponding to a preset area; determining a target weight value according to the screen occupation ratio and the first brightness parameter; and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter. The brightness adjusting method provided by the embodiment of the invention can effectively prevent the face overexposure or underexposure in the preview image, thereby avoiding the loss of image information.

Description

Brightness adjusting method, terminal and computer readable storage medium
Technical Field
The present invention relates to terminal technologies, and in particular, to a brightness adjustment method, a terminal, and a computer-readable storage medium.
Background
In the prior art, for a preview image including a human face, a terminal may perform brightness adjustment according to a preset weight value w. Specifically, the terminal may determine the overall brightness L1 of the preview image and the brightness L2 of the face recognition box, respectively, and then calculate the target brightness L corresponding to the face recognition box according to the brightness L2 of the face recognition box, the overall brightness L1 of the preview image, and the weight value w, where L may be obtained by the following formula (1),
L=L2*w+(1-w)L1 (1)
however, when the target brightness corresponding to the face recognition frame is calculated according to the formula (1), the weight value w is a preset value, and therefore, when the difference between the overall brightness L1 of the preview image and the brightness L2 corresponding to the face recognition frame is large, the target brightness L determined according to the above method may cause overexposure or underexposure of the face in the preview image, thereby causing image information loss.
Disclosure of Invention
In view of this, embodiments of the present invention provide a brightness adjustment method, a terminal, and a computer-readable storage medium, which can effectively prevent overexposure or underexposure of a face in a preview image, so as to avoid a lack of image information.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a brightness adjusting method, which comprises the following steps:
acquiring a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image;
determining a screen occupation ratio corresponding to the preset area;
determining a target weight value according to the screen occupation ratio and the first brightness parameter;
and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter.
In the foregoing scheme, the determining a target weight value according to the screen occupation ratio and the second brightness parameter includes:
determining a screen occupation weight value according to the screen occupation ratio, a first preset screen occupation threshold value and a second preset screen occupation threshold value;
determining a brightness weight value according to the first brightness parameter, a first preset brightness threshold value and a second preset brightness threshold value;
and determining the target weight value according to the screen occupation weight value and the brightness weight value.
In the foregoing scheme, before determining a screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold and the second preset screen occupation threshold, the method further includes:
and acquiring a first weight value corresponding to the first preset screen occupying threshold value and a second weight value corresponding to the second preset screen occupying threshold value.
In the above scheme, determining a screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold and the second preset screen occupation threshold includes:
when the screen occupation ratio is smaller than or equal to the first preset screen occupation threshold value, determining the first weight value as the screen occupation weight value;
when the screen occupation ratio is greater than or equal to the second preset screen occupation threshold value, determining the second weight value as the screen occupation weight value;
when the screen occupation ratio is larger than the first preset screen occupation threshold value and the screen occupation ratio is smaller than the second preset screen occupation threshold value, determining the screen occupation weight value according to the first weight value and the second weight value.
In the foregoing solution, before determining the brightness weight value according to the first brightness parameter, the first preset brightness threshold, and the second preset brightness threshold, the method further includes:
and acquiring a third weight value corresponding to the first preset brightness threshold and a fourth weight value corresponding to the second preset brightness threshold.
In the foregoing scheme, the determining a brightness weight value according to the first brightness parameter, the first preset brightness threshold, and the second preset brightness threshold includes:
when the first brightness parameter is less than or equal to the first preset brightness threshold, determining the third weight value as the brightness weight value;
when the first brightness parameter is greater than or equal to the second preset brightness threshold, determining the fourth weight value as the brightness weight value;
when the first brightness parameter is greater than the first preset brightness threshold and the first brightness parameter is less than the second preset brightness threshold, determining the brightness weight value according to the third weight value and the fourth weight value.
In the foregoing solution, the determining the target weight value according to the screen occupation weight value and the brightness weight value includes:
performing multiplication operation on the screen occupation weight value and the brightness weight value to obtain a multiplication result;
determining the multiplication result as the target weight value.
In the foregoing solution, the adjusting the brightness of the preset region according to the target weight value, the first brightness parameter, and the second brightness parameter includes:
inputting the target weight value, the first brightness parameter and the second brightness parameter into a preset calculation model to obtain target brightness;
and adjusting the brightness of the preset area according to the target brightness.
An embodiment of the present invention provides a terminal, where the terminal includes: 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 used for executing the data transmission program stored in the memory so as to realize the brightness adjusting method.
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 the brightness adjustment method as described above.
According to the technical scheme of the embodiment of the invention, a first brightness parameter and a second brightness parameter corresponding to a preview image are obtained; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image; determining a screen occupation ratio corresponding to a preset area; determining a target weight value according to the screen occupation ratio and the first brightness parameter; and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter. Therefore, according to the brightness adjusting method, the terminal and the computer readable storage medium provided by the embodiment of the invention, the corresponding target weight value can be determined according to the first brightness parameter of the preview image and the screen occupation ratio of the preset area in the preview image, and then the brightness adjustment is performed according to the first brightness parameter, the second brightness parameter of the preset area and the target weight value, so that the face overexposure or underexposure in the preview image can be effectively prevented, and the image information can be prevented from being lost.
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 first schematic flow chart illustrating an implementation of a brightness adjustment method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a predetermined area according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an implementation flow of a brightness adjustment method according to an embodiment of the present invention;
fig. 6 is a schematic flow chart illustrating an implementation of the brightness adjustment method according to the embodiment of the present invention;
FIG. 7 is a first diagram illustrating setting weight values according to an embodiment of the present invention;
fig. 8 is a schematic flow chart illustrating an implementation of the brightness adjustment method according to the embodiment of the present invention;
FIG. 9 is a second diagram illustrating setting weight values according to an embodiment of the present invention;
fig. 10 is a schematic flow chart illustrating an implementation of the brightness adjustment method according to the embodiment of the present invention;
fig. 11 is a schematic flow chart illustrating an implementation process of the brightness adjustment method according to the embodiment of the present invention;
fig. 12 is a schematic diagram illustrating an implementation flow of a brightness adjustment method according to an embodiment of the present invention;
fig. 13 is a schematic flow chart of an implementation of the brightness adjustment method according to the embodiment of the present invention;
fig. 14 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 brightness 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 communication (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 User Equipment (UE) 201, Evolved UMTS Terrestrial Radio Access Network (E-UTRAN) 202, Evolved Packet Core Network (EPC) 203, and 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 Gate Way, 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, and the like.
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
Fig. 3 is a first schematic flow chart illustrating an implementation process of a brightness adjustment method according to an embodiment of the present invention, as shown in fig. 3, in an embodiment of the present invention, a method for adjusting brightness of a terminal may include the following steps:
step 101, acquiring a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image.
In the embodiment of the present invention, the terminal may first obtain a first brightness parameter and a second brightness parameter corresponding to the current preview image. The first brightness parameter is used for representing the overall brightness value of the preview image; the second brightness parameter is used for representing a brightness value corresponding to a preset area in the preview image.
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.
In an embodiment of the present invention, the terminal may recognize a biometric feature corresponding to a human face in the preview image, and determine an area corresponding to the biometric feature as the preset area. For example, when the terminal performs shooting, the terminal may automatically recognize a face region, and determine a preset region according to the face region in the preview image.
Fig. 4 is a schematic diagram of a preset region in the embodiment of the present invention, and as shown in fig. 4, in the embodiment of the present invention, a terminal may recognize a face feature in a preview image and determine a face recognition frame according to the face region, where a region corresponding to the face recognition frame is the preset region.
And 102, determining the screen occupation ratio corresponding to the preset area.
In an embodiment of the present invention, after acquiring the first luminance parameter and the second luminance parameter corresponding to the current preview image, the terminal may determine the screen occupation ratio corresponding to the preset area in the preview image.
Further, in an embodiment of the present invention, the terminal may determine a region area corresponding to the preset region, and then obtain an overall area corresponding to the preview image, so as to determine the screen occupation ratio corresponding to the preset region according to the region area and the overall area. In an embodiment of the present invention, the terminal may determine a ratio of the area of the region to the entire area as the screen occupation ratio.
Specifically, in the embodiment of the present invention, if the area corresponding to the preset region is S1, and the area corresponding to the preview image is S2, the screen occupation ratio corresponding to the preset region is S1/S2.
It should be noted that, in the embodiment of the present invention, the screen occupation ratio is used for representing a display weight of the preset area in the preview image. That is, the larger the screen occupation ratio is, the larger the display weight of the preset area in the preview image is; accordingly, the smaller the screen occupation ratio is, the smaller the display weight of the preset region in the preview image is.
And 103, determining a target weight value according to the screen occupation ratio and the first brightness parameter.
In an embodiment of the present invention, after determining the screen occupation ratio corresponding to the preset area in the preview image, the terminal may determine a target weight value according to the screen occupation ratio and the first brightness.
Further, in an embodiment of the present invention, the target weight value is a weight value required for performing a weighted sum on the first luminance parameter and the second luminance parameter when the terminal performs luminance adjustment. In an embodiment of the present invention, the target weight value is a natural number greater than 0 and less than 1.
It should be noted that, in the embodiment of the present invention, the target weight value is the final 0, and is not a fixed value as in the prior art. That is, in an embodiment of the present invention, the terminal determines the target weight value according to the screen occupation ratio and the first brightness parameter, so as to obtain a brightness value more suitable for a human face in a preset area in the preview image.
And 104, adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter.
In an embodiment of the present invention, after determining the target weight value according to the duty ratio and the first brightness parameter, the terminal may adjust the brightness of the preset area according to the target weight value, the first brightness parameter, and the second brightness parameter.
Further, in an embodiment of the present invention, after determining the target weight value, the terminal may perform weighted summation calculation on the first brightness parameter and the second brightness parameter according to the target weight value, so as to obtain a target brightness for brightness adjustment.
In an embodiment of the present invention, the terminal calculates an obtained target brightness according to the target weight value, the first brightness parameter, and the second brightness parameter, and uses the obtained target brightness to perform brightness adjustment on a preset area in the preview image, that is, the target brightness is used to perform brightness adjustment on a human face in the preview image.
The brightness adjusting method provided by the embodiment of the invention obtains a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image; determining a screen occupation ratio corresponding to a preset area; determining a target weight value according to the screen occupation ratio and the first brightness parameter; and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter. Therefore, according to the brightness adjusting method, the terminal and the computer readable storage medium provided by the embodiment of the invention, the corresponding target weight value can be determined according to the first brightness parameter of the preview image and the screen occupation ratio of the preset area in the preview image, and then the brightness adjustment is performed according to the first brightness parameter, the second brightness parameter of the preset area and the target weight value, so that the face overexposure or underexposure in the preview image can be effectively prevented, and the image information can be prevented from being lost.
Example two
Based on the first embodiment, fig. 5 is a schematic view of an implementation flow chart of a brightness adjustment method according to an embodiment of the present invention, as shown in fig. 5, in an embodiment of the present invention, the method for determining the target weight value by the terminal according to the screen occupation ratio and the second brightness parameter may include the following steps:
step 103a, determining a screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold value and the second preset screen occupation threshold value.
In an embodiment of the present invention, after determining the screen occupation ratio corresponding to the preset region in the preview image, the terminal may determine a screen occupation weight value corresponding to the screen occupation ratio according to the screen occupation ratio, a first preset screen occupation threshold value, and a second preset screen occupation threshold value.
It should be noted that, in the embodiment of the present invention, the terminal may preset a screen occupation ratio range, that is, the terminal may set a screen occupation ratio range according to the first preset screen occupation threshold and the second preset screen occupation threshold. Wherein, the first preset screen occupying threshold and the second preset screen occupying threshold are both natural numbers greater than 0 and smaller than 1, and the first preset screen occupying threshold is smaller than the second preset screen occupying threshold, for example, the terminal may set the first preset screen occupying threshold to 0.2 and the second preset screen occupying threshold to 0.6.
And 103b, determining a brightness weight value according to the first brightness parameter, the first preset brightness threshold and the second preset brightness threshold.
In an embodiment of the present invention, after acquiring the first luminance parameter corresponding to the preview image, the terminal may determine a luminance weight value corresponding to the first luminance parameter according to the first luminance parameter, a first preset luminance threshold, and a second preset luminance threshold.
It should be noted that, in the embodiment of the present invention, the terminal may set a brightness range in advance, that is, the terminal may set a brightness range according to the first preset brightness threshold and the second preset brightness threshold. For example, the terminal may set the first preset luminance threshold to be 140 and the second preset luminance threshold to be 290, where the first preset luminance threshold and the second preset luminance threshold are both natural numbers greater than 0 and the first preset luminance threshold is smaller than the second preset luminance threshold.
Further, in an embodiment of the present invention, the first preset brightness threshold may be used to represent a common indoor brightness value, and correspondingly, the second preset brightness threshold may be used to represent a common outdoor brightness value.
And 103c, determining a target weight value according to the screen occupation weight value and the brightness weight value.
In an embodiment of the present invention, after the terminal determines the screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold value, and the second preset screen occupation threshold value, and determines the brightness weight value according to the first brightness parameter, the first preset brightness threshold value, and the second preset brightness threshold value, the terminal may determine the target weight value according to the screen occupation weight value and the brightness weight value.
Further, in an embodiment of the present invention, when obtaining the target weight value, the terminal may determine according to the screen occupation weight value and the brightness weight value. That is, in an embodiment of the present invention, the terminal may determine the target weight value for adjusting the brightness of the preview area by combining the screen occupation ratio of the preset area and the first brightness parameter of the preview image.
According to the above description, through the steps 103a to 103c, the terminal determines a screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold value and the second preset screen occupation threshold value; determining a brightness weight value according to the first brightness parameter, the first preset brightness threshold value and the second preset brightness threshold value; and determining a target weight value according to the screen occupation weight value and the brightness weight value. Therefore, according to the brightness adjusting method, the terminal and the computer readable storage medium provided by the embodiment of the invention, the corresponding target weight value can be determined according to the first brightness parameter of the preview image and the screen occupation ratio of the preset area in the preview image, and then the brightness adjustment is performed according to the first brightness parameter, the second brightness parameter of the preset area and the target weight value, so that the face overexposure or underexposure in the preview image can be effectively prevented, and the image information can be prevented from being lost.
Fig. 6 is a schematic flow chart of an implementation of the brightness adjusting method according to an embodiment of the present invention, as shown in fig. 6, in an embodiment of the present invention, before the terminal determines the screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold and the second preset screen occupation threshold, that is, before step 103a, the method for adjusting the brightness of the terminal may further include the following steps:
and 103d, acquiring a first weight value corresponding to the first preset screen occupying threshold value and a second weight value corresponding to the second preset screen occupying threshold value.
In an embodiment of the present invention, before determining the screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold, and the second preset screen occupation threshold, the terminal may first obtain a first weight value corresponding to the first preset screen occupation threshold, and may also obtain a second weight value corresponding to the second preset screen occupation threshold.
In an embodiment of the present invention, the first weight value and the second weight value may be natural numbers greater than 0 and less than 1, and the first weight value is less than the first weight value.
It should be noted that, in the embodiment of the present invention, if the screen occupation ratio corresponding to the face recognition box is larger, the terminal needs to assign a larger weight value to the face recognition box, that is, the larger the screen occupation ratio is, the larger the weight value is, so that the first weight value corresponding to the first preset screen occupation threshold is smaller than the second weight value corresponding to the second preset screen occupation threshold.
Fig. 7 is a first schematic diagram illustrating setting of a weight value according to an embodiment of the present invention, as shown in fig. 7, in an embodiment of the present invention, the terminal may set a first weight value corresponding to the first preset screen occupation threshold to 0.3, and set a second weight value corresponding to the second preset screen occupation threshold to 0.8 at the same time.
Fig. 8 is a fourth schematic flow chart of an implementation process of the brightness adjusting method according to the embodiment of the present invention, as shown in fig. 8, in the embodiment of the present invention, before the terminal determines the brightness weight value according to the first brightness parameter, the first preset brightness threshold and the second preset brightness threshold, that is, before step 103b, the method for adjusting the brightness of the terminal may further include the following steps:
and 103e, acquiring a third weight value corresponding to the first preset brightness threshold and a fourth weight value corresponding to the second preset brightness threshold.
In an embodiment of the invention, before determining the brightness weight value according to the first brightness parameter, the first preset brightness threshold and the second preset brightness threshold, the terminal may first obtain a third weight value corresponding to the first preset brightness threshold, and may simultaneously obtain a fourth weight value corresponding to the second preset brightness threshold.
In an embodiment of the present invention, the third weight value and the fourth weight value may be natural numbers greater than 0 and less than 1, and the third weight value is greater than the fourth weight value.
In an embodiment of the present invention, if the brightness value corresponding to the preview image is larger, the terminal needs to assign a smaller weight value to the brightness value, that is, the larger the brightness value is, the smaller the weight value is, so that the third weight value corresponding to the first preset brightness threshold is larger than the fourth weight value corresponding to the second preset brightness threshold.
Fig. 9 is a diagram illustrating setting a weight value according to an embodiment of the present invention, and as shown in fig. 9, in an embodiment of the present invention, the terminal may set a third weight value corresponding to the first preset brightness threshold to 0.9, and set a fourth weight value corresponding to the second preset brightness threshold to 0.1.
The brightness adjusting method provided by the embodiment of the invention obtains a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image; determining a screen occupation ratio corresponding to a preset area; determining a target weight value according to the screen occupation ratio and the first brightness parameter; and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter. Therefore, according to the brightness adjusting method, the terminal and the computer readable storage medium provided by the embodiment of the invention, the corresponding target weight value can be determined according to the first brightness parameter of the preview image and the screen occupation ratio of the preset area in the preview image, and then the brightness adjustment is performed according to the first brightness parameter, the second brightness parameter of the preset area and the target weight value, so that the face overexposure or underexposure in the preview image can be effectively prevented, and the image information can be prevented from being lost.
EXAMPLE III
Based on the second embodiment, fig. 10 is a schematic flow chart illustrating an implementation process of the brightness adjustment method according to the second embodiment of the present invention, as shown in fig. 10, in the embodiment of the present invention, the method for determining the screen occupation weight value by the terminal according to the screen occupation ratio, the first preset screen occupation threshold value, and the second preset screen occupation threshold value may include the following steps:
step 201, when the screen occupation ratio is smaller than or equal to a first preset screen occupation threshold value, determining a first weight value as a screen occupation weight value.
In an embodiment of the present invention, after obtaining the first weight value corresponding to the first preset screen occupation threshold and the second weight value corresponding to the second preset screen occupation threshold and determining the screen occupation ratio corresponding to the preset area in the preview image, the terminal may determine the first weight value as the screen occupation weight value if the screen occupation ratio is less than or equal to the first preset screen occupation threshold.
Step 202, when the screen occupation ratio is greater than or equal to a second preset screen occupation threshold value, determining a second weight value as a screen occupation weight value.
In an embodiment of the present invention, after obtaining the first weight value corresponding to the first preset screen occupation threshold and the second weight value corresponding to the second preset screen occupation threshold, and determining the screen occupation ratio corresponding to the preset area in the preview image, if the screen occupation ratio is greater than or equal to the second preset screen occupation threshold, the terminal may determine the second weight value as the screen occupation weight value.
And 203, when the screen occupation ratio is greater than a first preset screen occupation threshold value and is less than a second preset screen occupation threshold value, determining a screen occupation weight value according to a first weight value and a second weight value.
In an embodiment of the present invention, after obtaining the first weight value corresponding to the first preset screen occupation threshold and the second weight value corresponding to the second preset screen occupation threshold and determining the screen occupation ratio corresponding to the preset area in the preview image, if the screen occupation ratio is greater than the first preset screen occupation threshold and the screen occupation ratio is smaller than the second preset screen occupation threshold, the terminal may determine the screen occupation weight value according to the first weight value and the second weight value.
Further, in an embodiment of the present invention, if the screen occupation ratio is greater than the first preset screen occupation threshold and the screen occupation ratio is smaller than the second preset screen occupation threshold, the terminal may perform a difference calculation on the first weight value and the second weight value according to the screen occupation ratio, the first preset screen occupation threshold and the second preset screen occupation threshold, so as to obtain the screen occupation weight value.
The brightness adjusting method provided by the embodiment of the invention obtains a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image; determining a screen occupation ratio corresponding to a preset area; determining a target weight value according to the screen occupation ratio and the first brightness parameter; and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter. Therefore, according to the brightness adjusting method, the terminal and the computer readable storage medium provided by the embodiment of the invention, the corresponding target weight value can be determined according to the first brightness parameter of the preview image and the screen occupation ratio of the preset area in the preview image, and then the brightness adjustment is performed according to the first brightness parameter, the second brightness parameter of the preset area and the target weight value, so that the face overexposure or underexposure in the preview image can be effectively prevented, and the image information can be prevented from being lost.
Example four
Based on the second embodiment, fig. 11 is a sixth implementation flow diagram of the brightness adjustment method according to the second embodiment of the present invention, as shown in fig. 11, in the embodiment of the present invention, the method for determining the brightness weight value by the terminal according to the first brightness parameter, the first preset brightness threshold, and the second preset brightness threshold may include the following steps:
step 301, when the first brightness parameter is less than or equal to the first preset brightness threshold, determining the third weight value as the brightness weight value.
In an embodiment of the present invention, after obtaining the third weight value corresponding to the first preset brightness threshold and the fourth weight value corresponding to the second preset brightness threshold, and determining the brightness weight value according to the first brightness parameter, the first preset brightness threshold and the second preset brightness threshold, the terminal may determine the third weight value as the brightness weight value if the first brightness parameter is less than or equal to the first preset brightness threshold.
Step 302, when the first brightness parameter is greater than or equal to the second preset brightness threshold, determining the fourth weight value as the brightness weight value.
In an embodiment of the present invention, after obtaining the third weight value corresponding to the first preset brightness threshold and the fourth weight value corresponding to the second preset brightness threshold, and determining the brightness weight value according to the first brightness parameter, the first preset brightness threshold and the second preset brightness threshold, the terminal may determine the fourth weight value as the brightness weight value if the first brightness parameter is greater than or equal to the second preset brightness threshold.
Step 303, when the first brightness parameter is greater than the first preset brightness threshold and the first brightness parameter is less than the second preset brightness threshold, determining a brightness weight value according to the third weight value and the fourth weight value.
In an embodiment of the invention, after obtaining the third weight value corresponding to the first preset brightness threshold and the fourth weight value corresponding to the second preset brightness threshold and determining the brightness weight value according to the first brightness parameter, the first preset brightness threshold and the second preset brightness threshold, if the first brightness parameter is greater than the first preset brightness threshold and the first brightness parameter is less than the second preset brightness threshold, the terminal may determine the brightness weight value according to the third weight value and the fourth weight value.
Further, in an embodiment of the present invention, if the first brightness parameter is greater than the first preset brightness threshold and the first brightness parameter is less than the second preset brightness threshold, the terminal may perform a difference calculation on the third weight value and the fourth weight value according to the first brightness parameter, the first preset brightness threshold and the second preset brightness threshold, so as to obtain the brightness weight value.
The brightness adjusting method provided by the embodiment of the invention obtains a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image; determining a screen occupation ratio corresponding to a preset area; determining a target weight value according to the screen occupation ratio and the first brightness parameter; and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter. Therefore, according to the brightness adjusting method, the terminal and the computer readable storage medium provided by the embodiment of the invention, the corresponding target weight value can be determined according to the first brightness parameter of the preview image and the screen occupation ratio of the preset area in the preview image, and then the brightness adjustment is performed according to the first brightness parameter, the second brightness parameter of the preset area and the target weight value, so that the face overexposure or underexposure in the preview image can be effectively prevented, and the image information can be prevented from being lost.
EXAMPLE five
Based on the second embodiment, fig. 12 is a seventh implementation flow diagram of the brightness 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 method for the terminal to determine the target weight value according to the screen occupation weight value and the brightness weight value may include the following steps:
step 401, performing a product operation on the screen occupation weight value and the brightness weight value to obtain a product result.
The terminal determines the screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold value and the second preset screen occupation threshold value, and performs product operation on the screen occupation weight and the brightness weight after determining the brightness weight value according to the first brightness parameter, the first preset brightness threshold value and the second preset brightness threshold value, so as to obtain a product result corresponding to the screen occupation weight and the brightness weight.
Specifically, in an embodiment of the present invention, the terminal may perform a multiplicative budget for the screen occupation weight and the brightness weight, so that the target weight value may be further determined according to the screen occupation weight and the brightness weight.
Step 402, determining the multiplication result as a target weight value.
In an embodiment of the present invention, after the terminal performs a multiplication operation on the screen occupation weight and the brightness weight and obtains a multiplication result corresponding to the screen occupation weight and the brightness weight, the terminal may determine the multiplication result as the target weight value.
It should be noted that, in the embodiment of the present invention, the target weight value is not a fixed value, but is obtained by the terminal according to the combination of the duty ratio and the first brightness parameter.
The brightness adjusting method provided by the embodiment of the invention obtains a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image; determining a screen occupation ratio corresponding to a preset area; determining a target weight value according to the screen occupation ratio and the first brightness parameter; and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter. Therefore, according to the brightness adjusting method, the terminal and the computer readable storage medium provided by the embodiment of the invention, the corresponding target weight value can be determined according to the first brightness parameter of the preview image and the screen occupation ratio of the preset area in the preview image, and then the brightness adjustment is performed according to the first brightness parameter, the second brightness parameter of the preset area and the target weight value, so that the face overexposure or underexposure in the preview image can be effectively prevented, and the image information can be prevented from being lost.
EXAMPLE six
Based on the first embodiment, fig. 13 is an eighth implementation flowchart of the brightness adjustment method according to the first embodiment of the present invention, as shown in fig. 13, in the embodiment of the present invention, the method for the terminal to adjust the brightness of the preset area according to the target weight value, the first brightness parameter, and the second brightness parameter may include the following steps:
and 104a, inputting the target weight value, the first brightness parameter and the second brightness parameter into a preset calculation model to obtain target brightness.
In an embodiment of the present invention, after determining the target weight value according to the duty ratio and the first brightness parameter, the terminal may input the target weight value, the first brightness parameter, and the second brightness parameter into a preset calculation model, so as to obtain a target brightness.
It should be noted that, in the embodiment of the present invention, the terminal may obtain the target brightness according to the formula (1). Wherein, L1 is the first brightness parameter, L2 is the second brightness parameter, L is the target brightness, and w is the target weight value.
And 104b, adjusting the brightness of the preset area according to the target brightness.
In an embodiment of the present invention, after the terminal inputs the target weight value, the first luminance parameter, and the second luminance parameter into a preset calculation model to obtain the target luminance, the terminal may adjust the luminance of the preset area according to the target luminance.
In an embodiment of the present invention, the target brightness is used to adjust the brightness of a preset area in the preview image, that is, the target brightness is used to adjust the brightness of a human face in the preview image.
According to the above description, in the steps 104a to 104b, the terminal inputs the target weight value, the first brightness parameter and the second brightness parameter into a preset calculation model to obtain the target brightness; and adjusting the brightness of the preset area according to the target brightness. Therefore, according to the brightness adjusting method, the terminal and the computer readable storage medium provided by the embodiment of the invention, the corresponding target weight value can be determined according to the first brightness parameter of the preview image and the screen occupation ratio of the preset area in the preview image, and then the brightness adjustment is performed according to the first brightness parameter, the second brightness parameter of the preset area and the target weight value, so that the face overexposure or underexposure in the preview image can be effectively prevented, and the image information can be prevented from being lost.
EXAMPLE seven
Based on the first to sixth embodiments, fig. 14 is a schematic structural diagram of a terminal according to an embodiment of the present invention, and in practical applications, based on the same inventive concept of the first to sixth embodiments, as shown in fig. 14, a terminal 3 according to an embodiment 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. 14 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 brightness adjustment program stored in the memory 32 to implement the following steps:
acquiring a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image; determining a screen occupation ratio corresponding to a preset area; determining a target weight value according to the screen occupation ratio and the first brightness parameter; and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter.
In an embodiment of the present invention, further, the processor 31 is specifically configured to determine a screen occupation weight value according to a screen occupation ratio, a first preset screen occupation threshold and a second preset screen occupation threshold; determining a brightness weight value according to the first brightness parameter, the first preset brightness threshold value and the second preset brightness threshold value; and determining a target weight value according to the screen occupation weight value and the brightness weight value.
In an embodiment of the present invention, the processor 31 is further configured to, before determining the screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold and the second preset screen occupation threshold, obtain a first weight value corresponding to the first preset screen occupation threshold and a second weight value corresponding to the second preset screen occupation threshold.
In an embodiment of the present invention, the processor 31 is specifically configured to determine a first weight value as a screen occupation weight value when the screen occupation ratio is less than or equal to a first preset screen occupation threshold; when the screen occupation ratio is greater than or equal to a second preset screen occupation threshold value, determining a second weight value as a screen occupation weight value; and when the screen occupation ratio is greater than a first preset screen occupation threshold value and is less than a second preset screen occupation threshold value, determining a screen occupation weight value according to the first weight value and the second weight value.
In an embodiment of the present invention, the processor 31 is further configured to, before determining the brightness weight value according to the first brightness parameter, the first preset brightness threshold and the second preset brightness threshold, obtain a third weight value corresponding to the first preset brightness threshold and a fourth weight value corresponding to the second preset brightness threshold.
In an embodiment of the present invention, further, the processor 31 is specifically configured to determine a third weight value as the brightness weight value when the first brightness parameter is less than or equal to the first preset brightness threshold; when the first brightness parameter is larger than or equal to a second preset brightness threshold value, determining a fourth weight value as a brightness weight value; and when the first brightness parameter is greater than a first preset brightness threshold and the first brightness parameter is less than a second preset brightness threshold, determining a brightness weight value according to a third weight value and a fourth weight value.
In an embodiment of the present invention, further, the processor 31 is specifically configured to perform a product operation on the screen occupation weight value and the brightness weight value to obtain a product result; and determining the multiplication result as a target weight value.
In an embodiment of the present invention, the processor 31 is specifically configured to input the target weight value, the first luminance parameter, and the second luminance parameter into a preset calculation model to obtain a target luminance; and adjusting the brightness of the preset area according to the target brightness.
The terminal provided by the embodiment of the invention acquires a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image; determining a screen occupation ratio corresponding to a preset area; determining a target weight value according to the screen occupation ratio and the first brightness parameter; and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter. Therefore, the terminal provided by the embodiment of the invention can determine the corresponding target weight value according to the first brightness parameter of the preview image and the screen occupation ratio of the preset area in the preview image, and then carry out brightness adjustment according to the first brightness parameter, the second brightness parameter of the preset area and the target weight value, so that the face overexposure or underexposure in the preview image can be effectively prevented, and further the image information can be prevented from being lost.
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 a brightness adjusting 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 a brightness adjusting method in the storage medium are read or executed by an electronic device, the method includes the following steps:
acquiring a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image;
determining a screen occupation ratio corresponding to a preset area;
determining a target weight value according to the screen occupation ratio and the first brightness parameter;
and adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter.
In an embodiment of the present invention, further, when determining the target weight value according to the screen occupation ratio and the second brightness parameter, the one or more programs are executed by the one or more processors, and the following steps are specifically implemented:
determining a screen occupation weight value according to the screen occupation ratio, a first preset screen occupation threshold value and a second preset screen occupation threshold value;
determining a brightness weight value according to the first brightness parameter, the first preset brightness threshold value and the second preset brightness threshold value;
and determining a target weight value according to the screen occupation weight value and the brightness weight value.
In an embodiment of the present invention, further, before determining the screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold, and the second preset screen occupation threshold, the one or more programs may be further executed by the one or more processors to implement the following steps:
and acquiring a first weight value corresponding to the first preset screen occupying threshold value and a second weight value corresponding to the second preset screen occupying threshold value.
In an embodiment of the present invention, further, when determining a screen occupation weight value according to a screen occupation ratio, a first preset screen occupation threshold, and a second preset screen occupation threshold, the one or more programs are executed by the one or more processors, and the following steps are specifically implemented:
when the screen occupation ratio is smaller than or equal to a first preset screen occupation threshold value, determining a first weight value as a screen occupation weight value;
when the screen occupation ratio is greater than or equal to a second preset screen occupation threshold value, determining a second weight value as a screen occupation weight value;
and when the screen occupation ratio is greater than a first preset screen occupation threshold value and is less than a second preset screen occupation threshold value, determining a screen occupation weight value according to the first weight value and the second weight value.
In an embodiment of the present invention, further, before determining the brightness weight value according to the first brightness parameter, the first preset brightness threshold, and the second preset brightness threshold, the one or more programs may be further executable by the one or more processors to implement the following steps:
and acquiring a third weight value corresponding to the first preset brightness threshold and a fourth weight value corresponding to the second preset brightness threshold.
In an embodiment of the present invention, further, when determining the luminance weight value according to the first luminance parameter, the first preset luminance threshold, and the second preset luminance threshold, the one or more programs are executed by the one or more processors, and the following steps are specifically implemented:
when the first brightness parameter is smaller than or equal to a first preset brightness threshold value, determining a third weight value as a brightness weight value;
when the first brightness parameter is larger than or equal to a second preset brightness threshold value, determining a fourth weight value as a brightness weight value;
and when the first brightness parameter is greater than a first preset brightness threshold and the first brightness parameter is less than a second preset brightness threshold, determining a brightness weight value according to a third weight value and a fourth weight value.
In an embodiment of the present invention, further, when determining the target weight value according to the screen occupation weight value and the brightness weight value, the one or more programs are executed by the one or more processors, and the following steps are specifically implemented:
performing multiplication operation on the screen occupation weight value and the brightness weight value to obtain a multiplication result;
and determining the multiplication result as a target weight value.
In an embodiment of the present invention, further, when adjusting the brightness of the preset region according to the target weight value, the first brightness parameter, and the second brightness parameter, the one or more programs are executed by the one or more processors, and the following steps are specifically implemented:
inputting the target weight value, the first brightness parameter and the second brightness parameter into a preset calculation model to obtain target brightness;
and adjusting the brightness of the preset area according to the target brightness.
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 (9)

1. A method of adjusting brightness, the method comprising:
acquiring a first brightness parameter and a second brightness parameter corresponding to a preview image; the first brightness parameter is an overall brightness value corresponding to the preview image; the second brightness parameter is a brightness value corresponding to a preset area in the preview image;
determining a screen occupation ratio corresponding to the preset area;
determining a target weight value according to the screen occupation ratio and the first brightness parameter;
adjusting the brightness of the preset area according to the target weight value, the first brightness parameter and the second brightness parameter;
wherein the determining a target weight value according to the screen occupation ratio and the first brightness parameter comprises:
determining a screen occupation weight value according to the screen occupation ratio, a first preset screen occupation threshold value and a second preset screen occupation threshold value;
determining a brightness weight value according to the first brightness parameter, a first preset brightness threshold value and a second preset brightness threshold value;
and determining the target weight value according to the screen occupation weight value and the brightness weight value.
2. The method according to claim 1, wherein before determining the screen occupation weight value according to the screen occupation ratio, the first preset screen occupation threshold and the second preset screen occupation threshold, the method further comprises:
and acquiring a first weight value corresponding to the first preset screen occupying threshold value and a second weight value corresponding to the second preset screen occupying threshold value.
3. The method according to claim 2, wherein determining a screen occupation weight value according to the screen occupation ratio, a first preset screen occupation threshold value and a second preset screen occupation threshold value comprises:
when the screen occupation ratio is smaller than or equal to the first preset screen occupation threshold value, determining the first weight value as the screen occupation weight value;
when the screen occupation ratio is greater than or equal to the second preset screen occupation threshold value, determining the second weight value as the screen occupation weight value;
when the screen occupation ratio is larger than the first preset screen occupation threshold value and the screen occupation ratio is smaller than the second preset screen occupation threshold value, determining the screen occupation weight value according to the first weight value and the second weight value.
4. The method of claim 1, wherein before determining the brightness weight value according to the first brightness parameter, the first preset brightness threshold, and the second preset brightness threshold, the method further comprises:
and acquiring a third weight value corresponding to the first preset brightness threshold and a fourth weight value corresponding to the second preset brightness threshold.
5. The method of claim 4, wherein determining a brightness weight value according to the first brightness parameter, a first preset brightness threshold and a second preset brightness threshold comprises:
when the first brightness parameter is less than or equal to the first preset brightness threshold, determining the third weight value as the brightness weight value;
when the first brightness parameter is greater than or equal to the second preset brightness threshold, determining the fourth weight value as the brightness weight value;
when the first brightness parameter is greater than the first preset brightness threshold and the first brightness parameter is less than the second preset brightness threshold, determining the brightness weight value according to the third weight value and the fourth weight value.
6. The method of claim 1, wherein determining the target weight value according to the screen weight value and the brightness weight value comprises:
performing multiplication operation on the screen occupation weight value and the brightness weight value to obtain a multiplication result;
determining the multiplication result as the target weight value.
7. The method according to claim 1, wherein the adjusting the brightness of the preset region according to the target weight value, the first brightness parameter and the second brightness parameter comprises:
inputting the target weight value, the first brightness parameter and the second brightness parameter into a preset calculation model to obtain target brightness;
and adjusting the brightness of the preset area according to the target brightness.
8. A terminal, characterized in that the terminal comprises: 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-7.
9. 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-7.
CN201711461006.9A 2017-12-28 2017-12-28 Brightness adjusting method, terminal and computer readable storage medium Active CN108196924B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711461006.9A CN108196924B (en) 2017-12-28 2017-12-28 Brightness adjusting method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711461006.9A CN108196924B (en) 2017-12-28 2017-12-28 Brightness adjusting method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108196924A CN108196924A (en) 2018-06-22
CN108196924B true CN108196924B (en) 2021-01-15

Family

ID=62585273

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711461006.9A Active CN108196924B (en) 2017-12-28 2017-12-28 Brightness adjusting method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108196924B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110223244B (en) * 2019-05-13 2021-08-27 浙江大华技术股份有限公司 Image processing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905740A (en) * 2014-04-17 2014-07-02 广东欧珀移动通信有限公司 Method and device for improving automatic exposure effect realized through manual adjustment
CN104994306A (en) * 2015-06-29 2015-10-21 厦门美图之家科技有限公司 Photographic method and photographic device capable of automatically adjusting exposure based on face brightness
CN105744175A (en) * 2016-02-15 2016-07-06 广东欧珀移动通信有限公司 Screen light fill method and device and mobile terminal
CN106681609A (en) * 2016-12-15 2017-05-17 珠海格力电器股份有限公司 Terminal device screen brightness adjustment method, terminal device screen brightness adjustment device and terminal device
CN107302663A (en) * 2017-07-31 2017-10-27 努比亚技术有限公司 A kind of brightness of image method of adjustment, terminal and computer-readable recording medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5136664B2 (en) * 2010-07-09 2013-02-06 カシオ計算機株式会社 Image processing apparatus and program
US8941742B2 (en) * 2013-04-08 2015-01-27 Iix Inc. Luminance measurement method, luminance measurement device, and image quality adjustment technique using the method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905740A (en) * 2014-04-17 2014-07-02 广东欧珀移动通信有限公司 Method and device for improving automatic exposure effect realized through manual adjustment
CN104994306A (en) * 2015-06-29 2015-10-21 厦门美图之家科技有限公司 Photographic method and photographic device capable of automatically adjusting exposure based on face brightness
CN105744175A (en) * 2016-02-15 2016-07-06 广东欧珀移动通信有限公司 Screen light fill method and device and mobile terminal
CN106681609A (en) * 2016-12-15 2017-05-17 珠海格力电器股份有限公司 Terminal device screen brightness adjustment method, terminal device screen brightness adjustment device and terminal device
CN107302663A (en) * 2017-07-31 2017-10-27 努比亚技术有限公司 A kind of brightness of image method of adjustment, terminal and computer-readable recording medium

Also Published As

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

Similar Documents

Publication Publication Date Title
CN107731199B (en) Screen color temperature adjusting method, terminal and computer readable storage medium
CN110035176B (en) Brightness adjusting method of mobile terminal, mobile terminal and storage medium
CN107295270B (en) Image brightness value determination method and device, terminal and computer-readable storage medium
CN110417999B (en) Screen brightness adjusting method, mobile terminal and computer readable storage medium
CN108038834B (en) Method, terminal and computer readable storage medium for reducing noise
CN108200421B (en) White balance processing method, terminal and computer readable storage medium
CN107979667B (en) Dual-screen display method, mobile terminal and computer-readable storage medium
CN110187808B (en) Dynamic wallpaper setting method and device and computer-readable storage medium
CN108900779B (en) Initial automatic exposure convergence 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
CN110069122B (en) Screen control method, terminal and computer readable storage medium
CN107896304B (en) Image shooting method and device and computer readable storage medium
CN110086993B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN110052024B (en) Game vibration adjusting method, adjusting device, mobile terminal and storage medium
CN112437472B (en) Network switching method, equipment and computer readable storage medium
CN112866685A (en) Screen projection delay measuring method, mobile terminal and computer readable storage medium
CN109561221B (en) Call control method, device and computer readable storage medium
CN109462829B (en) Call transfer method, device and computer readable storage medium
CN109683778B (en) Flexible screen control method and device and computer readable storage medium
CN107743204B (en) Exposure processing method, terminal, and computer-readable storage medium
CN107844353B (en) Display method, terminal and computer readable storage medium
CN108543306B (en) Game brightness control method and device and computer readable storage medium
CN108183833B (en) Response processing method and device and computer readable storage medium
CN108182667B (en) Image optimization method, terminal and computer readable storage medium

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
GR01 Patent grant
GR01 Patent grant