CN107438163B - Photographing method, terminal and computer readable storage medium - Google Patents
Photographing method, terminal and computer readable storage medium Download PDFInfo
- Publication number
- CN107438163B CN107438163B CN201710643860.0A CN201710643860A CN107438163B CN 107438163 B CN107438163 B CN 107438163B CN 201710643860 A CN201710643860 A CN 201710643860A CN 107438163 B CN107438163 B CN 107438163B
- Authority
- CN
- China
- Prior art keywords
- areas
- determining
- image
- area
- coefficient
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/71—Circuitry for evaluating the brightness variation
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
The embodiment of the invention discloses a photographing method, a terminal and a computer readable storage medium, wherein the method comprises the following steps: dividing the acquired first image into N areas, and determining N first current brightness values corresponding to the N areas, wherein N is a natural number greater than 1; determining M areas meeting preset conditions according to the N first current brightness values, wherein M is a natural number greater than or equal to 1, and M < N; determining the corrected photometric weight of the M areas according to the preset photometric weight of the M areas; determining an adjusted brightness value of the first image according to the first current brightness value and the corresponding modified metering weight of the M areas and the first current brightness and the corresponding preset metering weight of (N-M) areas except the M areas in the N areas; and determining an exposure parameter according to the adjusted brightness value, and taking a picture according to the exposure parameter.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a photographing method, a terminal, and a computer-readable storage medium.
Background
With the rapid development of communication technology, terminals are developing towards intellectualization, for example, smart phones or tablet computers are also having more and more functions, and the mobile communication terminals are not simply used for meeting the mutual connection of people for a long time and become very important mobile personal entertainment terminals in daily life of people.
At present, the photographing function becomes an indispensable function of an intelligent terminal, and people can record wonderful moments anytime and anywhere. When shooting is performed, under the environment of backlight, it is likely that the brightness of the shot object will appear much darker than the background. On the contrary, if the light source directly irradiates the object, the brightness of the object will be much brighter than the background. When the brightness of the subject is significantly brighter or darker, the subject may lose the relevant features due to overexposure or underexposure.
Disclosure of Invention
In view of this, embodiments of the present invention desirably provide a photographing method, a terminal, and a computer-readable storage medium, which solve the problem in the prior art that an image of a photographic subject loses relevant features due to overexposure or underexposure of the photographic subject during a photographing process, and implement brightness adjustment of an image by adjusting photometric weights of different image regions, thereby avoiding overexposure or underexposure of the photographic subject and further improving the quality of the image.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a photographing method, where the method includes:
dividing an acquired first image into N areas, and determining N first current brightness values corresponding to the N areas, wherein N is a natural number greater than 1, and the first current brightness value is a current brightness average value of one image area;
determining M areas meeting preset conditions according to the N first current brightness values, wherein M is a natural number greater than or equal to 1, and M < N;
determining the corrected photometric weight of the M areas according to the preset photometric weight of the M areas;
determining an adjusted brightness value of the first image according to the first current brightness value and the corresponding modified metering weight of the M areas and the first current brightness and the corresponding preset metering weight of (N-M) areas except the M areas in the N areas;
and determining an exposure parameter according to the adjusted brightness value, and taking a picture according to the exposure parameter.
In a second aspect, an embodiment of the present invention provides a terminal, where the terminal at least includes: camera, treater, memory and communication bus, wherein:
the camera is used for collecting images;
the communication bus is used for realizing connection communication between the processor and the memory;
the memory is used for storing an image brightness adjusting program;
the processor is used for executing the image brightness adjusting program stored in the memory so as to realize the following steps:
dividing an acquired first image into N areas, and determining N first current brightness values corresponding to the N areas, wherein N is a natural number greater than 1, and the first current brightness value is a current brightness average value of one image area;
determining M areas meeting preset conditions according to the N first current brightness values, wherein M is a natural number greater than or equal to 1, and M < N;
determining the corrected photometric weight of the M areas according to the preset photometric weight of the M areas;
determining an adjusted brightness value of the first image according to the first current brightness value and the corresponding modified metering weight of the M areas and the first current brightness and the corresponding preset metering weight of (N-M) areas except the M areas in the N areas;
and determining an exposure parameter according to the adjusted brightness value, and taking a picture according to the exposure parameter.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, where a photographing program is stored on the computer-readable storage medium, and the photographing program, when executed by a processor, implements the steps of the photographing method described above.
The embodiment of the invention provides a photographing method, a terminal and a computer readable storage medium, wherein firstly, an acquired first image is divided into N areas, and N first current brightness values corresponding to the N areas are determined, wherein N is a natural number greater than 1; then, determining M areas meeting preset conditions according to the N first current brightness values, wherein M is a natural number greater than or equal to 1, and M < N; determining the corrected photometric weight of the M areas according to the preset photometric weight of the M areas; and determining an adjustment brightness value of the first image according to the first current brightness value of the M areas, the corresponding correction photometric weight and the first current brightness value of (N-M) areas except the M areas in the N areas and the corresponding preset photometric weight, and finally determining an exposure parameter according to the adjustment brightness value, and taking a picture according to the exposure parameter.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal 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 view of an implementation flow of a photographing method according to an embodiment of the present invention;
fig. 4 is a schematic view of an implementation flow of another photographing method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a terminal interface of a first image according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a terminal interface of a second image according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a terminal interface of a third image according to an embodiment of the present invention;
fig. 8 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 a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and 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 uplink data is transmitted 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 GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex-Long term Evolution), and TDD-LTE (Time Division duplex-Long term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi 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 WiFi 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 graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi 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 UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
The UE 201 may be the terminal 100, 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 eNodeB 2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC 203, and the eNodeB2021 may provide the UE 201 access to the EPC 203.
The EPC 203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving GateWay) 2034, a PGW (PDN GateWay) 2035, and a PCRF (Policy and charging functions Entity) 2036, and the like. The MME 2031 is a control node that handles signaling between the UE 201 and the EPC 203, and provides bearer and connection management. HSS 2032 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 SGW 2034, PGW 2035 may provide IP address assignment for UE 201 and other functions, and PCRF 2036 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, IMS (IP Multimedia Subsystem), 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.
An embodiment of the present invention provides a photographing method, and fig. 3 is a schematic view illustrating an implementation flow of the photographing method provided in the embodiment of the present invention, as shown in fig. 3, the method includes the following steps:
step S301, dividing the acquired first image into N regions, and determining N first current luminance values corresponding to the N regions.
Here, the step S301 divides the acquired first image into N regions, and determines that N first current brightness values corresponding to the N regions may be implemented by a terminal, and further may be a mobile terminal, for example, a mobile terminal with wireless communication capability such as a mobile phone (mobile phone), an iPad, a notebook, a wearable smart watch, and the like, where the mobile terminal includes at least a camera and a display screen, and the camera may be on the same plane as a plane where the display screen of the terminal is located, or may be located on an opposite plane to the plane where the display screen of the terminal is located.
It should be noted that the first image may be a preview image acquired when a camera application of the terminal is opened.
In the embodiments of the present invention and other embodiments, N is a natural number greater than 1, for example, N may be 256, that is, the first image is divided into 16 × 16 matrix image areas.
The brightness of an image refers to the intensity of the image pixels, black being darkest, white being brightest, black being represented by 0, and white being represented by 255. One pixel is basically R (0-255), G (0-255), B (0-255) expressed by three color components of Red Green Blue (RGB). There is no relation between the brightness and the hue, and the same brightness can be either red or green, just like the image in a black and white (grayscale) television, and it cannot be determined whether red or green by just one grayscale. Therefore, the luminance and the hue of the pixel are irrelevant.
The first current brightness value is an average value of current brightness of an image area. In an actual implementation process, for a gray-scale image, determining a first current brightness value of an image region may be implemented by performing geometric average or weighted average on brightness values of each pixel point in the image region. For color images, the first current luminance value of the image area is determined by first converting the RGB spatial matrix of the image area into a Hue Saturation Luminance (HSL) spatial matrix, wherein the L component of the HSL spatial matrix represents luminance, and then determining the first current luminance value according to the L component of the image area.
And determining the first current luminance value of the image region according to the L component in the HSL matrix can be achieved in two ways:
the first mode is as follows: carrying out average (mean) operation twice on the L component of the image area to obtain the brightness average value of the image area, namely a first current brightness value;
the second mode is as follows: converting the L component in the image area into a logarithmic space to calculate a logarithmic space brightness average value of the image; and carrying out anti-log calculation on the logarithmic space brightness average value of the image area to obtain the brightness average value of the image area.
Of course, the above-mentioned methods for calculating the first current brightness of the image region are all exemplary descriptions, and those skilled in the art may utilize the technical idea of the present invention to provide other ways for determining the first current brightness of the image region according to their specific requirements, which are within the scope of the present invention and are not exhaustive here.
Step S302, determining M areas meeting preset conditions according to the N first current brightness values. Here, the step S302 of determining M regions satisfying a preset condition according to the N first current brightness values may be implemented by a terminal.
M is a natural number greater than or equal to 1, and M < N. The M regions may be understood as regions where the photometric weight needs to be adjusted.
Determining an average brightness value of the first image according to the N first current brightness values, wherein if the average brightness value of the first image is lower than a threshold (a fifth threshold), it indicates that the average brightness value of the first image is too low, and underexposure is likely to occur, and at this time, the average brightness value of the first image needs to be increased; if the average brightness value of the first image is higher than another threshold (first threshold), which means that the average brightness value of the image is too high, overexposure is likely to occur, and it is necessary to lower the average brightness value of the first image.
The average luminance value of the first image may be obtained by performing a weighted average on first current luminance values of the N image regions.
Reducing or increasing the average luminance value of an image may be achieved by modifying the photometric weight of some image regions.
Step S303, determining the corrected photometric weight of the M regions according to the preset photometric weight of the M regions.
Here, the step S303 of determining the modified metering weights for the M regions according to the preset metering weights for the M regions may be implemented by a terminal.
For better understanding of the embodiments of the present invention, photometry and various photometry methods are described herein.
Photometry is the measurement of the brightness of light reflected by a subject, and is also called reflectance photometry. Common photometry methods include: center averaging photometry, center partial photometry, spot photometry, multipoint photometry, and evaluative photometry.
The central average light measurement adopts a light measurement mode at most, a sense element responsible for light measurement organically divides the whole light measurement value of the camera, the light measurement data of the central part occupies most proportion, and the light measurement data outside the center of the picture plays an auxiliary role in light measurement as a small proportion. And obtaining the shot camera photometric data by weighting and averaging the two grid values through a processor of the camera according to the ratio. That is, the photometric weight value of the area in the center of the screen is larger, and the photometric weight value of the area in the peripheral part of the screen is smaller.
The central partial metering and the central average metering are two different metering modes, the central average metering is a metering mode taking the central area as the main area and the other areas as the auxiliary areas, the central partial metering is to only measure the central area of the picture, and the metering range is about three percent to twelve percent of the picture area.
The dot photometry is performed only on one point as the name implies, the point and the focus point are at the same position (actually, a very small area is not a complete point), and the photometry area of most dot cameras is one percent to three percent of the whole screen area.
The multi-point light measurement achieves the best photographing effect through the brightness of different positions of a scene object, the methods of flash lamp compensation and the like, and is particularly suitable for photographing a backlight object. Firstly, a user needs to perform photometry on a scene background, generally a light source object, and then perform AE locking; and the second step is to perform photometry on the backlight scene, most professional or quasi-professional cameras can automatically analyze the scene, and a flash lamp is used for supplementing light for the backlight object.
The evaluation light measurement is to divide the picture into several areas, each area is separately measured, and then the camera processor collects the measured values of the areas and calculates a final value through weight, thereby measuring the light of the whole picture. The advantage of this photometric mode is that a picture with balanced brightness can be easily obtained, local high overexposure or underexposure does not occur, and the whole picture has balanced brightness.
One or more of the above light measuring methods are used in the embodiments of the present invention or other embodiments.
Regardless of the metering mode, a metering table corresponding to the metering mode is stored in the terminal, and the metering table has a preset metering weight corresponding to each image area. When the brightness of the image frame needs to be adjusted, the brightness can be adjusted by modifying the photometric weight corresponding to the image area.
Modifying the metering weight corresponding to an image area may be directly replacing the preset metering weight corresponding to the image area with the modified metering weight, and in other embodiments, the preset metering weight corresponding to the image area may be multiplied by a coefficient to obtain the modified metering weight, where the coefficient is a number greater than 1 when the metering weight of the image area is to be increased, and the coefficient is a number less than 1 when the metering weight of the image area is to be decreased.
Step S304, determining an adjusted brightness value of the first image according to the first current brightness value of the M regions and the corresponding modified metering weight, and the first current brightness and the corresponding preset metering weight of (N-M) regions excluding the M regions in the N regions.
Here, the step S304 may be implemented by a terminal for determining the adjusted brightness value of the first image according to the first current brightness value of the M regions and the corresponding modified metering weight, and the first current brightness of (N-M) regions of the N regions excluding the M regions and the corresponding preset metering weight.
In other embodiments, the adjusted luminance value of the first image may be obtained by multiplying and summing first current luminance values of the M regions by corresponding corrected photometric weights, multiplying and summing first current luminance values of (N-M) regions of the N regions excluding the M regions by corresponding preset photometric weights, and then adding the two summed values by dividing by N.
Step S305, determining an exposure parameter according to the adjusted brightness value, and taking a picture according to the exposure parameter.
Here, the step S305 of taking a picture with the adjusted brightness value as an exposure parameter may be implemented by a terminal.
In other embodiments, the step S305 may be implemented by the following steps:
step S3051, acquiring a target brightness value of a shot image;
step S3052, determining an exposure value index according to the target brightness value and the adjustment brightness value;
step S3053, photographing is carried out according to the exposure value determined by the exposure value index;
in the embodiment of steps S3051 to S3053, the target brightness value may be set by a manufacturer of the terminal when the terminal leaves a factory, or may be set by a user according to a shooting requirement of the user.
In a practical implementation, the exposure value index may be determined according to equation (1-1):
in the formula (1-1), index is an exposure value index, tar _ luma is a target luminance value, lg () is a common logarithmic function, and adj _ luma is an adjusted luminance value.
Each exposure value index corresponds to an exposure value, and the corresponding relation between the exposure index and the exposure value is stored in an exposure table, wherein the smaller the exposure index is, the smaller the corresponding exposure value is, and the shorter the exposure time is. In the embodiment of the invention, the brightness of the image is adjusted by modifying the photometric weights of different image areas, and then the exposure parameters are adjusted, so that overexposure or underexposure of the image can be avoided.
In a photographing method provided by an embodiment of the present invention, firstly, an acquired first image is divided into N regions, and N first current luminance values corresponding to the N regions are determined, where N is a natural number greater than 1; then, determining M areas meeting preset conditions according to the N first current brightness values, wherein M is a natural number greater than or equal to 1, and M < N; determining the corrected photometric weight of the M areas according to the preset photometric weight of the M areas; and determining an adjustment brightness value of the first image according to the first current brightness value of the M areas, the corresponding correction photometric weight and the first current brightness value of (N-M) areas except the M areas in the N areas and the corresponding preset photometric weight, and finally determining an exposure parameter according to the adjustment brightness value, and taking a picture according to the exposure parameter.
Based on the foregoing embodiment, an embodiment of the present invention further provides a photographing method applied to a terminal, where the terminal at least includes a camera, and fig. 4 is a schematic view of an implementation flow of another photographing method provided in the embodiment of the present invention, and as shown in fig. 4, the method includes the following steps:
in step S401, the terminal obtains an operation instruction for the user to start the camera application.
Here, in the present embodiment, the user may start the camera application in various ways, for example: the camera application can be started by clicking a camera application icon of the terminal, and can also be realized by pressing a touch operation area on the side of the terminal, namely, the terminal acquires an operation instruction of starting the camera application by a user, and the operation instruction comprises the following steps: the method comprises the steps of obtaining touch operation received by a preset touch operation area on the side edge of a terminal, and determining a control instruction corresponding to the touch operation; and when the control instruction is to start the camera application, starting the camera application. In addition, the camera application can be started through voice, gestures and the like. The above listed trigger modes for starting the camera application are only exemplary, and those skilled in the art can utilize the technical idea of the present invention, and other trigger modes for starting the camera application according to their specific requirements are within the protection scope of the present invention, and are not exhaustive here.
Step S402, the terminal starts a camera based on the operation instruction;
here, the camera may be a front camera or a rear camera. For example, each time the camera application is started, the rear camera may be started by default. Or may be a camera used when the camera application was last turned off.
And after the terminal starts the camera, entering a shooting preview interface of the terminal, and enabling a user to preview the image shot by the camera in the shooting preview interface. In the terminal, the camera may be a standard camera, a wide-angle camera, a telephoto camera, a black-and-white camera, and the like.
In other embodiments of the present invention, when the terminal includes a plurality of cameras, for example, there are two front cameras and two rear cameras, and the types of the two front cameras may be the same or different. For example, the two front cameras are both standard cameras, or one front camera is a standard camera and the other front camera is a black-and-white camera. Likewise, the two rear cameras may be of the same type or of different types. For example, both rear cameras are standard cameras, or one rear camera is a wide-angle camera and the other rear camera is a telephoto camera.
Step S403, the terminal divides the acquired first image into N regions, and determines N first current luminance values corresponding to the N regions.
Here, the first image is a preview image acquired after the camera application is started, and a schematic diagram of the preview image (first image) on the terminal interface is shown in fig. 5, and as can be seen from fig. 5, because the acquisition environment of the preview image is dark, the overall brightness of the preview image is relatively dark, and the face area 501 cannot be clearly distinguished.
Here, N is a natural number greater than 1, for example, N is 12, 8, 60, 16, 4, etc., and 9 is taken as an example for explanation, and in the case of equal division, that is, the first image is divided into 3 × 3 image regions. The value of N may be related to the shape of the terminal interface, and if the terminal interface is rectangular, N may be 12, 54, etc. Assume that the first current luminance values corresponding to the 9 regions are 50, 70, 45, 63, 95, 70, 52, 80, 60, respectively.
And S404, if the flash lamp state of the camera application is on, the terminal acquires a second image acquired when the flash lamp is pre-flashed according to a shooting instruction sent by a user.
Here, when the user turns on the flash, the flash applied by the camera is turned on, and after the user sends a shooting instruction, in the second image acquired when the flash is pre-flashed, as shown in fig. 6, an area 601 where a human face is located is high in brightness and easy to overexpose.
Step S405, the terminal divides the second image into N regions, and determines N second current luminance values corresponding to the N regions.
Here, the second image is also divided into 9 regions, and it is assumed that the second current luminance values corresponding to the 9 regions in the second image are 65, 85, 60, 75, 210, 90, 80, 100, 80, respectively.
In step S406, the terminal determines, as M regions that satisfy a preset condition, a region in which a ratio of the first current luminance value to the second current luminance value is greater than a fourth threshold value among the N regions.
Here, in the implementation process of step S406, a ratio of the second current luminance value to the first current luminance value of the N regions is first determined, and then the region with the ratio greater than the fourth threshold is determined as M regions meeting the preset condition.
In the embodiment of the present invention, the ratio of the second current luminance value to the first current luminance value of the 9 regions is 1.3, 1.2, 2.2, 1.3, 1.5, 1.3, and 1.3, respectively. Assuming that the fourth threshold is 1.8, one of the regions satisfying the preset condition in the embodiment of the present invention is the fifth region.
In step S407, the terminal determines a value obtained by multiplying the preset metering weight of the M regions by a fifth coefficient as a corrected metering weight of the M regions.
Here, each region corresponds to a metering weight, which is preset, and the metering manner is different, so that the preset metering weight corresponding to each region is also different, for example, in the embodiment of the present invention, a central averaging metering manner is adopted, so that the metering weight corresponding to a region closer to the center of an image is larger, and the metering weight corresponding to a region closer to the edge of the image is smaller, for example, in the embodiment of the present invention, the metering weights corresponding to 9 regions are 0.1, 0.2, 0.8, 0.1, 0.2, and 0.1, respectively.
The fifth coefficient is a preset value, and can be set in advance by a developer of the photographing method or set by a user according to the needs of the user. Assuming that the fifth coefficient is 1.5 in the embodiment of the present invention, the revised metering weight of the fifth region is 1.2.
In step S408, the terminal determines an adjusted brightness value of the second image according to the second current brightness value of the M regions and the corresponding modified metering weight, and the second current brightness of (N-M) regions excluding the M regions and the corresponding preset metering weight.
Here, since the flash function is on, the adjusted luminance value of the second image is determined when the luminance adjustment value is determined, and the weighted average determination is made in accordance with the second current luminance value and the metering weight.
And step S409, determining exposure parameters according to the adjusted brightness values, and taking pictures according to the exposure parameters.
In the embodiment of the invention, the exposure parameter is determined according to the adjusted brightness value, and the photographing is carried out according to the exposure parameter to obtain the third image. Fig. 7 is a schematic terminal diagram of a third image according to an embodiment of the present invention, and as shown in fig. 7, since the light metering weight of the bright block area 701 is increased, the brightness of the entire picture is increased, which can be known from the brightness formula (1-1), so that the exposure time is reduced, and the brightness of the entire picture is enhanced, so that the bright block area is not overexposed, and the background area is not too dark.
It should be noted that, for the explanation of the same steps or concepts in the present embodiment as in the other embodiments, reference may be made to the description in the other embodiments.
In the photographing method provided by the embodiment of the invention, firstly, a terminal starts a camera application according to an operation instruction of a user, controls a camera to acquire a first image, divides the acquired first image into N regions, determines N first current brightness values corresponding to the N regions, if a flash lamp state of the camera application is on, the terminal acquires a second image acquired during pre-flash of the flash lamp according to a shooting instruction sent by the user, divides the second image into N regions, determines N second current brightness values corresponding to the N regions, determines M regions meeting a preset condition according to a first current brightness value and a second current brightness value in the N regions, determines corrected metering weights of the M regions, and determines the second current brightness value and the corresponding corrected metering weights of the M regions and (N-M) regions except the M regions in the N regions according to the second current brightness value and the corresponding corrected metering weights of the M regions And determining the adjusted brightness value of the second image according to the second current brightness and the corresponding preset photometric weight, and finally taking the adjusted brightness value as an exposure parameter to take a picture, so that overexposure of a bright block area is avoided when the picture is taken under dark light and a flash lamp is turned on, and the quality of a shot picture is improved.
The embodiment of the invention further provides a photographing method which is applied to a terminal, wherein the terminal at least comprises a camera, and the photographing method provided by the embodiment of the invention comprises the following steps:
and step 11, the terminal acquires an operation instruction of starting the camera application by the user.
And step 12, the terminal starts a camera based on the operation instruction and controls the camera to acquire a first image.
And step 13, dividing the acquired first image into N areas by the terminal, and determining N first current brightness values corresponding to the N areas.
Wherein N is a natural number greater than 1.
And step 14, the terminal determines the average brightness value of the first image according to the N first current brightness values.
And step 15, the terminal judges whether the average brightness value of the first image is larger than a first threshold value.
Here, if the average luminance value of the first image is greater than a first threshold value, go to step 16; if the average brightness value of the first image is not greater than the first threshold, proceed to step
And step 16, the terminal determines the areas, corresponding to the N areas, of which the first current brightness values are smaller than the second threshold value, as M areas meeting preset conditions.
Here, if the average luminance value of the first image is greater than the first threshold value, the average luminance value of the first image needs to be decreased, and at this time, the region where the first current luminance value is less than the second threshold value may be determined as M regions satisfying the preset condition.
In an embodiment of the present invention, the second threshold is assumed to be 220.
And step 17, multiplying the preset photometric weight of the first area by a first coefficient to obtain a corrected photometric weight of the first area.
Here, the first region is a region in which a first current luminance value is smaller than a third threshold value among the M regions, and the first coefficient is larger than 1. The third threshold is smaller than the second threshold, and in the embodiment of the present invention, it is assumed that the third threshold is 200.
The first region, that is, the region of the M regions where the first current luminance value is less than 200, multiplies the preset metering weight for the region where the first current luminance value is less than 200 by a first coefficient, since the first coefficient is greater than 1, that is, the metering weight for the region where the first current luminance value is less than 200 is increased. In the embodiment of the present invention, it is assumed that the first coefficient is 2.
Step 18, determining a second coefficient according to the first current brightness value, the second threshold, the third threshold and the first coefficient of the second region.
Here, the second region is a region of the M regions excluding the first region, that is, the second region is a region where the first current luminance value is between the second threshold value and the third threshold value. The second coefficient is greater than 1 and the second coefficient is less than the first coefficient.
In the embodiment of the present invention, in the area where the first current luminance value is greater than or equal to the second threshold, the metering weight is not changed, that is, the modified metering weight of the area where the first current luminance value is greater than or equal to the second threshold is obtained by multiplying the preset metering weight by the coefficient 1, and in order to make the change amplitude of the metering weight of the second area relatively smooth, the second coefficient of each area in the second area is determined by performing a linear difference according to the own second current luminance value, second threshold, third threshold, and first coefficient.
In this step, the second threshold value is 220, the coefficient corresponding to the second threshold value 220 is 1, the third threshold value is 200, and the first coefficient corresponding to the third threshold value 200 is 2, so that for the region with the first current brightness value 210, the second coefficient isFor the first region with a current luminance value of 215, its second coefficient is
And step 19, multiplying the preset photometric weight of the second area by a second coefficient to obtain a modified photometric weight of the second area.
In step 110, the terminal determines whether the average brightness value of the first image is smaller than a fifth threshold.
Here, if the average brightness value of the first image is less than a fifth threshold value, go to step 111; and if the average brightness value of the first image is not less than a fifth threshold value, responding to a shooting instruction of a user to take a picture.
And step 111, the terminal determines the area, of the N areas, in which the first current brightness value is greater than the third threshold, as M areas meeting preset conditions.
Here, if the average luminance value of the first image is smaller than the fifth threshold, it indicates that the luminance of the first image is too dark, and the average luminance of the first image needs to be increased, and at this time, the metering weight of the area with the higher first current luminance value needs to be increased. Therefore, the region of the N regions in which the first current luminance value is greater than the third threshold is determined as M regions satisfying a preset condition.
And 112, multiplying the preset metering weight of the third area by a third coefficient to obtain a corrected metering weight of the first area.
Here, the third region is a region in which the first current luminance value is greater than a second threshold value among the M regions, and the third coefficient is greater than 1.
That is, the first region is a region of the M regions in which the first current luminance value is greater than 220, and the third coefficient is 2, that is, the metering weight of each region in the third region is increased by one time.
Step 113, determining a fourth coefficient according to the first current brightness value, the second threshold, the third threshold and the third coefficient of the fourth area.
Here, the fourth region is a region of the M regions excluding the third region, that is, a region where the first current luminance value is greater than the third threshold value and less than the second threshold value, and the fourth coefficient is greater than 1 and less than the third coefficient.
Also, in order to make the magnitude of change in the photometric weight of the fourth region relatively smooth, the fourth coefficient of each region in the fourth region is determined by a linear difference based on its own second current luminance value, second threshold value, third threshold value, and third coefficient.
In this step, the second threshold value is 220, the third coefficient corresponding to the second threshold value 220 is 2, the third threshold value is 200, and the coefficient corresponding to the third threshold value 200 is 1, so that for the region with the first current brightness value 210, the fourth coefficient isFor the first region with a current luminance value of 215, its fourth coefficient is
Step 114, multiplying the preset metering weight of the fourth area by a fourth coefficient to obtain a modified metering weight of the fourth area.
Step 115, determining an adjusted brightness value of the first image according to the first current brightness value of the M regions and the corresponding modified metering weight, and the first current brightness values of (N-M) regions excluding the M regions and the corresponding preset metering weight.
And step 116, determining an exposure parameter according to the adjusted brightness value, and taking a picture according to the exposure parameter.
It should be noted that, for the explanation of the same steps or concepts in the present embodiment as in the other embodiments, reference may be made to the description in the other embodiments.
In the photographing method provided by the embodiment of the invention, firstly, a terminal starts a camera application according to an operation instruction of a user, controls a camera to acquire a first image, then divides the acquired first image into N regions, determines N first current brightness values corresponding to the N regions, then determines an average brightness value of the first image, and if the average brightness value of the first image is greater than a first threshold value, adjusts the light metering weight of a region with lower brightness in the first image so as to reduce the average brightness value of the first image and obtain an adjusted brightness value; if the average brightness value of the first image is smaller than the fifth threshold, the light metering weight value of the area with higher brightness of the first image is adjusted to improve the average brightness value of the first image to obtain an adjusted brightness value, finally, the exposure parameter is determined according to the adjusted brightness value, and the image is photographed according to the exposure parameter, so that the brightness of the image can be dynamically adjusted, overexposure or underexposure can be prevented, and the quality of the photographed image is improved.
Fig. 8 is a schematic view of a structure of a terminal according to an embodiment of the present invention, and as shown in fig. 8, the terminal 800 at least includes: processor 801, memory 802, communication bus 803 and camera 804, wherein:
the processor 801 is configured to execute an image brightness adjustment program stored in the memory, so as to implement the following steps:
dividing the acquired first image into N areas, and determining N first current brightness values corresponding to the N areas, wherein N is a natural number greater than 1;
determining M areas meeting preset conditions according to the N first current brightness values, wherein M is a natural number greater than or equal to 1, and M < N;
determining the corrected photometric weight of the M areas according to the preset photometric weight of the M areas;
determining an adjusted brightness value of the first image according to the first current brightness value and the corresponding modified metering weight of the M areas and the first current brightness and the corresponding preset metering weight of (N-M) areas except the M areas in the N areas;
and determining an exposure parameter according to the adjusted brightness value, and taking a picture according to the exposure parameter.
In other embodiments, the determining, according to the N first current luminance values, M regions that satisfy a preset condition includes:
determining an average brightness value of the first image according to the N first current brightness values;
if the average brightness value of the first image is larger than a first threshold value, determining the areas, corresponding to the N areas, of which the current brightness values are smaller than a second threshold value, as M areas meeting preset conditions;
and if the average brightness value of the first image is smaller than or equal to a first threshold value, determining the area of the N areas, of which the first current brightness value is larger than a third threshold value, as M areas meeting a preset condition, wherein the third threshold value is smaller than the second threshold value.
In other embodiments, the determining the modified metering weights for the M regions according to the preset metering weights for the M regions includes:
multiplying a preset photometric weight of a first area by a first coefficient to obtain a modified photometric weight of the first area, wherein the first area is an area of the M areas, a first current brightness value of which is smaller than a third threshold value, and the first coefficient is larger than 1;
determining a second coefficient according to a first current brightness value, a second threshold, a third threshold and a first coefficient of a second region, wherein the second region is a region except the first region in the M regions, and the second coefficient is greater than 1 and smaller than the first coefficient;
and multiplying the preset photometric weight of the second area by a second coefficient to obtain a corrected photometric weight of the second area.
In other embodiments, the determining the modified metering weights for the M regions according to the preset metering weights for the M regions includes:
multiplying a preset photometric weight of a third area by a third coefficient to obtain a modified photometric weight of the third area, wherein the third area is an area of the M areas, a first current brightness value of which is greater than a second threshold value, and the third coefficient is greater than 1;
determining a fourth coefficient according to a first current brightness value, a second threshold, a third threshold and a third coefficient of a fourth region, wherein the fourth region is a region except the third region in the M regions, and the fourth coefficient is greater than 1 and smaller than the third coefficient;
and multiplying the preset photometric weight of the fourth area by a fourth coefficient to obtain a corrected photometric weight of the fourth area.
In other embodiments, the determining, according to the N first current luminance values, M regions that satisfy a preset condition includes:
if the flash lamp applied by the camera is in an open state, acquiring a second image acquired during pre-flashing of the flash lamp according to a shooting instruction sent by a user;
dividing the second image into N areas, and determining N second current brightness values corresponding to the N areas;
and determining the area of which the ratio of the first current brightness value to the second current brightness value is greater than a fourth threshold value in the N areas as M areas meeting preset conditions.
In other embodiments, determining the modified metering weights for the M regions according to the preset metering weights for the M regions includes:
and determining a numerical value obtained by multiplying the preset photometric weight of the M areas by a third coefficient as the corrected photometric weight of the M areas.
The memory 802 is used for storing an image brightness adjusting program;
the communication bus 803 is used for realizing connection communication between the processor and the memory;
the camera 804 is used for collecting images.
An embodiment of the present invention provides a computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of:
dividing the acquired first image into N areas, and determining N first current brightness values corresponding to the N areas, wherein N is a natural number greater than 1;
determining M areas meeting preset conditions according to the N first current brightness values, wherein M is a natural number greater than or equal to 1, and M < N;
determining the corrected photometric weight of the M areas according to the preset photometric weight of the M areas;
determining an adjusted brightness value of the first image according to the first current brightness value and the corresponding modified metering weight of the M areas and the first current brightness and the corresponding preset metering weight of (N-M) areas except the M areas in the N areas;
and determining an exposure parameter according to the adjusted brightness value, and taking a picture according to the exposure parameter.
It should be noted that one or more programs in the embodiment of the present invention may be a photographing program used when photographing is performed.
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 device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method described in the embodiments of the present invention.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A method of taking a picture, the method comprising:
dividing an acquired first image into N areas, and determining N first current brightness values corresponding to the N areas, wherein N is a natural number greater than 1, and the first current brightness value is a current brightness average value of one image area;
determining M areas meeting preset conditions according to the N first current brightness values, wherein M is a natural number greater than or equal to 1, and M < N;
determining the corrected photometric weight of the M areas according to the preset photometric weight of the M areas;
determining an adjusted brightness value of the first image according to the first current brightness value and the corresponding modified metering weight of the M areas and the first current brightness and the corresponding preset metering weight of (N-M) areas except the M areas in the N areas;
and determining an exposure parameter according to the adjusted brightness value, and taking a picture according to the exposure parameter.
2. The method according to claim 1, wherein said determining M regions satisfying a preset condition based on said N first current luminance values comprises:
determining an average brightness value of the first image according to the N first current brightness values;
if the average brightness value of the first image is larger than a first threshold value, determining the areas, corresponding to the N areas, of which the current brightness values are smaller than a second threshold value, as M areas meeting preset conditions;
if the average brightness value of the first image is smaller than a fifth threshold value, determining the area, of the N areas, of which the first current brightness value is larger than a third threshold value, as M areas meeting a preset condition, where the third threshold value is smaller than the second threshold value, and the fifth threshold value is smaller than the first threshold value.
3. The method as claimed in claim 2, wherein the determining the modified metering weights for the M zones according to the preset metering weights for the M zones comprises:
multiplying a preset photometric weight of a first area by a first coefficient to obtain a modified photometric weight of the first area, wherein the first area is an area of the M areas, a first current brightness value of which is smaller than a third threshold value, and the first coefficient is larger than 1;
determining a second coefficient according to a first current brightness value, a second threshold, a third threshold and a first coefficient of a second region, wherein the second region is a region except the first region in the M regions, and the second coefficient is greater than 1 and smaller than the first coefficient;
and multiplying the preset photometric weight of the second area by a second coefficient to obtain a corrected photometric weight of the second area.
4. The method as claimed in claim 2, wherein the determining the modified metering weights for the M zones according to the preset metering weights for the M zones comprises:
multiplying a preset photometric weight of a third area by a third coefficient to obtain a modified photometric weight of the third area, wherein the third area is an area of the M areas, a first current brightness value of which is greater than a second threshold value, and the third coefficient is greater than 1;
determining a fourth coefficient according to a first current brightness value, a second threshold, a third threshold and a third coefficient of a fourth region, wherein the fourth region is a region except the third region in the M regions, and the fourth coefficient is greater than 1 and smaller than the third coefficient;
and multiplying the preset photometric weight of the fourth area by a fourth coefficient to obtain a corrected photometric weight of the fourth area.
5. The method according to claim 1, wherein said determining M regions satisfying a preset condition based on said N first current luminance values comprises:
if the flash lamp applied by the camera is in an open state, acquiring a second image acquired during pre-flashing of the flash lamp according to a shooting instruction sent by a user;
dividing the second image into N areas, and determining N second current brightness values corresponding to the N areas;
and determining the area of the N areas, wherein the ratio of the second current brightness value to the first current brightness value is greater than a fourth threshold value, as M areas meeting preset conditions.
6. The method of claim 5, wherein determining the modified metering weights for the M zones based on the preset metering weights for the M zones comprises:
and determining a numerical value obtained by multiplying the preset metering weight of the M areas by a fifth coefficient as the corrected metering weight of the M areas.
7. A terminal, characterized in that the terminal comprises at least: camera, treater, memory and communication bus, wherein:
the camera is used for collecting images;
the communication bus is used for realizing connection communication between the processor and the memory;
the memory is used for storing an image brightness adjusting program;
the processor is used for executing the image brightness adjusting program stored in the memory so as to realize the following steps:
dividing an acquired first image into N areas, and determining N first current brightness values corresponding to the N areas, wherein N is a natural number greater than 1, and the first current brightness value is a current brightness average value of one image area;
determining M areas meeting preset conditions according to the N first current brightness values, wherein M is a natural number greater than or equal to 1, and M < N;
determining the corrected photometric weight of the M areas according to the preset photometric weight of the M areas;
determining an adjusted brightness value of the first image according to the first current brightness value and the corresponding modified metering weight of the M areas and the first current brightness and the corresponding preset metering weight of (N-M) areas except the M areas in the N areas;
and determining an exposure parameter according to the adjusted brightness value, and taking a picture according to the exposure parameter.
8. The terminal according to claim 7, wherein said determining M regions satisfying a preset condition according to said N first current luminance values comprises:
determining an average brightness value of the first image according to the N first current brightness values;
if the average brightness value of the first image is larger than a first threshold value, determining the areas, corresponding to the N areas, of which the current brightness values are smaller than a second threshold value, as M areas meeting preset conditions;
and if the average brightness value of the first image is smaller than or equal to a first threshold value, determining the area of the N areas, of which the first current brightness value is larger than a third threshold value, as M areas meeting a preset condition, wherein the third threshold value is smaller than the second threshold value.
9. The terminal of claim 7, wherein said determining modified metering weights for the M zones based on the preset metering weights for the M zones comprises:
multiplying a preset photometric weight of a first area by a first coefficient to obtain a modified photometric weight of the first area, wherein the first area is an area of the M areas, a first current brightness value of which is smaller than a third threshold value, and the first coefficient is larger than 1;
determining a second coefficient according to a first current brightness value, a second threshold, a third threshold and a first coefficient of a second region, wherein the second region is a region except the first region in the M regions, and the second coefficient is greater than 1 and smaller than the first coefficient;
and multiplying the preset photometric weight of the second area by a second coefficient to obtain a corrected photometric weight of the second area.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a photographing program which, when executed by a processor, implements the steps of the photographing method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710643860.0A CN107438163B (en) | 2017-07-31 | 2017-07-31 | Photographing method, terminal and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710643860.0A CN107438163B (en) | 2017-07-31 | 2017-07-31 | Photographing method, terminal and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107438163A CN107438163A (en) | 2017-12-05 |
CN107438163B true CN107438163B (en) | 2020-07-07 |
Family
ID=60460402
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710643860.0A Active CN107438163B (en) | 2017-07-31 | 2017-07-31 | Photographing method, terminal and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107438163B (en) |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108335301B (en) * | 2017-12-26 | 2022-01-14 | 努比亚技术有限公司 | Photographing method and mobile terminal |
CN108200352B (en) * | 2017-12-27 | 2021-03-05 | 上海营湾医疗科技有限公司 | Method, terminal and storage medium for adjusting picture brightness |
CN110149550B (en) * | 2018-06-19 | 2022-02-11 | 腾讯科技(深圳)有限公司 | Image data processing method and device and storage medium |
WO2020019266A1 (en) * | 2018-07-26 | 2020-01-30 | 华为技术有限公司 | Image processing method and device |
CN109359572A (en) * | 2018-09-30 | 2019-02-19 | 联想(北京)有限公司 | Information processing method, device and electronic equipment |
CN111031255B (en) * | 2018-10-09 | 2021-07-27 | 科沃斯机器人股份有限公司 | Method, device and storage medium for light supplement |
CN110070009A (en) * | 2019-04-08 | 2019-07-30 | 北京百度网讯科技有限公司 | Road surface object identification method and device |
CN110248141B (en) * | 2019-06-10 | 2021-06-04 | 广州视源电子科技股份有限公司 | Video image brightness adjusting method, device, equipment and readable storage medium |
CN110248108B (en) * | 2019-06-14 | 2020-11-06 | 浙江大华技术股份有限公司 | Exposure adjustment and dynamic range determination method under wide dynamic state and related device |
CN110545375B (en) * | 2019-08-08 | 2021-03-02 | RealMe重庆移动通信有限公司 | Image processing method, image processing device, storage medium and electronic equipment |
CN110913123B (en) * | 2019-08-15 | 2021-06-04 | 厦门亿联网络技术股份有限公司 | Anti-backlight automatic exposure method and device based on image blocking filtering and electronic equipment |
CN111225162B (en) * | 2020-01-21 | 2021-08-03 | 厦门亿联网络技术股份有限公司 | Image exposure control method, system, readable storage medium and camera equipment |
CN111263078B (en) * | 2020-02-04 | 2021-11-05 | 浙江大华技术股份有限公司 | Method and device for determining image pickup mode, storage medium and electronic device |
CN112312036A (en) * | 2020-10-30 | 2021-02-02 | 天津天地伟业智能安全防范科技有限公司 | Automatic exposure method in photographing field |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101064783A (en) * | 2006-04-30 | 2007-10-31 | 华为技术有限公司 | Method for obtaining automatic exposure control parameter and control method and image forming apparatus |
CN104580925A (en) * | 2014-12-31 | 2015-04-29 | 安科智慧城市技术(中国)有限公司 | Image brightness controlling method, device and camera |
CN105323496A (en) * | 2015-02-13 | 2016-02-10 | 维沃移动通信有限公司 | Automatic exposure method, photographing device and mobile terminal |
CN106791472A (en) * | 2016-12-29 | 2017-05-31 | 努比亚技术有限公司 | A kind of exposure method and terminal |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5513325B2 (en) * | 2010-09-01 | 2014-06-04 | キヤノン株式会社 | Determination method, exposure method and program |
-
2017
- 2017-07-31 CN CN201710643860.0A patent/CN107438163B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101064783A (en) * | 2006-04-30 | 2007-10-31 | 华为技术有限公司 | Method for obtaining automatic exposure control parameter and control method and image forming apparatus |
CN104580925A (en) * | 2014-12-31 | 2015-04-29 | 安科智慧城市技术(中国)有限公司 | Image brightness controlling method, device and camera |
CN105323496A (en) * | 2015-02-13 | 2016-02-10 | 维沃移动通信有限公司 | Automatic exposure method, photographing device and mobile terminal |
CN106791472A (en) * | 2016-12-29 | 2017-05-31 | 努比亚技术有限公司 | A kind of exposure method and terminal |
Also Published As
Publication number | Publication date |
---|---|
CN107438163A (en) | 2017-12-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107438163B (en) | Photographing method, terminal and computer readable storage medium | |
CN107302663B (en) | Image brightness adjusting method, terminal and computer readable storage medium | |
CN108307125B (en) | Image acquisition method, device and storage medium | |
CN107566752B (en) | Shooting method, terminal and computer storage medium | |
CN107451979B (en) | Image processing method, device and storage medium | |
CN108848294B (en) | Shooting parameter adjusting method, terminal and computer readable storage medium | |
CN108200352B (en) | Method, terminal and storage medium for adjusting picture brightness | |
CN107038715B (en) | Image processing method and device | |
CN107959839B (en) | A kind of method of blank level adjustment, terminal and computer readable storage medium | |
CN108419008B (en) | Shooting method, terminal and computer readable storage medium | |
CN109348137B (en) | Mobile terminal photographing control method and device, mobile terminal and storage medium | |
CN107995437B (en) | Photo shooting and lighting method and mobile terminal | |
CN107040723B (en) | Imaging method based on double cameras, mobile terminal and storage medium | |
CN108184105B (en) | Method and device for adjusting brightness and computer readable storage medium | |
CN108200421B (en) | White balance processing method, terminal and computer readable storage medium | |
CN107240072B (en) | Screen brightness adjusting method, terminal and computer readable storage medium | |
CN107705247B (en) | Image saturation adjusting method, terminal and storage medium | |
CN108093233B (en) | Image processing method, terminal and computer readable storage medium | |
CN111899695A (en) | Backlight adjusting method, terminal device and readable storage medium | |
CN108234893B (en) | Brightness adjusting method, brightness adjusting equipment and computer readable storage medium | |
CN110177207B (en) | Backlight image shooting method, mobile terminal and computer readable storage medium | |
CN108848321B (en) | Exposure optimization method, device and computer-readable storage medium | |
CN109510941B (en) | Shooting processing method and device and computer readable storage medium | |
CN115514876B (en) | Image fusion method, electronic device, storage medium and computer program product | |
CN112449112B (en) | Camera white balance adjusting method, mobile 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 |