Disclosure of Invention
An object of embodiments of the present invention is to provide a method, a terminal, and a computer-readable storage medium for obtaining a beauty parameter characteristic value, so that a photographing terminal such as an intelligent camera can automatically configure a beauty parameter characteristic value according to a user's beauty habit, and the user's beauty becomes more convenient and personalized.
In order to solve the above technical problem, an embodiment of the present invention provides a method for obtaining a beauty parameter characteristic value, including:
judging whether at least one beautifying parameter characteristic value with the number of N exists, wherein N is a natural number larger than 1;
if at least one beautifying parameter characteristic value with the number of N exists, increasing the weight of the beautifying parameter characteristic values with the number of N according to the acquired time sequence, wherein the weight is increased progressively according to the acquired time sequence;
acquiring a weighted average of the N beauty parameter characteristic values according to the weight and the N beauty parameter characteristic values;
the weighted average of the beauty parameter characteristic values is set as the beauty parameter characteristic value used at the time of photographing.
An embodiment of the present invention further provides a terminal, including: at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method for obtaining a beauty parameter characteristic value as described above.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the method for acquiring the beauty parameter characteristic value.
Compared with the prior art, the embodiment of the invention judges whether at least one beautifying parameter characteristic value with the number of N exists, wherein N is a natural number larger than 1, and then the embodiment of the invention obtains whether the beautifying parameter characteristic value with the number of more than 1 exists. And if so, increasing the weights of the plurality of beauty parameter characteristic values according to the acquired time sequence, wherein the weights are increased progressively according to the acquired time sequence, and acquiring the weighted average of the N beauty parameter characteristic values according to the weights and the N beauty parameter characteristic values. Since the closer the photographing time of the beauty photo is to the present, the more weight it occupies, the closer the beauty photo is, the more the beauty photo can show the beauty habit of the user. Therefore, according to the weight and the N beauty parameter characteristic values, a weighted average of the N beauty parameter characteristic values is obtained, and the beauty parameter characteristic value meeting the beauty habit of the user can be obtained. The weighted average of the beauty parameter characteristic values is set as the beauty parameter characteristic value used at the time of photographing. The method and the system enable the photographing terminals such as the intelligent camera to automatically configure the beauty parameter characteristic value according to the beauty habit of the user, and the user can more conveniently and individually beautify the face.
In addition, after judging whether there is at least one beauty parameter characteristic value with the number of N, the method further comprises the following steps: if at least one beautifying parameter characteristic value with the number of N does not exist, after the fact that the shot picture is beautified is detected, at least one beautifying parameter characteristic value is obtained according to the shot picture and the beautified picture. When the beauty parameter characteristic value which meets the beauty habit of the user cannot be automatically obtained due to lack of the beauty parameter characteristic value, the beauty parameter characteristic value of the user during beauty is obtained through a beauty photo and an original picture during the self-beautifying of the user, and the beauty parameter characteristic value is accumulated so that the beauty parameter characteristic value which meets the beauty habit of the user can be automatically generated.
In addition, after setting the weighted average of the beauty parameter characteristic values as the beauty parameter characteristic values used in photographing, the method further comprises the following steps: when the photographed photograph is processed with the beauty parameter characteristic value, a preview image of the photograph subjected to beauty processing with the beauty parameter characteristic value is displayed on the screen. Through the beautiful face picture that shows the automatic generation on the screen, make the user can learn the effect of beautiful face very first time and then decide whether to make the adjustment to the beautiful face effect, make the beautiful face become more convenient.
In addition, before judging whether at least one beautifying parameter characteristic value with the number of N exists, the method further comprises the following steps: detecting whether a manual beautifying mode needs to be entered, wherein the manual beautifying mode is a mode for manually beautifying the photo by a user; and if the detection result is negative, judging whether at least one beautifying parameter characteristic value with the number of N exists. The step of detecting whether the manual beautifying mode needs to be entered is added before the step of judging whether at least one beautifying parameter characteristic value with the number of N exists, so that a user can select to enter manual beautifying or automatic beautifying, the selection of the user is increased, and the use experience of the user is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the present invention relates to a method for acquiring a beauty parameter characteristic value. The core of the embodiment lies in judging whether at least one beautifying parameter characteristic value with the number of N exists, wherein N is a natural number larger than 1; if at least one beautifying parameter characteristic value with the number of N exists, increasing the weight of the beautifying parameter characteristic values with the number of N according to the acquired time sequence, wherein the weight is increased progressively according to the acquired time sequence; acquiring a weighted average of the N beauty parameter characteristic values according to the weight and the N beauty parameter characteristic values; the weighted average of the beauty parameter characteristic values is set as the beauty parameter characteristic value used at the time of photographing. The method and the system enable the photographing terminals such as the intelligent camera to automatically configure the beauty parameter characteristic value according to the beauty habit of the user, and the user can more conveniently and individually beautify the face. The following describes implementation details of the method for acquiring a beauty parameter feature value according to the present embodiment in detail, and the following description is only provided for facilitating understanding of the implementation details, and is not necessary for implementing the present embodiment.
As shown in fig. 1, the method for obtaining the beauty parameter characteristic value in this embodiment specifically includes:
step S101, judging whether at least one beautifying parameter characteristic value with the number of N exists, wherein N is a natural number larger than 1. If yes, the process proceeds to step S102, and if not, the process proceeds to step S104.
Specifically, the processing object of the beauty algorithm is a portrait picture: there are several face regions and non-face regions in the picture that embodiments of the present invention are intended to handle. Each face consists of five sense organs, cheeks, chin, forehead and the like. Each part has its own characteristics, and the beautifying algorithm needs to perform specific beautifying operations for different parts. Taking whitening as an example, the picture can use three primary colors of RGB space and HSV space, the HSV space is closer to human vision, and the whitening algorithm also increases the V value in an effective area and improves the brightness so as to achieve the whitening effect.
The beauty parameter characteristic values for beautifying the face of the photo are of several types, wherein the types of the more common beauty parameter characteristic values are a contrast value of the brightness of an effective area of the face and the brightness of a non-face area, a spatial ratio of the beauty area in the face area under a set shooting angle and a spatial variation value of the beauty area. The contrast value of the brightness of the effective area of the face and the brightness of the non-face area can be used for knowing where the user uses the brightness adjusting effect and the brightness of brightness adjustment. Through the space ratio of the beauty area in the face area under the set shooting angle, the user can know the size of the face area occupied by the beauty area and the area where the user is used to beautify the pictures shot under different shooting angles. Through the spatial variation value of the beautifying area, the fact that the user performs translational stretching on the parts of the face can be known. The data is an indispensable part for automatically generating a beauty parameter characteristic value that conforms to the beauty habit of the user. The beauty parameter characteristic value can be provided with a plurality of data, which are respectively beauty parameter characteristic value data left when the user performs the same beauty treatment in different time periods. Therefore, whether at least one beautifying parameter characteristic value with the number of N exists is judged, namely whether the user uses the same photo beautifying mode for multiple times is judged.
And step S102, increasing the weights of the N beauty parameter characteristic values according to the acquired time sequence, wherein the weights are increased progressively according to the acquired time sequence.
Specifically, the closer the time of the acquired beauty parameter characteristic value is to the present, the more the beauty mode and the beauty parameter characteristic value are the ones that the user likes recently and the best fit with the user's latest liking. And the number of the beauty parameter characteristic values having the N beauty parameter characteristic values may be more than one. Taking a beauty parameter characteristic value as an example, when the number of the beauty parameter characteristic values is more than 1, the weight of the beauty parameter characteristic value is increased according to the acquired time sequence, wherein the weight is increased according to the acquired time, which is to consider not only the past beauty habits of the user but also the latest beauty habits of the user, and the latest beauty habits of the user should be the most prioritized component, so the weighting method is adopted to maximize the weight which is closest to the current beauty parameter characteristic value in the acquisition time. When the beauty parameter characteristic value is automatically generated, the maximum reference value is the nearest beauty parameter characteristic value in the acquisition time, so that the automatically generated beauty parameter characteristic value can meet the beauty habit of the user.
Step S103, according to the weight and the N beauty parameter characteristic values, acquiring a weighted average of the N beauty parameter characteristic values and setting the weighted average of the beauty parameter characteristic values as the beauty parameter characteristic value used in photographing.
Specifically, after weights are added to all beauty parameter characteristic values in at least one beauty parameter characteristic value according to the acquisition time, the weighted average of each beauty parameter characteristic value added with the weights is calculated, and the beauty parameter characteristic value meeting the beauty habit of the user can be obtained. Taking the contrast value of the brightness of the face effective region and the brightness of the non-face region as an example, assuming that the contrast values of the brightness of the 3 face effective regions and the brightness of the non-face region are stored in the mobile terminal, and the contrast values are respectively the a value acquired in 5 months in 2017, the B value acquired in 7 months in 2017 and the C value acquired in 12 months in 2017, when the contrast values of the brightness of the face effective region and the brightness of the non-face region meeting the beauty habits of the user are automatically generated, different weights are automatically assigned to A, B, C values, the weights are increased in time sequence, for example, the weight assigned to the a value is 0.1, the weight assigned to the B value is 0.3, the weight assigned to the C value is 0.6, the weighted average is a 0.1+ B0.3 + C0.6, and the obtained number is the contrast value of the brightness of the face effective region and the brightness of the non-face region meeting the beauty habits of the user. And after the weighted average of the different beauty parameter characteristic values is obtained, setting the weighted average of the beauty parameter characteristic values as the beauty parameter characteristic value used during photographing, and when the user uses the terminal to photograph and beautify the face, automatically using the weighted average set as the beauty parameter characteristic value to adjust the corresponding beauty parameter so as to beautify the face of the picture photographed by the user.
And step S104, after the shot picture is detected to be beautified, acquiring at least one beautifying parameter characteristic value according to the shot picture and the beautified picture.
Specifically, if the beauty parameter characteristic value is lacked and the beauty parameter characteristic value meeting the beauty habit of the user cannot be automatically obtained, when it is detected that the user uses the terminal to take a photo and beautifies the photo, the beauty parameter characteristic value when the user beautifies the face is obtained by analyzing the beauty photo and the original picture when the user beautifies the face, and the beauty parameter characteristic value is accumulated, so that the beauty parameter characteristic value meeting the beauty habit of the user can be automatically generated.
Compared with the prior art, the embodiment determines whether the beauty parameter characteristic value with the number larger than 1 exists. And if so, increasing the weights of the plurality of beauty parameter characteristic values according to the acquired time sequence, wherein the weights are increased progressively according to the acquired time sequence, and acquiring the weighted average of the N beauty parameter characteristic values according to the weights and the N beauty parameter characteristic values. The more recent beauty pictures can show the beauty habit of the user, so that the weighted average of the N beauty parameter characteristic values is obtained according to the weight and the N beauty parameter characteristic values, and the beauty parameter characteristic value meeting the beauty habit of the user can be obtained. The weighted average of the beauty parameter characteristic values is set as the beauty parameter characteristic value used at the time of photographing. The method and the system enable the photographing terminals such as the intelligent camera to automatically configure the beauty parameter characteristic value according to the beauty habit of the user, and the user can more conveniently and individually beautify the face.
The second embodiment of the present invention relates to a method for acquiring a beauty parameter characteristic value. The embodiment is further improved on the basis of the first embodiment, and the specific improvement is as follows: in this embodiment, after setting the weighted average of the beauty parameter characteristic values as the beauty parameter characteristic values used in photographing, the method further includes: when the photographed photograph is processed with the beauty parameter characteristic value, a preview image of the photograph subjected to beauty processing with the beauty parameter characteristic value is displayed on the screen. Before judging whether at least one beautifying parameter characteristic value with the number of N exists, the method further comprises the following steps: detecting whether a manual beautifying mode needs to be entered, wherein the manual beautifying mode is a mode for manually beautifying the photo by a user; and if the detection result is negative, judging whether at least one beautifying parameter characteristic value with the number of N exists. If the detection result is yes, after the shot picture is detected to be beautified, at least one beautifying parameter characteristic value is obtained according to the shot picture and the beautified picture. The flow chart is shown in fig. 2, and comprises:
step S201, detecting whether the manual beauty mode needs to be entered. If not, the process proceeds to step S202, and if so, the process proceeds to step S207.
Specifically, the photographing terminal can be a terminal having both a photographing function and a processing function, such as an intelligent camera or a mobile terminal. After the user shoots the picture, the terminal can display the option of whether to enter manual beautifying, and the user can select manual beautifying by himself or automatically beautify by using the terminal, so that the degree of freedom of the user is increased, and the experience of the user is improved.
Step S202, judging whether at least one beautifying parameter characteristic value with the number of N exists, wherein N is a natural number larger than 1. If yes, the process proceeds to step S203, and if not, the process proceeds to step S206.
Since step 202 in this embodiment is substantially the same as step 101 in the first embodiment, it is not described herein again.
Step S203, increasing weights to the N beauty parameter feature values according to the acquired time sequence, wherein the weights are increased progressively according to the acquired time sequence.
Since step 203 in this embodiment is substantially the same as step 102 in the first embodiment, it is not described herein again.
Step S204, according to the weight and the N beauty parameter characteristic values, acquiring a weighted average of the N beauty parameter characteristic values and setting the weighted average of the beauty parameter characteristic values as the beauty parameter characteristic value used in photographing.
Since step 204 in this embodiment is substantially the same as step 103 in the first embodiment, it is not described herein again.
In step S205, when the photographed picture is processed with the beauty parameter characteristic value, a preview image of the picture subjected to beauty processing with the beauty parameter characteristic value is displayed on the screen.
Specifically, after the shot photo is processed by using the beauty parameter characteristic value, the preview picture of the processed photo can be displayed on the shot terminal, so that the user can see the processing effect at the first time, and if the processing effect is not satisfactory, the user can perform beauty processing by himself, thereby facilitating the selection of the user and providing humanized service for the user.
And step S206, after the shot picture is detected to be beautified, acquiring at least one beautifying parameter characteristic value according to the shot picture and the beautified picture.
Since step 206 in this embodiment is substantially the same as step 104 in the first embodiment, it is not repeated here.
And step S207, after the shot picture is detected to be beautified, acquiring at least one beautifying parameter characteristic value according to the shot picture and the beautified picture.
Specifically, when the user selects manual beauty, whether the shot picture is beautified or not is detected, and when the picture is beautified, at least one beauty parameter characteristic value is obtained according to the shot picture and the beautified picture, and the beauty parameter characteristic values are accumulated, so that the beauty parameter characteristic values meeting the beauty habit of the user can be generated more smoothly and automatically. The common beauty parameter characteristic values are of three types, namely a contrast value of the brightness of a face effective area and the brightness of a non-face area, a spatial ratio of a beauty area in the face area under a set shooting angle and a spatial variation value of the beauty area, and when a user selects manual beauty, the method for acquiring the beauty parameter characteristic values respectively comprises the following steps:
when the feature value of the beauty parameter is the contrast value of the brightness of the effective area of the face and the brightness of the non-face area, the contrast value of the brightness of the effective area of the face and the brightness of the non-face area is obtained according to the brightness of the effective area of the face and the brightness of the non-face area, namely after a user debugs the beauty parameter, the brightness of the effective area of the face is compared with the brightness of the non-face area of the face, the effect contrast value is calculated, the contrast value is used as an automatic beauty generation feature value, and the beauty parameter is automatically changed according to the feature value.
And when the feature value of the beauty parameter is the space ratio of the beauty area in the face area under the set shooting angle, acquiring the angle during shooting, and recording the space ratio of the beauty area in the face area under the angle, namely, the parameter set by the user during beauty is usually adjusted according to the face angle, and finally shooting to finish the picture which accords with the self beauty. According to the second embodiment of the invention, the aesthetic habits of the user are analyzed, and the ratio of the target area to the face space after the user sets the parameters is analyzed.
And when the beauty parameter characteristic value is the spatial variation value of the beauty area, acquiring the face contour point, and acquiring the spatial variation value of the beauty area according to the variation of the face contour point. For example, the large-eye and face-thinning effects belong to the application of image local distortion algorithm, the face detection technology is utilized to obtain face contour points, and the contour coordinate points are utilized to obtain the face-thinning effect by applying local translation algorithm or to locally zoom the eye area to obtain the large-eye effect
Therefore, the at least one beauty parameter characteristic value obtained may include: acquiring a contrast value of the brightness of the face effective area and the brightness of the non-face area according to the brightness of the face effective area and the brightness of the non-face area; acquiring the angle during shooting, and recording the space ratio of the beauty area in the face area under the angle; and acquiring face contour points, and acquiring a spatial variation value of the beautifying area according to the variation of the face contour points. Finally, the beauty parameter characteristic value is accumulated, so that the beauty parameter characteristic value meeting the beauty habit of the user can be generated automatically and smoothly.
Compared with the prior art, the method for acquiring the beauty parameter characteristic value provided by the embodiment can increase the degree of freedom of the user and increase the experience of the user by enabling the user to select manual beauty or automatically beautify the face by using the terminal. Through letting the user can see the effect of beauty treatment the very first time, if unsatisfied to the treatment effect, can also the user oneself carry out beauty treatment, made things convenient for the user to make the selection, provide humanized service for the user. When the user selects manual beautifying, whether the shot picture is beautified or not is detected, and when the picture is beautified, at least one beautifying parameter characteristic value is obtained according to the shot picture and the beautified picture, and the beautifying parameter characteristic values are accumulated, so that the beautifying parameter characteristic values meeting the beautifying habit of the user can be generated more smoothly and automatically.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A third embodiment of the invention relates to a terminal, as shown in fig. 3, comprising at least one processor 31; and a memory 32 communicatively coupled to the at least one processor 31; the memory 32 stores instructions executable by the at least one processor 31, and the instructions are executed by the at least one processor 31, so that the at least one processor 31 can execute the method for acquiring the beauty parameter characteristic value according to the first embodiment and the second embodiment of the present invention.
Where the memory 32 and the processor 31 are coupled in a bus, the bus may comprise any number of interconnected buses and bridges, the buses coupling together one or more of the various circuits of the processor 31 and the memory 32. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 31 is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor 31.
The processor 31 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory 32 may be used to store data used by the processor 31 in performing operations.
A fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.