CN110751610A - Image processing method, mobile terminal and readable storage medium - Google Patents

Image processing method, mobile terminal and readable storage medium Download PDF

Info

Publication number
CN110751610A
CN110751610A CN201911043021.0A CN201911043021A CN110751610A CN 110751610 A CN110751610 A CN 110751610A CN 201911043021 A CN201911043021 A CN 201911043021A CN 110751610 A CN110751610 A CN 110751610A
Authority
CN
China
Prior art keywords
skin color
portrait
area
optimized
information
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.)
Pending
Application number
CN201911043021.0A
Other languages
Chinese (zh)
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.)
Shenzhen Transsion Holdings Co Ltd
Original Assignee
Shenzhen Transsion Holdings 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 Shenzhen Transsion Holdings Co Ltd filed Critical Shenzhen Transsion Holdings Co Ltd
Priority to CN201911043021.0A priority Critical patent/CN110751610A/en
Publication of CN110751610A publication Critical patent/CN110751610A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • G06T5/90
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Abstract

The invention discloses an image processing method, a mobile terminal and a computer readable storage medium, firstly, obtaining and optimizing skin color information of a portrait in an image to be processed to obtain an optimized portrait picture; then judging whether the skin color of the optimized portrait picture is uniform or not; and finally, if the optimized portrait picture is not uniform, correcting the skin color according to a preset rule aiming at the region with uneven skin color in the optimized portrait picture. When a user shoots under scenes of uneven light, colored light or shadow shielding and the like, the skin color of the shot image is uneven. According to the invention, the uneven skin color area is processed, so that the imaging quality is effectively improved, and the user experience is improved.

Description

Image processing method, mobile terminal and readable storage medium
Technical Field
The invention relates to the technical field of mobile terminal images, in particular to an image processing method, a mobile terminal and a readable storage medium.
Background
Along with the increase of the demand of the imaging effect of the shot images, the variety and the number of various terminals with the shooting and image processing functions are rapidly increasing, and especially, the mobile phone has the advantages of simple shooting operation, diversified use functions and convenience in carrying, so that more and more consumers pay attention to the mobile phone. When a mobile phone with the functions of shooting and image processing is used for processing a portrait (an image of a person is simply referred to as a portrait) in an image, a processing object is the whole portrait, so that the current image processing mode is large in coverage area and weak in pertinence, and accordingly the image processing effect is poor and the user experience is poor.
Disclosure of Invention
The invention mainly aims to provide an image processing method, a mobile terminal and a computer storage medium, and aims to solve the technical problems of uneven skin color and poor image quality of a shot image when a mobile terminal camera in the prior art shoots in environments of uneven light, colored light and the like or shoots with shadow shielding.
In order to achieve the above object, an embodiment of the present invention provides an image processing method, including:
obtaining and optimizing skin color information of a portrait in an image to be processed to obtain an optimized portrait picture;
judging whether the skin color of the optimized portrait picture is uniform or not;
and if the optimized portrait picture is not uniform, performing skin color correction on the skin color nonuniform area in the optimized portrait picture according to a preset rule.
Optionally, the step of performing skin color correction on the area with uneven skin color in the optimized portrait picture according to a preset rule includes:
obtaining reference skin color information of the portrait according to the skin color information of the portrait;
applying the reference skin color information of the portrait to obtain the optimized portrait picture;
and correcting the uneven skin color area in the optimized portrait picture according to a preset standard skin color model.
Optionally, the step of correcting the uneven skin color region in the optimized portrait picture according to a preset standard skin color model includes:
dividing the optimized portrait picture and the preset standard skin color model to obtain area combinations of optimized portrait picture skin color areas and preset standard skin color model skin color areas which correspond to each other one by one, and then calculating a skin color difference value between the two areas in each area combination;
and according to the skin color difference value, performing skin color correction on skin color areas of the optimized portrait pictures in the optimized portrait pictures.
Optionally, the step of segmenting the optimized portrait picture and the preset standard skin color model to obtain a region combination of the optimized portrait picture skin color region and the preset standard skin color model skin color region in one-to-one correspondence, and then calculating a skin color difference value between the two regions in each region combination includes:
obtaining and using skin color information of the optimized portrait picture skin color area in each area combination as first skin color information;
obtaining and using skin color information of the skin color area of the preset standard skin color model in each area combination as second skin color information;
and sequentially taking the difference value between the second skin color information and the corresponding first skin color information in each area combination as a skin color difference value between two areas in each area combination.
Optionally, the step of performing skin color correction on the regions with uneven skin color of each optimized portrait picture in the optimized portrait pictures according to the skin color difference value to obtain the target portrait includes:
comparing each skin color difference value with the skin color threshold value:
if the skin color difference value is not larger than the skin color threshold value, the optimized portrait picture skin color area to which the first skin color information belongs is a normal area, and the skin color information of each normal area is used as third skin color information;
and acquiring the mapping relation between each third skin color information and each second skin color information.
Optionally, the step of performing skin color correction on the skin color uneven area of each optimized portrait picture in the optimized portrait picture according to the skin color difference value further includes:
if the skin color difference value is larger than the skin color threshold value, judging that the optimized portrait picture skin color area to which the first skin color information belongs is an abnormal area;
obtaining each ideal skin color information of each abnormal region according to the second skin color information and the mapping relation, and using each ideal skin color information of each abnormal region as fourth skin color information;
sequentially removing the abnormal regions to obtain blank regions corresponding to the abnormal regions;
applying each fourth skin color information to each blank area to obtain each ideal skin color area;
and smoothing each ideal skin color area and each normal area to finish skin color correction.
Optionally, the step of obtaining and optimizing skin color information of a portrait in the image to be processed to obtain an optimized portrait picture includes:
acquiring an image shot by a terminal camera, and storing the image into the terminal cache area as the image to be processed;
detecting the number of the human images of the image to be processed;
intercepting each portrait and storing the portrait in the terminal cache area;
acquiring attribute information of a portrait in an image to be processed;
obtaining reference skin color information of the portrait according to the skin color information and the attribute information;
and applying the reference skin color information to the portrait to obtain an optimized portrait picture.
Optionally, the step of determining whether the optimized portrait picture skin color is uniform includes:
acquiring the attribute information, and then selecting a target preset standard skin color model which accords with the attribute information;
acquiring the reference skin color information, and then selecting a preset standard skin color model which accords with the reference skin color information from the target preset standard skin color model;
and comparing the optimized portrait picture with the preset standard skin color model.
Optionally, if the optimized portrait image is not uniform, after the step of performing skin color correction on the region with uneven skin color in the optimized portrait image according to a preset rule, the method includes:
acquiring the number of the portraits after the skin color correction:
if the number of the portraits after the skin color correction is one, putting the portraits after the skin color correction back to the images shot by the terminal camera, smoothing the images, and outputting and displaying new images;
and if the number of the human images after the skin color correction is multiple, putting the human images after the skin color correction back to the images shot by the terminal camera, smoothing the images, and outputting and displaying new images.
The present invention also provides a mobile terminal, comprising: a memory, a processor and an image processing program stored on the memory and executable on the processor, the image processing program, when executed by the processor, implementing the steps of the image processing method as described above.
The present invention also provides a computer storage medium having stored thereon an image processing program which, when executed by a processor, implements the steps of the image processing method as described above.
In the embodiment, firstly, the skin color information of the portrait in the image to be processed is obtained and optimized to obtain an optimized portrait picture; then judging whether the skin color of the optimized portrait picture is uniform or not; and finally, if the optimized portrait picture is not uniform, correcting the skin color according to a preset rule aiming at the region with uneven skin color in the optimized portrait picture. When a user shoots under scenes of uneven light, colored light, shadow shielding and the like, for example, partial shadow of a human face is caused by the shadow of a selfie stick or an arm during ktv shooting, taillight selfie shooting, uneven skin color of the shot image and low imaging quality, firstly, a series of skin color areas are obtained by segmenting a portrait (an image of a figure part) in the shot image, then, each skin color area is compared with a skin color area corresponding to a preset standard skin color model, and abnormal areas of the portrait in the shot image, such as exposure, arm shadow shielding and the like, are found out; finally, processing abnormal areas in the portrait to obtain the portrait with uniform skin color, and putting the portrait with uniform skin color back to the original shot image and displaying the image, thereby effectively improving the problem of uneven skin color of the portrait caused by factors such as shooting environment and the like and improving the imaging quality; meanwhile, the user does not need to greatly trim the shot image, precious time is saved, and user experience is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic diagram of a hardware structure of an alternative mobile terminal according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an image processing method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a detailed process of step S30 according to an embodiment of the image processing method of the present invention;
FIG. 4 is a flowchart illustrating a detailed process of step S33 according to an embodiment of the image processing method of the present invention;
FIG. 5 is a flowchart illustrating a detailed process of step S331 according to an embodiment of the image processing method of the present invention;
FIG. 6 is a flowchart illustrating a detailed process of step S332 according to an embodiment of the image processing method of the present invention;
FIG. 7 is a flowchart illustrating another detailed process of step S332 according to an embodiment of the image processing method of the present invention;
FIG. 8 is a flowchart illustrating a detailed process of step S10 according to an embodiment of the image processing method of the present invention;
FIG. 9 is a flowchart illustrating a detailed process of step S20 according to an embodiment of the image processing method of the present invention;
FIG. 10 is a flowchart illustrating a detailed process of the step after step S30 according to an embodiment of the present invention;
FIG. 11 is a diagram illustrating an application scenario of an embodiment of an image processing method according to the present invention;
fig. 12 is a schematic view of another application scenario of the embodiment of the image processing method of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
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 mobile terminal may be implemented in various forms. For example, the mobile 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), and the like.
In the following description, taking a mobile terminal as an example, please refer to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, where 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 a software program and various data, and the memory 109 may be a computer storage medium, and the memory 109 stores a program of the image processing of the present invention. 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. Such as processor 110, executing image processing programs in memory 109 to implement the steps of various embodiments of the image processing method of the present invention.
Processor 110 may include one or more processing units; alternatively, 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 optionally, the power supply 111 may be logically connected to the processor 110 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through 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. The mobile terminal 100 can be connected with other terminal devices through bluetooth, so as to realize communication and information interaction.
Based on the hardware structure of the mobile terminal, the invention provides various embodiments of the method.
The invention provides an image processing method, which is applied to a mobile terminal, and in one embodiment of the image processing method, referring to fig. 2, the image processing method comprises the following steps:
step S10, obtaining and optimizing skin color information of the portrait in the image to be processed to obtain an optimized portrait picture;
the skin color information of the portrait refers to information representing the skin color condition of the portrait, such as R/G/B channel values (red, green and blue values of colors), HUE (HUE), Sat (saturation) and the like; the optimization of the portrait picture refers to the synthesis of a picture which is closer to the real skin color condition of the portrait in the picture by combining the attribute information of the portrait in the picture on the basis of the picture obtained by shooting.
Step S20, judging whether the optimized portrait picture skin color is uniform;
and step S30, if the area is not uniform, skin color correction is carried out on the area with non-uniform skin color in the optimized portrait picture according to a preset rule.
The preset rule refers to a rule that reference skin color information of the portrait is applied to the portrait, and a preset standard skin color model is used as a reference object, and specifically, reference can be made to fig. 3; the preset standard skin color model refers to a model obtained by analyzing a large number of portrait with no overexposure, no shadow and uniform skin color in advance, and the model is a reference object for evaluating whether a portrait skin color area is normal or not; the preset standard skin color model is selected in a targeted manner according to the reference skin color information of each portrait, so that the contrast accuracy of the skin color information can be improved; judging whether the skin color of the optimized portrait picture is uniform or not, and comparing the skin color of the optimized portrait picture by using a preset standard skin color model as a reference object; and after the uneven area is obtained through comparison, performing skin color correction on the uneven skin color area in the optimized portrait picture.
In the embodiment, the skin color information of the portrait in the image to be processed is obtained and optimized to obtain an optimized portrait picture; then judging whether the skin color of the optimized portrait picture is uniform or not; and finally, if the human face is not uniform, correcting the skin color according to a preset rule aiming at the region with uneven skin color in the optimized portrait. When a user shoots under scenes of uneven light, colored light, shadow shielding and the like, for example, partial shadow of a human face is caused by the shadow of a selfie stick or an arm during ktv shooting, taillight selfie shooting, uneven skin color of the shot image and low imaging quality, firstly, a series of skin color areas are obtained by segmenting a portrait (an image of a figure part) in the shot image, then, each skin color area is compared with a skin color area corresponding to a preset standard skin color model, and abnormal areas of the portrait in the shot image, such as exposure, arm shadow shielding and the like, are found out; finally, processing abnormal areas in the portrait to obtain the portrait with uniform skin color, and putting the portrait with uniform skin color back to the original shot image and displaying the image, thereby effectively improving the problem of uneven skin color of the portrait caused by factors such as shooting environment and the like and improving the imaging quality; meanwhile, the user does not need to greatly trim the shot image, precious time is saved, and user experience is improved.
Further, on the basis of an embodiment of the image processing method of the present invention, referring to fig. 4, step S33 includes:
step S331, dividing the optimized portrait picture and a preset standard skin color model to obtain area combinations of optimized portrait picture skin color areas and preset standard skin color model skin color areas which correspond to each other one by one, and then calculating a skin color difference value between the two areas in each area combination;
optimizing the skin color area of the portrait picture refers to dividing the optimized portrait picture, wherein each obtained area is the skin color area of the optimized portrait picture; the preset standard skin color model skin color area means that after the preset standard skin color model is divided, each obtained area is a preset standard skin color model skin color area; and taking each optimized portrait picture skin color area and the corresponding preset standard skin color model skin color area as an area combination, wherein the skin color difference value between the two areas in each area combination is the difference between the skin color information of the preset standard skin color model skin color area and the skin color information of the optimized portrait picture skin color area in the same area combination.
And S332, performing skin color correction on the uneven skin color area of each optimized portrait picture in the optimized portrait pictures according to the skin color difference value.
And comparing to obtain a skin color difference value of the skin color area of the optimized portrait picture and the skin color area of the preset standard skin color model, and then performing skin color correction on the skin color uneven area of the optimized portrait picture to obtain the portrait obtained by performing skin color correction on the optimized portrait picture by taking the preset standard skin color model as a reference object.
In the embodiment, firstly, an optimized portrait picture and a preset standard skin color model are segmented to obtain area combinations, and then, a skin color difference value between two areas in each area combination is calculated; and finally, performing skin color correction on the skin color area of each optimized portrait picture according to the skin color difference value, and preparing for subsequently outputting the portrait with corrected skin color.
Further, on the basis of an embodiment of the image processing method of the present invention, referring to fig. 5, step S331 includes:
step A10, obtaining and using the skin color information of the optimized portrait picture skin color area in each area combination as first skin color information;
the skin color information refers to information representing the skin color presenting effect of a skin color area; and using the skin color information of the optimized portrait picture skin color area in each area combination as first skin color information.
Step A20, obtaining and using the skin color information of the skin color area of the preset standard skin color model in each area combination as second skin color information;
and using the skin color information of the skin color area of the preset standard skin color model in each area combination as second skin color information.
And step A30, sequentially taking the difference value between the second skin color information and the corresponding first skin color information in each area combination as the skin color difference value between two areas in each area combination.
And subtracting the second skin color information in each area combination from the corresponding first skin color information to obtain a value, namely a skin color difference value between two areas in each area combination.
In this embodiment, the skin color information of the skin color area of the optimized portrait picture and the skin color information of the skin color area of the preset standard skin color model are firstly obtained, and then the skin color difference value between the two areas is obtained, so that preparation is made for the subsequent steps of correcting the skin color of each optimized portrait picture skin color area in the optimized portrait picture according to the skin color difference value to obtain the target portrait.
Further, on the basis of an embodiment of the image processing method of the present invention, referring to fig. 6, step S332 includes:
step A40, comparing the skin color difference value with the skin color threshold value:
the skin color threshold value is a value for evaluating whether skin color has overexposure, shadow, color illumination and the like, which need skin color homogenization processing.
Step A50, if the skin color difference value is not larger than the skin color threshold value, judging that the optimized portrait picture skin color area to which the first skin color information belongs is a normal area, and taking the skin color information of each normal area as third skin color information;
the normal area refers to an area which may or may not have the problems of overexposure, shadow, color illumination and the like in the skin color of the area but does not need skin color homogenization treatment; subtracting the second skin color information from the corresponding first skin color information; and then subtracting the obtained value from a skin color threshold value, wherein if the result is not greater than (less than or equal to) zero, the skin color difference value is not greater than the skin color threshold value, and the skin color area of the optimized portrait picture to which the skin color information belongs is a normal area.
And step A60, acquiring the mapping relation between each third skin color information and each second skin color information.
The mapping relation refers to the one-to-one correspondence relation between the skin color information of the normal area of the portrait and the skin color information of the skin color area of the preset standard skin color model; and after obtaining the normal area, acquiring the mapping relation between the skin color information of the normal area and the skin color information of the skin color area of the preset standard skin color model.
In this embodiment, by comparing the skin color difference value with the skin color threshold value, the mapping relationship between the normal region and the skin color information of the skin color region of the preset standard skin color model is obtained, which is beneficial to obtaining the ideal (originally presented but not presented) skin color information of the abnormal region according to the skin color information and the mapping relationship of the skin color region of the preset standard skin color model in the following.
Further, on the basis of an embodiment of the image processing method of the present invention, referring to fig. 7, step S332 further includes:
step A70, if the skin color difference value is larger than the skin color threshold value, judging that the skin color area of the optimized portrait picture to which the first skin color information belongs is an abnormal area;
the abnormal area refers to an area which needs skin color homogenization processing, such as overexposure, shadow, color illumination and the like of skin color; subtracting the second skin color information from the corresponding first skin color information; and subtracting the obtained value from a skin color threshold value, wherein if the result is greater than zero, the skin color difference value is greater than the skin color threshold value, and the skin color area of the optimized portrait picture to which the skin color information belongs is an abnormal area.
Step A80, obtaining each ideal skin color information of each abnormal region according to the second skin color information and the mapping relation, and using each ideal skin color information of each abnormal region as fourth skin color information;
the ideal skin color information means that after the skin color information is applied to an abnormal area, the skin color of the abnormal area may still have or does not have the problems of overexposure, shadow, color illumination and the like, but the adverse conditions are improved, skin color homogenization treatment is not required, and the following relations exist: and presetting that the skin color difference value between the skin color information of the standard skin color model and the ideal skin color information is not more than a skin color threshold value.
Step A90, removing each abnormal area in turn to obtain each blank area corresponding to each abnormal area;
the blank area is used for replacing the abnormal area, and is consistent with the replaced abnormal area in size and shape and has no skin color information; after removing each abnormal area in sequence, changing the skin color area of each abnormal area in the original optimized portrait picture into a blank area, wherein each blank area corresponds to each abnormal area one by one; each blank region does not have skin color information, and the size and shape of the blank region are consistent with those of the corresponding abnormal region.
Step A100, applying each fourth skin color information to each blank area to obtain each ideal skin color area;
the ideal skin color region refers to a region obtained after the ideal skin color information is applied to an abnormal region; after the ideal skin color information of each abnormal area and the blank areas corresponding to the abnormal areas one by one are obtained through the steps, because the blank areas have the same size and shape as the corresponding abnormal areas and do not have the skin color information, the ideal skin color area can be obtained after the ideal skin color information is applied to the blank areas corresponding to the abnormal areas.
Step A110, smoothing each ideal skin color area and each normal area to finish skin color correction.
The smoothing process refers to the operation of fusing and naturally transitioning two different regions; and smoothing each ideal skin color area and each normal area to ensure that transition among the areas is natural, thereby being beneficial to improving the portrait quality.
In this embodiment, first, obtaining each ideal skin color information of each abnormal region according to the skin color information of the skin color region of the preset standard skin color model and the mapping relationship; and then, sequentially removing the abnormal regions to obtain blank regions corresponding to the abnormal regions, so that each ideal skin color information is favorably applied to the blank regions corresponding to the abnormal regions in the follow-up process to obtain each ideal skin color region. In this embodiment, first, each ideal skin color information is applied to each blank region corresponding to each abnormal region to obtain each ideal skin color region; and then, smoothing each ideal skin color area and each normal area to obtain a portrait with natural transition of each area.
Further, on the basis of an embodiment of the image processing method of the present invention, referring to fig. 8, the step S10 includes:
step S11, acquiring images shot by a terminal camera, and storing the images in a terminal cache area as images to be processed;
the invention can be applied to mobile phone cameras; when a user opens a mobile phone camera application and clicks to confirm shooting, the method firstly acquires an image shot by the camera, and then stores the image as an image to be processed in a mobile phone cache region for subsequent processing and displaying.
Step S12, detecting the number of the human images of the image to be processed;
after the images to be processed are stored in a mobile phone camera cache region, the number of the human images in the images to be processed is detected, and the subsequent acquisition of skin color information and attribute information of each human image is facilitated.
And step S13, intercepting each portrait and storing the portrait in a terminal buffer area.
And intercepting each portrait in the image to be processed from the image and storing the portrait in a mobile phone cache region.
Step S14, acquiring attribute information of the portrait in the image to be processed;
the attribute information of the portrait refers to information characterizing the type and characteristics of the portrait, such as gender, age, face shape, and the like.
Step S15, obtaining reference skin color information of the portrait according to the skin color information and the attribute information;
performing weighting operation on the skin color information and the attribute information to obtain portrait reference skin color information, wherein the portrait reference skin color information refers to the skin color information for reference of the portrait in the closest image, which is obtained by weighting according to the skin color information and the attribute information respectively; if the obtained skin color information is C and the obtained attribute information D is: the attribute information and the skin color information C are respectively weighted to obtain the attribute information of the gender girl, the age 20 and the melon seed face type according to the skin color information, and the calculation method comprises the following steps: x C + y D, where x is a weight coefficient of the skin color information C, y is a weight coefficient of the attribute information D, and x + y is 1; the optimized portrait picture refers to a portrait with the highest similarity degree with a photographed portrait; and applying reference information, namely reference skin color information, closest to the skin color of the person in the image to the person to obtain an optimized person image picture.
And step S16, applying the reference skin color information to the portrait to obtain an optimized portrait picture.
In the embodiment, firstly, an image shot by a camera is obtained and stored as an image to be processed, and the number of the human images in the image is detected; and then respectively intercepting and storing the figures, respectively taking each figure as an independent figure, finally applying the reference skin color information to the figures to obtain an optimized figure picture, and comparing the optimized figure picture with a preset standard skin color model to confirm a skin color uneven area in the optimized figure picture.
Further, on the basis of an embodiment of the image processing method of the present invention, referring to fig. 9, step S20 includes:
step S21, acquiring attribute information, and then selecting a target preset standard skin color model meeting the attribute information;
the attribute information refers to information representing the type and characteristics of the portrait, such as gender, age, facial form, and the like; firstly, a preset standard skin color model which accords with the attribute characteristics is selected according to the attribute information and is called as a target preset standard skin color model.
And step S22, acquiring reference skin color information, and then selecting a preset standard skin color model which accords with the reference skin color information from the target preset standard skin color models.
According to the reference skin color information of each portrait, a corresponding preset standard skin color model is selected from the target preset standard skin color models, and the accuracy of selecting the preset standard skin color models is improved, so that the selected preset standard skin color models are closest to the real skin color conditions of the corresponding portrait, and the preset standard skin color models are used as reference objects for judging whether image adjustment is needed or not, so that the similarity degree of the processed skin color and the real skin color can be improved.
And step S23, comparing the optimized portrait picture with a preset standard skin color model.
In the embodiment, a target preset standard skin color model is determined according to the attribute information of the portrait; and determining a preset standard skin color model according to the reference skin color information of the portrait, obtaining a reference object for evaluating whether the skin color area is normal, namely the preset standard skin color model, and finally judging to obtain an area with uneven skin color in the optimized portrait picture by comparing the optimized portrait picture with the preset standard skin color model.
Further, on the basis of an embodiment of the image processing method of the present invention, referring to fig. 10, after step S30, the method includes:
step S40, obtaining the number of the person images after the skin color correction:
the number of the portraits after the skin color correction is obtained, which is beneficial to determining the number of the portraits after the skin color correction which needs to be smoothed.
Step S50, if the number of the portraits after the skin color correction is one, the portraits after the skin color correction are put back to the images shot by the terminal camera and are smoothed, and new images are output and displayed;
if the number of the person images with the corrected skin color is one, the person images with the corrected skin color are put back to the image shot by the terminal camera and are smoothed, then a new image is output and displayed, and the image browsed by the user is the new image comprising the person images with the corrected skin color.
In step S60, if there are a plurality of skin color corrected figures, the figures with the skin color corrected are replaced with images taken by the terminal camera and smoothed, and new images are output and displayed.
And if the number of the portraits after the skin color correction is multiple, putting all the portraits after the skin color correction back to the image shot by the terminal camera, smoothing the images, outputting and displaying a new image, and displaying the new image, wherein the image browsed by the user is the new image comprising all the portraits after the skin color correction.
In the embodiment, the number of the skin color corrected figures needing smoothing processing is determined by acquiring the number of the skin color corrected figures; and then, each portrait with the corrected skin color is put back to the image shot by the terminal camera and is subjected to smoothing processing, so that transition between the portrait and the image background is natural.
In order to assist in understanding the overall technical solution of the embodiment of the present invention, referring to fig. 11, when it is detected that the number of the human images in the image to be processed is 1, it is assumed that the right face of the human image part has a shadow; the dotted line is a skin color region dividing line; intercepting the portrait as a portrait, and putting the portrait into a mobile phone cache area; firstly, acquiring skin color information and attribute information of the portrait and determining reference skin color information of the portrait according to the two information; applying the reference skin color information to the portrait to obtain an optimized portrait picture; then, the optimized portrait picture and a preset standard skin color model are segmented, an optimized portrait picture skin color area and a preset standard skin color model skin color area are obtained, and skin color information of the optimized portrait picture skin color area and skin color information of the preset standard skin color model skin color area are obtained; respectively calculating skin color difference values of the skin color information, and comparing the difference values with a skin color threshold value: if the skin color difference value is larger than the skin color threshold value, the skin color area of the optimized portrait picture to which the skin color information belongs is an abnormal area; if the skin color difference value is not larger than the skin color threshold value, the optimized portrait picture skin color area to which the skin color information belongs is a normal area, and then the mapping relation between the skin color information of each normal area and the skin color information of a skin color area of a preset standard skin color model is obtained; and then processing each abnormal area to obtain a portrait with corrected skin color, putting the portrait with the corrected skin color back into the image, smoothing the portrait, and outputting and displaying the processed image. Referring to fig. 12, fig. 12 is an image output after processing when 1 person figure, the shadow of the right face of the person figure part has been removed; and finally, displaying the image to a user for reference.
And when the number of the portraits is more than 1, respectively processing each portrait, wherein the specific processing method is the same as the processing method of the 1 portrait, then putting each portrait with corrected skin color back to the image, smoothing the portrait, and finally outputting and displaying the processed image.
In addition, the present invention also provides a mobile terminal, comprising: the memory 109, the processor 110 and the image processing program stored on the memory 109 and capable of running on the processor 110, wherein the mobile terminal display control program realizes the steps of the embodiments of the image processing method when being executed by the processor 110.
Furthermore, the present invention also provides a computer-readable storage medium storing one or more programs, which are further executable by one or more processors for implementing the steps of the embodiments of the image processing method described above.
The specific implementation of the mobile terminal and the readable storage medium (i.e., the computer readable storage medium) of the present invention has substantially the same extension as that of the embodiments of the image processing method described above, and further description thereof is omitted here.
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 solution 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 mobile terminal (such as a mobile phone) 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 (11)

1. An image processing method, characterized by comprising the steps of:
obtaining and optimizing skin color information of a portrait in an image to be processed to obtain an optimized portrait picture;
judging whether the skin color of the optimized portrait picture is uniform or not;
and if the optimized portrait picture is not uniform, performing skin color correction on the skin color nonuniform area in the optimized portrait picture according to a preset rule.
2. The image processing method according to claim 1, wherein the step of performing skin color correction for the skin color non-uniform area in the optimized portrait image according to the preset rule comprises:
obtaining reference skin color information of the portrait according to the skin color information of the portrait;
applying the reference skin color information of the portrait to obtain the optimized portrait picture;
and correcting the uneven skin color area in the optimized portrait picture according to a preset standard skin color model.
3. The image processing method according to claim 2, wherein the step of correcting the uneven skin color region in the optimized portrait image according to the preset standard skin color model comprises:
dividing the optimized portrait picture and the preset standard skin color model to obtain area combinations of optimized portrait picture skin color areas and preset standard skin color model skin color areas which correspond to each other one by one, and then calculating a skin color difference value between the two areas in each area combination;
and according to the skin color difference value, performing skin color correction on the skin color uneven area of each optimized portrait picture in the optimized portrait pictures.
4. The image processing method according to claim 3, wherein the step of segmenting the optimized portrait picture and the preset standard skin color model to obtain a one-to-one correspondence of area combinations of an optimized portrait picture skin color area and a preset standard skin color model skin color area, and then calculating a skin color difference value between the two areas in each of the area combinations comprises:
obtaining and using skin color information of the optimized portrait picture skin color area in each area combination as first skin color information;
obtaining and using skin color information of the skin color area of the preset standard skin color model in each area combination as second skin color information;
and sequentially taking the difference value between the second skin color information and the corresponding first skin color information in each area combination as a skin color difference value between two areas in each area combination.
5. The image processing method according to claim 3, wherein the step of performing skin color correction on the skin color uneven area of each optimized portrait picture in the optimized portrait picture according to the skin color difference value comprises:
comparing each skin color difference value with the skin color threshold value:
if the skin color difference value is not larger than the skin color threshold value, the optimized portrait picture skin color area to which the first skin color information belongs is a normal area, and the skin color information of each normal area is used as third skin color information;
and acquiring the mapping relation between each third skin color information and each second skin color information.
6. The image processing method according to claim 3, wherein the step of performing skin color correction on the skin color non-uniform region of each optimized portrait picture in the optimized portrait picture according to the skin color difference value further comprises:
if the skin color difference value is larger than the skin color threshold value, judging that the optimized portrait picture skin color area to which the first skin color information belongs is an abnormal area;
obtaining each ideal skin color information of each abnormal region according to the second skin color information and the mapping relation, and using each ideal skin color information of each abnormal region as fourth skin color information;
sequentially removing the abnormal regions to obtain blank regions corresponding to the abnormal regions;
applying each fourth skin color information to each blank area to obtain each ideal skin color area;
and smoothing each ideal skin color area and each normal area to finish skin color correction.
7. The image processing method of claim 1, wherein the step of obtaining and optimizing skin color information of the portrait in the image to be processed to obtain an optimized portrait picture comprises:
acquiring an image shot by a terminal camera, and storing the image into the terminal cache area as the image to be processed;
detecting the number of the human images of the image to be processed;
intercepting each portrait and storing the portrait in the terminal cache area;
acquiring attribute information of a portrait in an image to be processed;
obtaining reference skin color information of the portrait according to the skin color information and the attribute information;
and applying the reference skin color information to the portrait to obtain the optimized portrait picture.
8. The image processing method of claim 1, wherein the step of determining whether the optimized portrait picture skin color is uniform comprises:
acquiring the attribute information, and then selecting a target preset standard skin color model which accords with the attribute information;
acquiring the reference skin color information, and then selecting a preset standard skin color model which accords with the reference skin color information from the target preset standard skin color model;
and comparing the optimized portrait picture with the preset standard skin color model.
9. The image processing method according to claim 1, wherein if the skin color is not uniform, the step of performing the skin color correction on the skin color non-uniform area in the optimized portrait image according to the preset rule comprises:
acquiring the number of the portraits after the skin color correction:
if the number of the portraits after the skin color correction is one, putting the portraits after the skin color correction back to the images shot by the terminal camera, smoothing the images, and outputting and displaying new images;
and if the number of the human images after the skin color correction is multiple, putting the human images after the skin color correction back to the images shot by the terminal camera, smoothing the images, and outputting and displaying new images.
10. A mobile terminal, characterized in that the mobile terminal comprises: memory, a processor and an image processing program stored on the memory and executable on the processor, the image processing program, when executed by the processor, implementing the steps of the image processing method according to any one of claims 1 to 9.
11. A storage medium, characterized in that the storage medium has stored thereon an image processing program which, when executed by a processor, implements the steps of the image processing method according to any one of claims 1 to 9.
CN201911043021.0A 2019-10-30 2019-10-30 Image processing method, mobile terminal and readable storage medium Pending CN110751610A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911043021.0A CN110751610A (en) 2019-10-30 2019-10-30 Image processing method, mobile terminal and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911043021.0A CN110751610A (en) 2019-10-30 2019-10-30 Image processing method, mobile terminal and readable storage medium

Publications (1)

Publication Number Publication Date
CN110751610A true CN110751610A (en) 2020-02-04

Family

ID=69281084

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911043021.0A Pending CN110751610A (en) 2019-10-30 2019-10-30 Image processing method, mobile terminal and readable storage medium

Country Status (1)

Country Link
CN (1) CN110751610A (en)

Similar Documents

Publication Publication Date Title
CN107093418B (en) Screen display method, computer equipment and storage medium
CN107302663B (en) Image brightness adjusting method, terminal and computer readable storage medium
CN107438163B (en) Photographing method, terminal and computer readable storage medium
CN109361867B (en) Filter processing method and mobile terminal
CN110072061B (en) Interactive shooting method, mobile terminal and storage medium
CN110035176B (en) Brightness adjusting method of mobile terminal, mobile terminal and storage medium
CN109639996B (en) High dynamic scene imaging method, mobile terminal and computer readable storage medium
CN108040240B (en) White balance adjustment method and device and mobile terminal
CN107846583B (en) Image shadow compensation method and mobile terminal
CN108200421B (en) White balance processing method, terminal and computer readable storage medium
CN107153500B (en) Method and equipment for realizing image display
CN109819166B (en) Image processing method and electronic equipment
CN109064998A (en) A kind of screen luminance adjustment method, terminal and computer readable storage medium
CN109727212B (en) Image processing method and mobile terminal
CN109474784B (en) Preview image processing method and terminal equipment
CN111899695A (en) Backlight adjusting method, terminal device and readable storage medium
CN108200352B (en) Method, terminal and storage medium for adjusting picture brightness
CN109639981B (en) Image shooting method and mobile terminal
CN110933293A (en) Shooting method, terminal and computer readable storage medium
CN113888447A (en) Image processing method, terminal and storage medium
CN110177208B (en) Video recording association control method, equipment and computer readable storage medium
CN109521979B (en) Display control method, terminal and computer-readable storage medium
CN108449560B (en) Video recording method and terminal
CN108377297B (en) Shooting parameter adjusting method, mobile terminal and computer readable storage medium
CN110930372A (en) Image processing method, electronic equipment 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