CN109727212B - Image processing method and mobile terminal - Google Patents

Image processing method and mobile terminal Download PDF

Info

Publication number
CN109727212B
CN109727212B CN201811584360.5A CN201811584360A CN109727212B CN 109727212 B CN109727212 B CN 109727212B CN 201811584360 A CN201811584360 A CN 201811584360A CN 109727212 B CN109727212 B CN 109727212B
Authority
CN
China
Prior art keywords
brightness
preset threshold
difference value
face region
value
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
CN201811584360.5A
Other languages
Chinese (zh)
Other versions
CN109727212A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201811584360.5A priority Critical patent/CN109727212B/en
Publication of CN109727212A publication Critical patent/CN109727212A/en
Application granted granted Critical
Publication of CN109727212B publication Critical patent/CN109727212B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the invention provides an image processing method and a mobile terminal, wherein the method is applied to the mobile terminal and comprises the following steps: identifying a face region of a target image, and calculating a brightness difference value of the face region, wherein the brightness difference value is a difference value between the brightness of a first part and the brightness of a second part of the face region, the first part is the brightest part in the face region, and the second part is the darkest part in the face region; and if the brightness difference value is not within a first preset threshold range, adjusting the brightness and the contrast of the face area according to the brightness difference value and the first preset threshold range. According to the technical scheme, the brightness and the contrast of the face area can be independently adjusted, and the light and shade relation of other areas in the target image can not be influenced completely, so that the brightness of the face area can be adjusted and the contrast can be improved.

Description

Image processing method and mobile terminal
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to an image processing method and a mobile terminal.
Background
With the rise of the self-timer industry, in order to obtain a better self-timer effect, an isp (image signal processor) needs to perform relatively large adjustment on color, brightness and the like, for example, an ideal self-timer skin color requires white and bright skin color, has strong contrast and has a certain stereo.
At present, the effect of mobile phone self-shooting is basically to control the brightness and contrast of the whole picture through gamma correction or brighten the whole picture through ae exposure compensation, the prior art cannot adjust the brightness or contrast of local areas such as faces or skin color sections, and the whole adjustment may cause background distortion and is difficult to maintain the stereo and contrast of skin colors while improving the brightness.
Disclosure of Invention
The embodiment of the invention provides an image processing method and a mobile terminal, which aim to improve the contrast while adjusting the brightness of a face area.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides an image processing method applied to a mobile terminal, where the method includes: identifying a face region of a target image, and calculating a brightness difference value of the face region, wherein the brightness difference value is a difference value between the brightness of a first part and the brightness of a second part of the face region, the first part is the brightest part in the face region, and the second part is the darkest part in the face region; and if the brightness difference value is not within a first preset threshold range, adjusting the brightness and the contrast of the face area according to the brightness difference value and the first preset threshold range.
In a second aspect, an embodiment of the present invention provides a mobile terminal, where the mobile terminal includes: a recognition calculation module configured to recognize a face region of a target image, calculate a brightness difference value of the face region, the brightness difference value being a difference value between brightness of a first portion and brightness of a second portion of the face region, the first portion being a brightest portion of the face region, the second portion being a darkest portion of the face region; and the first adjusting module is configured to adjust the brightness and the contrast of the face region according to the brightness difference value and a first preset threshold range if the brightness difference value is not within the first preset threshold range.
In a third aspect, an embodiment of the present invention provides a mobile terminal, including a processor, a memory, and a computer program stored on the memory and operable on the processor, where the computer program, when executed by the processor, implements the steps of the image processing method in the embodiment of the present invention.
In a fourth aspect, the embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the image processing method described in the embodiment of the present invention.
In the embodiment of the invention, the face area in the target image is firstly identified, and when the brightness difference value of the face area is not within the first preset threshold range, the brightness and the contrast of the face area can be independently adjusted according to the brightness difference value and the first preset threshold range, and the brightness and the contrast of other areas in the target image can not be influenced, so that the brightness of the face area can be adjusted and the contrast can be improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings.
In the drawings:
fig. 1 is a flowchart illustrating steps of an image processing method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating steps of an image processing method according to a second embodiment of the present disclosure;
fig. 3 is a block diagram of a mobile terminal according to a third embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware structure of a mobile terminal according to a fourth embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Referring to fig. 1, a flowchart illustrating steps of an image processing method according to a first embodiment of the present invention is shown.
The image processing method of the embodiment of the invention comprises the following steps:
step 101: the method comprises the steps of recognizing a face area of a target image, and calculating a brightness difference value of the face area, wherein the brightness difference value is the difference value between the brightness of a first part and the brightness of a second part of the face area, the first part is the brightest part in the face area, and the second part is the darkest part in the face area.
The target image may be an image stored on the mobile terminal, or an original image captured by a camera (such as a front-facing camera) of the mobile terminal, or an image obtained by performing basic adjustment on brightness or contrast of the original image through an isp (image signal processor) end.
For example, a skin color segmentation algorithm, an outline algorithm, and the like may be used to determine the face region in the target image.
The luminance of the first portion may be a maximum luminance value in the face region, and the luminance of the second portion may be a minimum luminance value in the face region, that is, a luminance difference value may be calculated by calculating a difference value between the maximum luminance value and the minimum luminance value in the face region. The difference in brightness may be different for different images. The brightness difference value can be used for representing the contrast size of the face area.
Step 102: and if the brightness difference value is not within the first preset threshold range, adjusting the brightness and the contrast of the face area according to the brightness difference value and the first preset threshold range.
When the brightness difference value is within the first preset threshold range, the contrast of the face region meets the requirement, and the brightness and the contrast of the face region can not be adjusted; when the brightness difference value is out of the first preset threshold range, the contrast of the face region is not satisfied, and the brightness and the contrast of the face region can be adjusted according to the brightness difference value and the first preset threshold range, so that the brightness, the contrast and other bright-dark relations of the face region satisfy the requirements. The specific adjustment method may be gamma correction, for example. The first preset threshold range may be specifically determined according to a contrast range that needs to be satisfied by the face region.
The image processing method provided by the embodiment of the invention firstly identifies the face area in the target image, and when the brightness difference value of the face area is not within the first preset threshold range, the brightness and the contrast of the face area can be independently adjusted according to the brightness difference value and the first preset threshold range, and the brightness and the contrast of other areas in the target image can not be influenced completely, so that the brightness adjustment of the face area can be realized, and the contrast can be improved.
Example two
Referring to fig. 2, a flowchart illustrating steps of an image processing method according to a second embodiment of the present invention is shown.
The image processing method of the embodiment of the invention specifically comprises the following steps:
step 201: and determining the area of which the chroma meets a second preset threshold and the brightness meets a third preset threshold in the target image as the target area.
Taking the application in self-timer facial beautification as an example, the step can adopt a skin color segmentation algorithm to determine a target area such as a skin color area. Among them, the main difference of skin color is gray scale information (luminance information) and chrominance information. Establishing a chromaticity distribution function representing skin color by sampling the skin color in a proper color space, and determining a second preset threshold value for distinguishing the skin color from non-skin color; and a brightness distribution function representing skin color can be established, and a third preset threshold value for distinguishing skin color from non-skin color is determined. According to whether the chroma meets a second preset threshold value and whether the brightness meets a third preset threshold value, the skin color and the non-skin color can be distinguished.
In practical applications, the second preset threshold and the third preset threshold may be determined according to actual situations.
Step 202: and processing the target area to determine the face area.
After the skin color area is segmented by adopting modes such as color space and the like, the skin color area is determined as a target area, then mathematical morphology and connected area processing can be carried out on the segmented binary image, for example, five sense organs are firstly positioned by adopting an outline algorithm and the like, and then the face area can be determined by reverse selection, so that the initial positioning of the face area can be realized.
Step 203: and calculating a brightness difference value of the face area, wherein the brightness difference value is the difference value between the brightness of a first part and the brightness of a second part of the face area, the first part is the brightest part in the face area, and the second part is the darkest part in the face area.
Step 203 in this embodiment is the same as or similar to step 101 in the previous embodiment, and is not described herein again. The present embodiment focuses on the differences from the previous embodiment.
Step 204: and if the brightness difference value is not within the first preset threshold range, adjusting the brightness and the contrast of the face area according to the brightness difference value and the first preset threshold range.
According to the empirical design principle and the algorithm implementation principle, after all the processes of the ISP end are finished, the skin color area is identified through the skin color segmentation algorithm and is further positioned to the face area, when the brightness difference value of the face area is not within the range of the first preset threshold value, the brightness and the contrast of the face area can be independently adjusted by means of gamma correction and other tools, and the picture is output after the ideal state is achieved.
In one implementation, this step 204 may include:
step 301: a first difference between the luminance difference value and a center value of the first preset threshold range is calculated.
When the brightness difference value is larger than the maximum value in the first preset threshold range, the contrast in the face region is higher; and when the brightness difference value is smaller than the minimum value in the first preset threshold range, the contrast in the face region is low. And calculating the difference between the brightness difference and the central value of the first preset threshold range to obtain a first difference. The magnitude of the first difference can be used to characterize the degree to which the contrast needs to be adjusted.
The central value of the first preset threshold range is a median between a maximum value and a minimum value within the first preset threshold range, for example, when the first preset threshold range is-10 to 10, the central value of the first preset threshold range is 0.
Step 302: and adjusting the brightness of the face area according to the first difference value to enable the adjusted brightness difference value to be within a first preset threshold range.
And adjusting the brightness in the face area according to the first difference value, so as to adjust the part with the contrast ratio higher or lower than the first preset threshold range, and enable the adjusted brightness difference value to be within the first preset threshold range. For example, when the contrast ratio is low, the brightness higher than the designated brightness may be adjusted to be high, and the brightness lower than the designated brightness may be adjusted to be low, so as to improve the contrast ratio, wherein the designated brightness may be determined according to the actual situation.
The image processing method provided by each of the above embodiments may further include:
step 401: an average value between the luminance of the first portion and the luminance of the second portion is calculated.
Specifically, the luminance of the first portion may be a maximum luminance value in the face region, and the luminance of the second portion may be a minimum luminance value in the face region, that is, an average value of the maximum luminance value and the minimum luminance value in the face region is calculated. The average values may be different for different images. The average value can be used to characterize the brightness of the face region.
Step 402: and if the average value is not within the fourth preset threshold range, calculating a second difference value between the average value and the central value of the fourth preset threshold range.
When the average value is within the range of the fourth preset threshold value, the brightness of the face area is indicated to meet the requirement, and the brightness of the face area can not be adjusted; when the average value is out of the fourth preset threshold range, it indicates that the brightness level of the face region does not meet the requirement, a difference between the average value and a central value of the fourth preset threshold range may be calculated to obtain a second difference, and then the process proceeds to step 403. The fourth preset threshold range may be specifically determined according to the average brightness or the brightness degree that the face area needs to satisfy. The center value of the fourth preset threshold range is the middle value between the maximum value and the minimum value in the fourth preset threshold range, for example, when the fourth preset threshold range is 100-200, the center value of the first preset threshold range is 150.
When the average value is larger than the maximum value in the fourth preset threshold range, the face area is relatively bright; and when the average value is smaller than the minimum value in the fourth preset threshold range, the human face area is dark. The magnitude of the second difference can be used to characterize the degree of shading adjustment required.
Step 403: and adjusting the brightness of the face area according to the second difference value, so that the adjusted average value is within a fourth preset threshold range.
And integrally increasing or decreasing the brightness of the face area according to the second difference value, so that the adjusted average value is within a fourth preset threshold range.
The image processing method provided by the embodiment is based on the mode of intelligently adjusting the light and shade relation of skin color through a skin color segmentation algorithm, a human face skin color area is positioned after the skin color is segmented, and then the brightness, the contrast and the like of the human face skin color area are independently adjusted through gamma correction, so that not only can the skin color be improved, but also the face stereo degree can be increased, and the light and shade relation of clothes, background and the like can not be influenced; the problem that the brightness and the contrast are difficult to take into account in the optimization of the previous photographing effect can be efficiently solved, a large amount of data accumulation and machine learning are not needed, the implementation is easy, and the running efficiency is high.
EXAMPLE III
Referring to fig. 3, a block diagram of a mobile terminal according to a third embodiment of the present invention is shown.
The mobile terminal of the embodiment of the invention can comprise: a recognition calculation module 301 configured to recognize a face region of the target image, calculate a luminance difference of the face region, where the luminance difference is a difference between luminance of a first portion and luminance of a second portion of the face region, the first portion being a brightest portion of the face region, and the second portion being a darkest portion of the face region; and a first adjusting module 302 configured to adjust the brightness and the contrast of the face region according to the brightness difference value and the first preset threshold range if the brightness difference value is not within the first preset threshold range.
The target image may be an image stored on the mobile terminal, or an original image captured by a camera (such as a front-facing camera) of the mobile terminal, or an image obtained by performing basic adjustment on brightness or contrast of the original image through an isp (image signal processor). The recognition calculation module 301 may determine a face region in the target image by using a skin color segmentation algorithm, an outline algorithm, or the like, for example.
The luminance of the first portion may be a maximum luminance value in the face region, and the luminance of the second portion may be a minimum luminance value in the face region, that is, a luminance difference value may be calculated by calculating a difference value between the maximum luminance value and the minimum luminance value in the face region. The difference in brightness may be different for different images. The brightness difference value can be used for representing the contrast size of the face area.
When the brightness difference value is within the first preset threshold range, the contrast of the face region meets the requirement, and the brightness and the contrast of the face region can not be adjusted; when the brightness difference is outside the first preset threshold range, it indicates that the contrast of the face region does not meet the requirement, and the first adjusting module 302 may adjust the brightness and the contrast of the face region according to the brightness difference and the first preset threshold range, so that the brightness and the contrast of the face region meet the requirement. The specific brightness adjustment method may be gamma correction, for example. The first preset threshold range may be specifically determined according to a contrast range that needs to be satisfied by the face region.
Specifically, the recognition calculation module 301 includes: a first identification unit configured to determine an area in the target image, in which the chromaticity meets a second preset threshold and the brightness meets a third preset threshold, as a target area; and the second identification unit is configured to process the target area and determine the face area.
In one implementation, the first adjusting module 302 includes:
a calculation unit configured to calculate a first difference value between the luminance difference value and a center value of the first preset threshold range;
and the adjusting unit is configured to adjust the brightness of the face region according to the first difference value, so that the adjusted brightness difference value is within the first preset threshold range.
In another embodiment, the mobile terminal may further include:
a first calculation module 303 configured to calculate an average value between the luminance of the first portion and the luminance of the second portion;
a second calculating module 304, configured to calculate a second difference between the average value and a central value of a fourth preset threshold range if the average value is not within the fourth preset threshold range;
a second adjusting module 305, configured to adjust the brightness of the face region according to the second difference value, so that the adjusted average value is within the fourth preset threshold range.
The mobile terminal provided by the embodiment of the invention can realize each process in the image processing method embodiment, and is not described again to avoid repetition.
The mobile terminal provided by the embodiment of the invention firstly identifies the face area in the target image, and when the brightness difference value of the face area is not within the first preset threshold range, the brightness and the contrast of the face area can be independently adjusted according to the brightness difference value and the first preset threshold range, and the brightness and the contrast of other areas in the target image can not be influenced completely, so that the brightness adjustment of the face area can be realized, and the contrast can be improved.
Example four
Referring to fig. 4, a hardware structure diagram of a mobile terminal according to a fourth embodiment of the present invention is shown.
Fig. 4 is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, where the mobile terminal 400 includes, but is not limited to: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, processor 410, and power supply 411. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 4 is not intended to be limiting of mobile terminals, and that a mobile terminal may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the mobile terminal includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
A processor 410, configured to identify a face region of a target image, and calculate a brightness difference of the face region, where the brightness difference is a difference between brightness of a first part and brightness of a second part of the face region, the first part being a brightest part in the face region, and the second part being a darkest part in the face region; and if the brightness difference value is not within the first preset threshold range, adjusting the brightness and the contrast of the face area according to the brightness difference value and the first preset threshold range.
The mobile terminal provided by the embodiment of the invention firstly identifies the face area in the target image, and when the brightness difference value of the face area is not within the first preset threshold range, the brightness and the contrast of the face area can be independently adjusted according to the brightness difference value and the first preset threshold range, and the brightness and the contrast of other areas in the target image can not be influenced completely, so that the brightness adjustment of the face area can be realized, and the contrast can be improved.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 401 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 410; in addition, the uplink data is transmitted to the base station. Typically, radio unit 401 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. Further, the radio unit 401 can also communicate with a network and other devices through a wireless communication system.
The mobile terminal provides the user with wireless broadband internet access through the network module 402, such as helping the user send and receive e-mails, browse web pages, and access streaming media.
The audio output unit 403 may convert audio data received by the radio frequency unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output as sound. Also, the audio output unit 403 may also provide audio output related to a specific function performed by the mobile terminal 400 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 403 includes a speaker, a buzzer, a receiver, and the like.
The input unit 404 is used to receive audio or video signals. The input Unit 404 may include a Graphics Processing Unit (GPU) 4041 and a microphone 4042, and the Graphics processor 4041 processes image data of a still picture or video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 406. The image frames processed by the graphic processor 4041 may be stored in the memory 409 (or other storage medium) or transmitted via the radio frequency unit 401 or the network module 402. The microphone 4042 may receive sound, and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 401 in case of the phone call mode.
The mobile terminal 400 also includes at least one sensor 405, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 4061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 4061 and/or the backlight when the mobile terminal 400 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), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 405 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be described in detail herein.
The display unit 406 is used to display information input by the user or information provided to the user. The Display unit 406 may include a Display panel 4061, and the Display panel 4061 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 407 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 407 includes a touch panel 4071 and other input devices 4072. Touch panel 4071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 4071 using a finger, a stylus, or any suitable object or attachment). The touch panel 4071 may include two parts, 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 410, receives a command from the processor 410, and executes the command. In addition, the touch panel 4071 can be implemented by using various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 4071, the user input unit 407 may include other input devices 4072. Specifically, the other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a track ball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 4071 can be overlaid on the display panel 4061, and when the touch panel 4071 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 410 to determine the type of the touch event, and then the processor 410 provides a corresponding visual output on the display panel 4061 according to the type of the touch event. Although in fig. 4, the touch panel 4071 and the display panel 4061 are two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 4071 and the display panel 4061 may be integrated to implement the input and output functions of the mobile terminal, which is not limited herein.
The interface unit 408 is an interface through which an external device is connected to the mobile terminal 400. 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 408 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 400 or may be used to transmit data between the mobile terminal 400 and external devices.
The memory 409 may be used to store software programs as well as various data. The memory 409 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 409 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 410 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 409 and calling data stored in the memory 409, thereby integrally monitoring the mobile terminal. Processor 410 may include one or more processing units; preferably, the processor 410 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 410.
The mobile terminal 400 may further include a power supply 411 (e.g., a battery) for supplying power to various components, and preferably, the power supply 411 may be logically connected to the processor 410 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the mobile terminal 400 includes some functional modules that are not shown, and thus, are not described in detail herein.
Preferably, an embodiment of the present invention further provides a mobile terminal, which includes a processor 410, a memory 409, and a computer program stored in the memory 409 and capable of being executed on the processor 410, where the computer program, when executed by the processor 410, implements each process of the above-mentioned image processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the embodiment of the image processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
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.
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 (8)

1. An image processing method applied to a mobile terminal is characterized by comprising the following steps:
identifying a face region of a target image, and calculating a brightness difference value of the face region, wherein the brightness difference value is a difference value between the brightness of a first part and the brightness of a second part of the face region, the first part is the brightest part in the face region, and the second part is the darkest part in the face region;
if the brightness difference value is not within a first preset threshold range, adjusting the brightness and the contrast of the face area according to the brightness difference value and the first preset threshold range;
wherein, the step of adjusting the brightness and the contrast of the face region according to the brightness difference value and the first preset threshold range comprises:
calculating a first difference between the brightness difference and a center value of the first preset threshold range;
and adjusting the brightness of the face region according to the first difference value to realize the adjustment of the contrast of the face region, so that the adjusted brightness difference value is within the range of the first preset threshold value.
2. The image processing method according to claim 1, wherein the step of identifying the face region of the target image comprises:
determining an area, in which the chromaticity in the target image meets a second preset threshold and the brightness meets a third preset threshold, as a target area;
and processing the target area to determine the face area.
3. The image processing method according to claim 1, characterized in that the method further comprises:
calculating an average value between the luminance of the first portion and the luminance of the second portion;
if the average value is not within a fourth preset threshold range, calculating a second difference value between the average value and a central value of the fourth preset threshold range;
and adjusting the brightness of the face area according to the second difference value, so that the adjusted average value is within the range of the fourth preset threshold value.
4. A mobile terminal, comprising:
a recognition calculation module configured to recognize a face region of a target image, calculate a brightness difference value of the face region, the brightness difference value being a difference value between brightness of a first portion and brightness of a second portion of the face region, the first portion being a brightest portion of the face region, the second portion being a darkest portion of the face region;
the first adjusting module is configured to adjust the brightness and the contrast of the face area according to the brightness difference value and a first preset threshold range if the brightness difference value is not within the first preset threshold range;
the first adjustment module includes:
a calculation unit configured to calculate a first difference value between the luminance difference value and a center value of the first preset threshold range;
and the adjusting unit is configured to adjust the brightness of the face region according to the first difference value so as to adjust the contrast of the face region, so that the adjusted brightness difference value is within the first preset threshold range.
5. The mobile terminal of claim 4, wherein the identification calculation module comprises:
a first identification unit configured to determine an area in the target image, in which the chromaticity meets a second preset threshold and the brightness meets a third preset threshold, as a target area;
and the second identification unit is configured to process the target area and determine the face area.
6. The mobile terminal of claim 4, wherein the mobile terminal further comprises:
a first calculation module configured to calculate an average value between the luminance of the first portion and the luminance of the second portion;
a second calculation module configured to calculate a second difference between the average value and a center value of a fourth preset threshold range if the average value is not within the fourth preset threshold range;
and the second adjusting module is configured to adjust the brightness of the face region according to the second difference value so that the adjusted average value is within the fourth preset threshold range.
7. A mobile terminal, characterized in that it comprises a processor, a memory and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, implements the steps of the image processing method according to any one of claims 1 to 3.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the image processing method according to any one of claims 1 to 3.
CN201811584360.5A 2018-12-24 2018-12-24 Image processing method and mobile terminal Active CN109727212B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811584360.5A CN109727212B (en) 2018-12-24 2018-12-24 Image processing method and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811584360.5A CN109727212B (en) 2018-12-24 2018-12-24 Image processing method and mobile terminal

Publications (2)

Publication Number Publication Date
CN109727212A CN109727212A (en) 2019-05-07
CN109727212B true CN109727212B (en) 2021-05-04

Family

ID=66297072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811584360.5A Active CN109727212B (en) 2018-12-24 2018-12-24 Image processing method and mobile terminal

Country Status (1)

Country Link
CN (1) CN109727212B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110930335B (en) * 2019-11-27 2023-03-31 维沃移动通信有限公司 Image processing method and electronic equipment
CN114268745A (en) * 2020-09-16 2022-04-01 北京小米移动软件有限公司 Brightness adjusting method, device, equipment and storage medium
CN113365400B (en) * 2021-05-31 2022-05-31 中建二局土木工程集团有限公司 Multi-period street lamp control system based on artificial intelligence and video analysis
CN115953267B (en) * 2023-03-09 2023-06-16 中川建投集团有限公司 Intelligent building site management system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608677A (en) * 2015-12-28 2016-05-25 成都品果科技有限公司 Image skin color beautifying method and system under any lighting conditions
CN106210522A (en) * 2016-07-15 2016-12-07 广东欧珀移动通信有限公司 A kind of image processing method, device and mobile terminal

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544478A (en) * 2013-10-09 2014-01-29 五邑大学 All-dimensional face detection method and system
CN107818285A (en) * 2016-09-12 2018-03-20 北京金山云网络技术有限公司 A kind of skin color detection method and device
CN106791451B (en) * 2017-02-28 2020-09-22 上海传英信息技术有限公司 Photographing method of intelligent terminal
CN108875471A (en) * 2017-06-19 2018-11-23 北京旷视科技有限公司 The method, apparatus and computer storage medium of facial image bottom library registration
CN107507144B (en) * 2017-08-18 2020-06-16 苏州科达科技股份有限公司 Skin color enhancement processing method and device and image processing device
CN107707838A (en) * 2017-09-11 2018-02-16 广东欧珀移动通信有限公司 Image processing method and device
CN108200351A (en) * 2017-12-21 2018-06-22 深圳市金立通信设备有限公司 Image pickup method, terminal and computer-readable medium
CN108734676B (en) * 2018-05-21 2020-12-01 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608677A (en) * 2015-12-28 2016-05-25 成都品果科技有限公司 Image skin color beautifying method and system under any lighting conditions
CN106210522A (en) * 2016-07-15 2016-12-07 广东欧珀移动通信有限公司 A kind of image processing method, device and mobile terminal

Also Published As

Publication number Publication date
CN109727212A (en) 2019-05-07

Similar Documents

Publication Publication Date Title
CN107957839B (en) Display control method and mobile terminal
CN109461117B (en) Image processing method and mobile terminal
CN109727212B (en) Image processing method and mobile terminal
CN109688322B (en) Method and device for generating high dynamic range image and mobile terminal
CN107977652B (en) Method for extracting screen display content and mobile terminal
CN107886321B (en) Payment method and mobile terminal
CN107846583B (en) Image shadow compensation method and mobile terminal
CN108040209B (en) Shooting method and mobile terminal
CN110969981A (en) Screen display parameter adjusting method and electronic equipment
CN107730460B (en) Image processing method and mobile terminal
CN107749046B (en) Image processing method and mobile terminal
CN107644396B (en) Lip color adjusting method and device
JP7467667B2 (en) Detection result output method, electronic device and medium
CN107153500B (en) Method and equipment for realizing image display
CN109819166B (en) Image processing method and electronic equipment
CN109104578B (en) Image processing method and mobile terminal
CN108174110B (en) Photographing method and flexible screen terminal
CN109639981B (en) Image shooting method and mobile terminal
CN109859718B (en) Screen brightness adjusting method and terminal equipment
CN107729100B (en) Interface display control method and mobile terminal
CN107817963B (en) Image display method, mobile terminal and computer readable storage medium
CN110740265B (en) Image processing method and terminal equipment
CN109819331B (en) Video call method, device and mobile terminal
CN109462727B (en) Filter adjusting method and mobile terminal
CN109729280B (en) Image processing method and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant