WO2020155981A1 - 表情图像效果生成方法、装置和电子设备 - Google Patents

表情图像效果生成方法、装置和电子设备 Download PDF

Info

Publication number
WO2020155981A1
WO2020155981A1 PCT/CN2019/129124 CN2019129124W WO2020155981A1 WO 2020155981 A1 WO2020155981 A1 WO 2020155981A1 CN 2019129124 W CN2019129124 W CN 2019129124W WO 2020155981 A1 WO2020155981 A1 WO 2020155981A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
expression
facial
facial expression
comparison result
Prior art date
Application number
PCT/CN2019/129124
Other languages
English (en)
French (fr)
Inventor
吕绍辉
杨辉
倪光耀
Original Assignee
北京字节跳动网络技术有限公司
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 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Priority to US17/427,262 priority Critical patent/US12020469B2/en
Publication of WO2020155981A1 publication Critical patent/WO2020155981A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/174Facial expression recognition

Definitions

  • the present disclosure relates to the field of image processing, and in particular to a method, device, electronic device, and computer-readable storage medium for generating an expression image effect.
  • smart terminals can be used to listen to music, play games, chat online, and take photos.
  • the camera technology of the smart terminal the camera pixel has reached more than 10 million pixels, with higher definition and the camera effect comparable to professional cameras.
  • Smart terminals can currently recognize human faces or further recognize facial expressions. For example, in the security field, they can recognize specific human faces to pass verification, recognize human faces in images and optimize human faces. Recognize facial expressions to judge human emotions, etc.
  • the current facial expression recognition can only judge the type of facial expression, but not the degree of facial expression; when there are multiple faces in the image, the face that reaches the target expression cannot be quickly obtained; therefore, how to prompt the user quickly
  • the degree of facial expression has become an urgent problem to be solved.
  • embodiments of the present disclosure provide a method for generating an expression image effect, including:
  • an image effect corresponding to the first comparison result is generated in the first image.
  • the acquiring the first image, where the first image includes a face image includes:
  • the recognizing the current facial expression of the facial image includes:
  • the current facial expression is recognized according to the current facial expression feature.
  • the obtaining of previous facial expressions includes:
  • the default previous facial expression being a facial expression preset before the facial expression of the facial image is recognized.
  • the obtaining of previous facial expressions includes:
  • the comparing the current facial expression with the previous facial expression to obtain the first comparison result includes:
  • the current facial expression level is compared with the previous facial expression level, and the relationship between the current facial expression level and the previous facial expression level is obtained.
  • the generating an image effect corresponding to the first comparison result in the first image according to the first comparison result includes:
  • the image effect is rendered in the first image.
  • the acquiring the first image, where the first image includes a face image includes:
  • the first image includes at least two face images.
  • the recognizing the current facial expression of the facial image includes:
  • the method further includes:
  • the obtaining of previous facial expressions includes:
  • the comparing the current facial expression with the previous facial expression to obtain the first comparison result includes:
  • For the facial expression of each facial image compare the current facial expression with the previous facial expression to obtain the first comparison result of the facial expression of each facial image.
  • the generating an image effect corresponding to the first comparison result in the first image according to the first comparison result includes:
  • an image effect corresponding to the first comparison result of the facial expression of each facial image is generated in the first image.
  • an emoticon image effect generation device including:
  • the first image acquisition module is configured to acquire a first image, and the first image includes a face image
  • An expression recognition module for recognizing the current facial expression of the facial image
  • the previous expression acquisition module is used to acquire previous facial expressions
  • the comparison module is used to compare the current facial expression with the previous facial expression to obtain the first comparison result
  • the expression image effect generation module is configured to generate an image effect corresponding to the first comparison result in the first image according to the first comparison result.
  • the first image acquisition module further includes:
  • the first video acquisition module is configured to acquire a first video, and at least one video frame in the first video includes a face image.
  • the expression recognition module further includes:
  • a facial image recognition module configured to recognize a facial image in the first image
  • An expression feature extraction module configured to extract current facial expression features from the face image
  • the expression recognition sub-module is used to recognize the current facial expressions according to the current facial expression features.
  • previous expression acquiring module further includes:
  • the default expression obtaining module is used to obtain a default previous facial expression, which is a facial expression preset before the facial expression of the facial image is recognized.
  • previous expression acquisition module is also used for:
  • comparison module further includes:
  • the level comparison module is used to compare the level of the current facial expression with the level of the previous facial expression, and obtain the relationship between the level of the current facial expression and the level of the previous facial expression.
  • the expression image effect generation module further includes:
  • a configuration file obtaining module configured to obtain an image effect configuration file corresponding to the first comparison result according to the first comparison result
  • the rendering module is configured to render the image effect in the first image according to the image effect configuration file.
  • an expression image effect generation device including:
  • the second image acquisition module acquires a first image, and the first image includes at least two face images;
  • a first facial expression recognition module which recognizes the current facial expression of each of the at least two facial images
  • the first previous expression acquisition module for the current facial expression of each face image, obtain the previous facial expression
  • the first comparison module is used to compare the current facial expression with the previous facial expression for the facial expression of each facial image, and obtain the first comparison result of the facial expression of each facial image;
  • the first expression image effect generation module is configured to generate a first comparison result corresponding to the facial expression of each facial image in the first image according to the first comparison result of the facial expression of each facial image Image effect.
  • the device may also include:
  • the image effect profile acquisition module is used to obtain the corresponding image effect profile for the facial expression of each facial image when the facial expression of each facial image is recognized for the first time.
  • an embodiment of the present disclosure provides an electronic device, including: at least one processor; and, a memory communicatively connected with the at least one processor; wherein the memory stores the memory that can be used by the at least one processor; An executed instruction, the instruction is executed by the at least one processor, so that the at least one processor can execute any one of the expression image effect generation methods in the foregoing first aspect.
  • embodiments of the present disclosure provide a non-transitory computer-readable storage medium, characterized in that the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to make a computer execute the aforementioned first aspect Any of the above-mentioned expression image effect generation methods.
  • the present disclosure discloses an expression image effect generation method, device, electronic equipment and computer readable storage medium.
  • the method for generating the expression image effect includes: obtaining a first image, the first image including a face image; identifying the current facial expression of the face image; obtaining the previous facial expression; comparing the current face
  • the expression and the previous facial expression are used to obtain a first comparison result; according to the first comparison result, an image effect corresponding to the first comparison result is generated in the first image.
  • the embodiment of the present disclosure solves the technical problem in the prior art that users cannot quickly learn the degree of their own expressions by comparing the current expressions of the human face with the previous expressions to generate image effects.
  • FIG. 1 is a flowchart of Embodiment 1 of an expression image effect generation method provided by an embodiment of the disclosure
  • FIGS. 2a-2g are schematic diagrams of specific examples of a method for generating an expression image effect provided by embodiments of the disclosure.
  • Embodiment 3 is a flowchart of Embodiment 2 of the method for generating an expression image effect provided by an embodiment of the disclosure
  • Embodiment 1 of an emoticon image effect generation apparatus provided by an embodiment of the disclosure
  • Embodiment 2 is a schematic structural diagram of Embodiment 2 of an emoticon image effect generation apparatus provided by an embodiment of the disclosure
  • Fig. 6 is a schematic structural diagram of an electronic device provided according to an embodiment of the present disclosure.
  • FIG. 1 is a flowchart of Embodiment 1 of an expression image effect generation method provided by an embodiment of the disclosure.
  • the expression image effect generation method provided in this embodiment may be executed by an expression image effect generation device, which may Implemented as software, or as a combination of software and hardware, the expression image effect generation device can be integrated in a device in an image processing system, such as an image processing server or an image processing terminal device. As shown in Figure 1, the method includes the following steps:
  • Step S101 Obtain a first image, where the first image includes a face image
  • the obtaining the first image includes obtaining the first image from a local storage space or obtaining the first image from a network storage space. No matter where the first image is obtained from, the storage that needs to obtain the first image is preferred. Address, and then obtain the first image from the storage address.
  • the first image may be a video image or a picture, or a picture with dynamic effects, which will not be repeated here.
  • the acquiring the first image includes acquiring the first video, and at least one video frame in the first video includes a face image.
  • the first video can be obtained through an image sensor, which refers to various devices that can collect images, and typical image sensors are video cameras, cameras, cameras, etc.
  • the image sensor may be a camera on a mobile terminal, such as a front or rear camera on a smart phone, and the video image collected by the camera may be directly displayed on the display screen of the phone. In this step, Obtain the video taken by the image sensor for further image recognition in the next step.
  • the first image includes a face image, which is the basis of facial expressions.
  • the picture includes at least one face image
  • the first image is a video
  • at least one of the video frames in the first image includes at least one face image.
  • Step S102 Recognizing the current facial expression of the facial image
  • recognizing the current facial expression of the facial image includes: recognizing the facial image in the first image; extracting the current facial facial expression feature from the facial image; The facial expression feature recognizes the current facial expression.
  • Face detection is a process of arbitrarily given an image or a group of image sequences, using a certain strategy to search it to determine the location and area of all faces, and determining whether a face is a face from a variety of different images or image sequences Existence, and the process of determining the number and spatial distribution of faces.
  • face detection methods can be divided into four categories: (1) A method based on prior knowledge, which forms a rule base of typical faces to encode faces, and locates faces through the relationship between facial features; (2) Feature invariance method, which finds stable features when the pose, viewing angle or lighting conditions change, and then uses these features to determine the face; (3) Template matching method, which stores several standard faces Patterns are used to describe the entire face and facial features separately, and then calculate the correlation between the input image and the stored pattern and use it for detection; (4) Appearance-based method, which is contrary to the template matching method, which is performed from the training image set Learn to obtain models and use these models for detection.
  • An implementation of the method (4) can be used here to illustrate the process of face detection: first, features need to be extracted to complete the modeling, this embodiment uses Haar features as the key feature for judging the face, and the Haar feature is a kind of Simple rectangular features, fast extraction speed.
  • the feature template used in the calculation of Haar features is composed of two or more congruent rectangles using a simple combination of rectangles, among which there are black and white rectangles in the feature template;
  • Use the AdaBoost algorithm to find a part of the key features from a large number of Haar features, and use these features to generate an effective classifier.
  • the constructed classifier can detect the face in the image.
  • multiple face feature points can be detected, and 106 feature points can typically be used to identify a face.
  • Face image preprocessing mainly includes denoising, normalization of scale and gray level, etc.
  • the input image usually has a more complex scene.
  • the face image size, aspect ratio, lighting conditions, partial coverage, and head deflection obtained by face detection are usually different.
  • the facial expression features are extracted.
  • Motion-based feature extraction methods mainly describe expression changes based on changes in the relative positions and distances of facial feature points in sequence images, including optical flow, motion models, feature point tracking, etc. These methods are robust; based on Deformation feature extraction methods are mainly used to extract features from static images.
  • the model features are obtained by comparing the appearance or texture of natural expression models. Typical algorithms are based on active appearance model (AAM) and point distribution model (PDM), and based on texture features Gabor transform and local binary mode LBP.
  • AAM active appearance model
  • PDM point distribution model
  • facial expression classification is to send the expression features extracted in the previous stage to a trained classifier or regressor, and let the classifier or regressor give a predicted value to judge the expression category corresponding to the expression feature.
  • the common expression classification algorithms mainly include linear classifiers, neural network classifiers, support vector machines SVM, hidden Markov models and other classification and recognition methods.
  • Step S103 obtaining previous facial expressions
  • the first case is that the current time is the initial time, which means that the facial expression is recognized for the first time. At this time, there is actually no previous facial expression.
  • a default facial expression can be set in advance.
  • the default facial expression is the facial expression set before the facial expression of the facial image is recognized;
  • the second case is that the current time is not the initial time, that is, It is said that facial expressions have been recognized before the current facial expressions are recognized.
  • the previous facial expressions are the facial expressions collected at the previous sampling time. For example, if the sampling time is 100ms, the previous facial expressions are those that were acquired 100ms ago.
  • the recognized facial expression, and the currently recognized facial expression is the previous facial expression of the facial expression recognized 100ms later.
  • the facial expression in the previous video frame can also be used as The previous facial expression of the facial expression of the current video frame.
  • Step S104 comparing the current facial expression with the previous facial expression to obtain a first comparison result
  • the comparing the current facial expression with the previous facial expression to obtain the first comparison result includes: comparing the current facial expression level with the previous facial expression level to obtain the current person The relationship between the level of facial expressions and the level of previous facial expressions.
  • the determination of the level of the facial expression shown includes: comparing the facial expression with a preset template expression; The level of the template expression with the highest degree of facial expression matching is used as the level of the facial expression.
  • the level may be the degree of expression.
  • the expression is a smiling face.
  • the smiling face can be divided into multiple levels, such as 100 levels. Each level has a standard template facial expression image.
  • the facial expression is compared with the template facial expression images of these 100 levels, and the level corresponding to the template facial expression image with the highest matching degree is taken as the reference level. State the level of facial expressions.
  • the judging the level of the facial expression includes: comparing the facial expression with a preset template expression; and using the facial expression and the preset template expression similarity as the person The level of facial expression.
  • the template facial expression image may have only one, and the recognized facial expression is compared with the template facial expression image, and the result of the comparison is a similarity percentage, such as comparison After obtaining that the similarity between the facial expression and the template facial expression image is 90%, the level of the facial expression can be obtained as 90%.
  • the above specific examples of judging the level of facial expressions are only examples and do not constitute a limitation to the present disclosure. Any method that can judge the level of facial expressions can be applied to the present disclosure.
  • the level of facial expressions is corresponded to different categories, the classifier is trained using samples, and then the recognized facial expressions are input into the classifier to directly obtain the level of facial expressions. Other methods are This will not be repeated here.
  • current facial expression level Previous facial expression level, current facial expression level>previous facial expression level, current facial expression level ⁇ one of the previous facial expression levels.
  • Step S105 According to the first comparison result, an image effect corresponding to the first comparison result is generated in the first image.
  • an image effect corresponding to the comparison result is generated at a predetermined position in the first image.
  • the image effect may be displaying star ratings, displaying animation, and so on.
  • the generating an image effect corresponding to the first comparison result in the first image according to the first comparison result includes: obtaining the image effect corresponding to the first comparison result according to the first comparison result
  • the image effect configuration file and resource corresponding to the first comparison result includes: obtaining the image effect corresponding to the first comparison result according to the first comparison result
  • the image effect configuration file and resource corresponding to the first comparison result includes: obtaining the image effect corresponding to the first comparison result according to the first comparison result
  • the image effect configuration file and resource corresponding to the first comparison result includes: obtaining the image effect corresponding to the first comparison result according to the first comparison result
  • the image effect configuration file and resource corresponding to the first comparison result includes: obtaining the image effect corresponding to the first comparison result according to the first comparison result
  • the image effect configuration file and resource corresponding to the first comparison result includes: obtaining the image effect corresponding to the first comparison result according to the first comparison result
  • the image effect configuration file and resource corresponding to the first comparison result includes: obtaining the image effect corresponding to the first comparison result according
  • the image effect configuration file and resource corresponding to the result are acquired and rendered in the first image
  • An image effect that represents the current face image level> the previous face image level for example, using stars to indicate that if the previously rendered image effect is 2 stars, then 3 stars can be rendered currently;
  • the first comparison result is that the level of the current face image ⁇ the level of the previous face image
  • the image effect profile and resource corresponding to the result are obtained, and the current person is rendered in the first image
  • the default facial expression becomes a trigger condition of the image effect, and only when the current facial expression level>default facial expression The first rendering of the image effect will be triggered when the expression is expressed.
  • a transparent image effect can be rendered first, and after the first rendering of the image effect is triggered, the transparent image effect can be rendered with colors.
  • the display position may be determined by the facial feature points
  • the image effect configuration file includes the associated parameters of the display position, and the associated parameters describe which facial feature points are associated with the image effect sequence frame, which can be associated by default All feature points can also be set to follow several feature points.
  • the image effect configuration file also includes the positional relationship between the image effect and the feature point parameter "point", "point” can include two sets of associated points, "point0” means the first set of associated points, and "point1" means Second Group.
  • point can include any group of related points, and is not limited to two groups.
  • two anchor points can be obtained, and the image effect moves following the positions of the two anchor points.
  • the coordinates of each feature point can be obtained from the facial feature points obtained in step S102.
  • the display size may be a fixed size, and the active area of the image effect and the size of the area are directly configured in the image effect configuration file; in another optional embodiment, the display size may be dynamic Yes, according to the position of the face, the area of the image effect is scaled.
  • the image effect configuration file may also include the relationship between the scaling degree of the image effect and the feature points, which are described by the parameters "scaleX” and “scaleY” respectively The scaling requirements in the x and y directions are eliminated. For each direction, two parameters "start_idx” and “end_idx” are included, which correspond to two feature points, and the distance between these two feature points is multiplied by the value of "factor" to obtain the scaling strength.
  • the factor is a preset value and can be any value.
  • For scaling if there is only a set of associated points "point0" in “position”, then the x direction is the actual horizontal right direction; the y direction is the actual vertical downward direction; both "scaleX” and “scaleY” will take effect, if If there is any missing, the original aspect ratio of the image effect will be maintained according to the existing parameter. If both "point0" and “point1" in “position”, then the x direction is the vector direction obtained by point1.anchor-point0.anchor; the y direction is determined by rotating the x direction 90 degrees clockwise; “scaleX” is invalid, and the x direction The zoom is determined by the anchor point. “scaleY” will take effect. If “scaleY” is missing, the original aspect ratio of the image effect will be maintained for zooming.
  • the color and transparency of the image effect can be directly configured in the image effect configuration file.
  • the UV map of the image effect can be configured, and the color in the UV map corresponds to the rendering of the image effect.
  • Color the image effect can be set to be opaque by default, so that the area of the image effect completely covers the corresponding area in the first image;
  • the animation behavior configuration file may also include a rendering blending mode, the rendering blending Refers to mixing two colors together. Specifically in this disclosure, it refers to mixing the color of a certain pixel position with the color to be drawn to achieve special effects, and the rendering blending mode refers to the method used for mixing Generally speaking, the mixing method refers to the calculation of the source color and the target color to obtain the mixed color.
  • BLENDcolor SRC_color*SCR_factor+DST_color*DST_factor, where BLENDcolor is the mixed color, SRC_color is the source color, SCR_factor is the weight of the source color in the mixed color, and DST_color is Target color, DST_factor is the weight of the target color in the mixed color, where 0 ⁇ SCR_factor ⁇ 1, 0 ⁇ DST_factor ⁇ 1.
  • the above hybrid method is just an example. In practical applications, you can define or select the hybrid method by yourself.
  • the calculation can be addition, subtraction, multiplication, division, taking the larger of the two, taking the smaller of the two, logical operations (And, OR, XOR, etc.).
  • the above hybrid method is just an example. In practical applications, you can define or select the hybrid method yourself.
  • the calculation can be addition, subtraction, multiplication, division, taking the larger of the two, taking the smaller of the two, and logical operation (And, OR, XOR, etc.).
  • an image effect can be designed to give a star rating to a smiling face in a face image, and a star bar can be displayed around the face.
  • a star rating When the smile on the face is higher than the previous If the smile level is high, the star rating will be increased.
  • the smile of the face When the smile of the face is lower than the previous smile, the star rating will be decreased.
  • the number of stars has nothing to do with the absolute level of the current smile on the face, but only with the previous smile of the current smile. Level related.
  • the method may further include: when the facial expression of the facial image is recognized for the first time, acquiring an image effect profile corresponding to the facial expression of the facial image.
  • the image effect configuration file corresponding to the facial expression of the facial image is acquired.
  • An image effect configuration file is set, and an image effect configuration file corresponding to the first comparison result is generated.
  • the image effect configuration file corresponding to the first comparison result is acquired to render the image effect.
  • a first image is acquired, and the first image includes a face image.
  • the first image is a video image frame collected by an image sensor, and the video image frame includes Face image; as shown in Figure 2a, recognize the current facial expression of the face image; obtain the previous facial expression; compare the current facial expression with the previous facial expression to obtain the first comparison result; according to The first comparison result generates an image effect corresponding to the first comparison result in the first image.
  • the facial expression is a smile
  • the image effect of starring the human face is generated according to the degree of smile of the human face.
  • the human face has no smile at the beginning, which is different from the default previous human face.
  • the smile level is low, so the image effect is not rendered;
  • the smile level of the face gradually becomes higher, and the smile level of each current face is higher than the previous smile, so the image effect
  • the stars in the image gradually increase; as shown in Figure 2f-2g, the smile level of the human face gradually decreases, and the smile of each current human face is lower than the previous smile, so the stars in the image effect gradually decrease.
  • an image effect of starring a smile on a face can be realized.
  • the number of stars in the star is determined by the degree of the current expression and the degree of the previous expression, and has nothing to do with the absolute degree of the expression. In this way, it is convenient for the user to know which one is better than the previous smile.
  • FIG. 3 is a flowchart of Embodiment 2 of the emoticon image effect generation method provided by an embodiment of the disclosure.
  • the emoticon image effect generation method provided in this embodiment may be executed by an emoticon image effect generating device, which may Implemented as software, or as a combination of software and hardware, the expression image effect generation device can be integrated in a device in an image processing system, such as an image processing server or an image processing terminal device. As shown in Figure 3, the method includes the following steps:
  • Step S301 Acquire a first image, where the first image includes at least two face images;
  • Step S302 identifying the current facial expression of each of the at least two facial images
  • Step S303 obtaining the previous facial expression for the current facial expression of each facial image
  • Step S304 For the facial expression of each facial image, compare the current facial expression with the previous facial expression to obtain a first comparison result of the facial expression of each facial image;
  • Step S305 According to the first comparison result of the facial expression of each face image, an image effect corresponding to the first comparison result of the facial expression of each facial image is generated in the first image.
  • the recognition of multiple faces is involved, that is, the first image includes multiple face images. At this time, each face image is processed as described in the first embodiment. In the first image It is easy to see whether multiple facial expressions are of higher or lower level compared to the previous facial expressions.
  • step S302 after identifying the face table of each of the at least two face images, it may further include:
  • step S306 when the facial expression of each facial image is recognized for the first time, a corresponding image effect profile is obtained for the facial expression of each facial image.
  • an independent image effect profile is generated.
  • the configuration file is independent, and the expression of each face can be independently configured to produce different image effects for multiple expressions of multiple faces.
  • the present disclosure discloses an expression image effect generation method, device, electronic equipment and computer readable storage medium.
  • the method for generating the expression image effect includes: obtaining a first image, the first image including a face image; identifying the current facial expression of the face image; obtaining the previous facial expression; comparing the current face
  • the expression and the previous facial expression are used to obtain a first comparison result; according to the first comparison result, an image effect corresponding to the first comparison result is generated in the first image.
  • the embodiment of the present disclosure solves the technical problem in the prior art that users cannot quickly learn the degree of their own expressions by comparing the current expressions of the human face with the previous expressions to generate image effects.
  • the apparatus 400 includes: a first image acquisition module 401, an expression recognition module 402, a previous expression acquisition module 403, A comparison module 404 and an expression image effect generation module 405. among them,
  • the first image acquisition module 401 is configured to acquire a first image, and the first image includes a face image;
  • the facial expression recognition module 402 is used to recognize the current facial expression of the facial image
  • the previous expression acquiring module 403 is used to acquire previous facial expressions
  • the comparison module 404 is used to compare the current facial expression with the previous facial expression to obtain the first comparison result
  • the expression image effect generation module 405 is configured to generate an image effect corresponding to the first comparison result in the first image according to the first comparison result.
  • the first image acquisition module 401 further includes:
  • the first video acquisition module is configured to acquire a first video, and at least one video frame in the first video includes a face image.
  • the expression recognition module 402 further includes:
  • a facial image recognition module configured to recognize a facial image in the first image
  • An expression feature extraction module configured to extract current facial expression features from the face image
  • the expression recognition sub-module is used to recognize the current facial expressions according to the current facial expression features.
  • previous expression acquiring module 403 further includes:
  • the default expression obtaining module is used to obtain a default previous facial expression, which is a facial expression preset before the facial expression of the facial image is recognized.
  • previous expression obtaining module 403 is also used for:
  • comparison module 404 further includes:
  • the level comparison module is used to compare the level of the current facial expression with the level of the previous facial expression, and obtain the relationship between the level of the current facial expression and the level of the previous facial expression.
  • the expression image effect generation module 405 further includes:
  • a configuration file obtaining module configured to obtain an image effect configuration file corresponding to the first comparison result according to the first comparison result
  • the rendering module is configured to render the image effect in the first image according to the image effect configuration file.
  • the device shown in FIG. 4 can execute the method of the embodiment shown in FIG. Refer to the description in the embodiment shown in FIG. 1 for the execution process and technical effects of this technical solution, and will not be repeated here.
  • FIG. 5 is a schematic structural diagram of Embodiment 2 of an expression image effect generation apparatus provided by an embodiment of the disclosure.
  • the apparatus 500 includes: a second image acquisition module 501, a first expression recognition module 502, and a first previous expression An acquisition module 503, a first comparison module 504, and a first expression image effect generation module 505. among them,
  • the second image acquisition module 501 acquires a first image, where the first image includes at least two face images;
  • the first facial expression recognition module 502 recognizes the current facial expression of each facial image in the at least two facial images
  • the first comparison module 504 is configured to compare the current facial expression with the previous facial expression for the facial expression of each facial image, and obtain a first comparison result of the facial expression of each facial image;
  • the first expression image effect generation module 505 is configured to generate, in the first image, a first comparison result with the facial expression of each facial image according to the first comparison result of the facial expression of each facial image The corresponding image effect.
  • the device 500 may also include:
  • the image effect profile acquisition module 506 is used for acquiring the corresponding image effect profile for the facial expression of each facial image when the facial expression of each facial image is recognized for the first time.
  • the device in the second embodiment shown in FIG. 5 can execute the method of the embodiment shown in FIG. 3.
  • parts that are not described in detail in this embodiment please refer to the related description of the embodiment shown in FIG. 3.
  • the implementation process and technical effects of this technical solution refer to the description in the embodiment shown in FIG. 3, which will not be repeated here.
  • FIG. 6 shows a schematic structural diagram of an electronic device 600 suitable for implementing embodiments of the present disclosure.
  • the electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (such as Mobile terminals such as car navigation terminals) and fixed terminals such as digital TVs, desktop computers, etc.
  • the electronic device shown in FIG. 6 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • the electronic device 600 may include a processing device (such as a central processing unit, a graphics processor, etc.) 601, which may be loaded to a random access device according to a program stored in a read-only memory (ROM) 602 or from a storage device 608.
  • the program in the memory (RAM) 603 is accessed to execute various appropriate actions and processing.
  • the RAM 603 also stores various programs and data required for the operation of the electronic device 600.
  • the processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also connected to the bus 604.
  • the following devices can be connected to the I/O interface 605: including input devices 606 such as touch screen, touch panel, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; including, for example, liquid crystal display (LCD), speakers, An output device 607 such as a vibrator; a storage device 608 such as a magnetic tape, a hard disk, etc.; and a communication device 609.
  • the communication device 609 may allow the electronic device 600 to perform wireless or wired communication with other devices to exchange data.
  • FIG. 6 shows an electronic device 600 having various devices, it should be understood that it is not required to implement or have all the illustrated devices. It may alternatively be implemented or provided with more or fewer devices.
  • the process described above with reference to the flowchart can be implemented as a computer software program.
  • the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM602.
  • the processing device 601 the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
  • the aforementioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable signal medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: acquires a first image, the first image includes a face image; State the current facial expression of the face image; obtain the previous facial expression; compare the current facial expression with the previous facial expression to obtain a first comparison result; according to the first comparison result, in the first comparison result An image effect corresponding to the first comparison result is generated in the image.
  • the computer program code used to perform the operations of the present disclosure may be written in one or more programming languages or a combination thereof.
  • the above-mentioned programming languages include object-oriented programming languages—such as Java, Smalltalk, C++, and also conventional Procedural programming language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to pass Internet connection).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagram can represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logic function Executable instructions.
  • the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown in succession can actually be executed substantially in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure can be implemented in software or hardware. Among them, the name of the unit does not constitute a limitation on the unit itself under certain circumstances.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Processing Or Creating Images (AREA)

Abstract

一种表情图像效果生成方法、装置、电子设备和计算机可读存储介质。其中该表情图像效果生成方法包括:获取第一图像,所述第一图像中包括人脸图像(S101);识别所述人脸图像的当前的人脸表情(S102);获取先前的人脸表情(S103);比较当前的人脸表情和先前的人脸表情,得到第一比较结果(S104);根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果(S105)。该方法通过比较人脸当前的表情和先前的表情,产生图像效果的方法,解决了现有技术中用户无法快速得知自己的表情程度的技术问题。

Description

表情图像效果生成方法、装置和电子设备
相关申请的交叉引用
本申请要求于2019年01月31日提交的,申请号为201910101357.1、发明名称为“表情图像效果生成方法、装置和电子设备”的中国专利申请的优先权,该申请的全文通过引用结合在本申请中。
技术领域
本公开涉及图像处理领域,尤其涉及一种表情图像效果生成方法、装置、电子设备及计算机可读存储介质。
背景技术
随着计算机技术的发展,智能终端的应用范围得到了广泛的提高,例如可以通过智能终端听音乐、玩游戏、上网聊天和拍照等。对于智能终端的拍照技术来说,其拍照像素已经达到千万像素以上,具有较高的清晰度和媲美专业相机的拍照效果。
目前在采用智能终端进行拍照时,不仅可以使用出厂时内置的拍照软件实现传统功能的拍照效果,还可以通过从网络端下载应用程序(Application,简称为:APP)来实现具有附加功能的拍照效果,例如可以实现暗光检测、美颜相机和超级像素等功能的APP。智能终端目前可以对人脸进行识别或者进一步对人脸的表情进行识别,比如在安全领域中对特性的人脸进行识别以通过验证,在图像中识别出人脸并对人脸进行优化处理,对人脸的表情进行识别来判断人的情绪等。
然而目前的表情识别,只能判断人脸的表情类型,而无法判断人脸表情的程度;在图像中存在多个人脸时,也无法快速得到达到目标表情的人脸;因此如何快速提示用户人脸表情的程度成为亟待解决的问题。
发明内容
第一方面,本公开实施例提供一种表情图像效果生成方法,包括:
获取第一图像,所述第一图像中包括人脸图像;
识别所述人脸图像的当前的人脸表情;
获取先前的人脸表情;
比较当前的人脸表情和先前的人脸表情,得到第一比较结果;
根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果。
进一步的,所述获取第一图像,所述第一图像中包括人脸图像,包括:
获取第一视频图像,所述第一视频中的至少一个视频帧中包括人脸图像。
进一步的,所述识别所述人脸图像的当前人脸表情,包括:
识别所述第一图像中的人脸图像;
在所述人脸图像中提取当前人脸表情特征;
根据所述当前人脸表情特征对当前人脸表情进行识别。
进一步的,所述获取先前的人脸表情,包括:
获取默认的先前的人脸表情,所述默认的先前的人脸表情为识别出人脸图像的人脸表情之前预先设置的人脸表情。
进一步的,所述获取先前的人脸表情,包括:
获取上一采样时刻的人脸表情或者获取上一视频帧中的人脸表情。
进一步的,所述比较当前的人脸表情和先前的人脸表情,得到第一比较结果,包括:
比较当前的人脸表情的等级和先前的人脸表情的等级,得到当前的人脸表情的等级和先前的人脸表情的等级的大小关系。
进一步的,所述根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果,包括:
根据所述第一比较结果,获取与所述第一比较结果对应的图像效果配置文件;
根据所述图像效果配置文件,在所述第一图像中渲染出所述图像效果。
进一步的,所述获取第一图像,所述第一图像中包括人脸图像,包括:
获取第一图像,所述第一图像中包括至少两个人脸图像。
进一步的,所述识别所述人脸图像的当前的人脸表情,包括:
识别所述至少两个人脸图像中的每一个人脸图像的当前的人脸表情。
进一步的,在所述识别所述至少两个人脸图像中的每一个人脸图像的当 前的人脸表情之后,还包括:
在第一次识别出每个人脸图像的人脸表情时,针对每一个人脸图像的人脸表情,获取对应的图像效果配置文件。
进一步的,所述获取先前的人脸表情,包括:
对每个人脸图像的当前的人脸表情,获取先前的人脸表情。
进一步的,所述比较当前的人脸表情和先前的人脸表情,得到第一比较结果,包括:
针对每个人脸图像的人脸表情,比较当前的人脸表情和先前的人脸表情,得到每个人脸图像的人脸表情的第一比较结果。
进一步的,所述根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果,包括:
根据每个人脸图像的人脸表情的第一比较结果,在所述第一图像中生成与所述每个人脸图像的人脸表情的第一比较结果对应的图像效果。
第二方面,本公开实施例提供一种表情图像效果生成装置,包括:
第一图像获取模块,用于获取第一图像,所述第一图像中包括人脸图像;
表情识别模块,用于识别所述人脸图像的当前的人脸表情;
先前表情获取模块,用于获取先前的人脸表情;
比较模块,用于比较当前的人脸表情和先前的人脸表情,得到第一比较结果;
表情图像效果生成模块,用于根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果。
进一步的,所述第一图像获取模块,还包括:
第一视频获取模块,用于获取第一视频,所述第一视频中的至少一个视频帧中包括人脸图像。
进一步的,所述表情识别模块,还包括:
人脸图像识别模块,用于识别所述第一图像中的人脸图像;
表情特征提取模块,用于在所述人脸图像中提取当前人脸表情特征;
表情识别子模块,用于根据所述当前人脸表情特征对当前人脸表情进行识别。
进一步的,所述先前表情获取模块,还包括:
默认表情获取模块,用于获取默认的先前的人脸表情,所述默认的先前的人脸表情为识别出人脸图像的人脸表情之前预先设置的人脸表情。
进一步的,所述先前表情获取模块,还用于:
获取上一采样时刻的人脸表情或者获取上一视频帧中的人脸表情。
进一步的,所述比较模块,还包括:
等级比较模块,用于比较当前的人脸表情的等级和先前的人脸表情的等级,得到当前的人脸表情的等级和先前的人脸表情的等级的大小关系。
进一步的,所述表情图像效果生成模块,还包括:
配置文件获取模块,用于根据所述第一比较结果,获取与所述第一比较结果对应的图像效果配置文件;
渲染模块,用于根据所述图像效果配置文件,在所述第一图像中渲染出所述图像效果。
第三方面,本公开实施例提供一种表情图像效果生成装置,包括:
第二图像获取模块,获取第一图像,所述第一图像中包括至少两个人脸图像;
第一表情识别模块,识别所述至少两个人脸图像中的每一个人脸图像的当前的人脸表情;
第一先前表情获取模块,对每个人脸图像的当前的人脸表情,获取先前的人脸表情
第一比较模块,用于针对每个人脸图像的人脸表情,比较当前的人脸表情和先前的人脸表情,得到每个人脸图像的人脸表情的第一比较结果;
第一表情图像效果生成模块,用于根据每个人脸图像的人脸表情的第一比较结果,在所述第一图像中生成与所述每个人脸图像的人脸表情的第一比较结果对应的图像效果。
进一步的,所述装置,还可以包括:
图像效果配置文件获取模块,用于在第一次识别出每个人脸图像的人脸表情时,针对每一个人脸图像的人脸表情,获取对应的图像效果配置文件。
第四方面,本公开实施例提供一种电子设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有能被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行, 以使所述至少一个处理器能够执行前述第一方面中的任一所述表情图像效果生成方法。
第五方面,本公开实施例提供一种非暂态计算机可读存储介质,其特征在于,该非暂态计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行前述第一方面中的任一所述表情图像效果生成方法。
本公开公开了一种表情图像效果生成方法、装置、电子设备和计算机可读存储介质。其中该表情图像效果生成方法包括:获取第一图像,所述第一图像中包括人脸图像;识别所述人脸图像的当前的人脸表情;获取先前的人脸表情;比较当前的人脸表情和先前的人脸表情,得到第一比较结果;根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果。本公开实施例通过比较人脸当前的表情和先前的表情,产生图像效果的方法,解决了现有技术中用户无法快速得知自己的表情程度的技术问题。
上述说明仅是本公开技术方案的概述,为了能更清楚了解本公开的技术手段,而可依照说明书的内容予以实施,并且为让本公开的上述和其他目的、特征和优点能够更明显易懂,以下特举较佳实施例,并配合附图,详细说明如下。
附图说明
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的表情图像效果生成方法实施例一的流程图;
图2a-2g为本公开实施例提供的表情图像效果生成方法的具体实例示意图;
图3为本公开实施例提供的表情图像效果生成方法实施例二的流程图
图4为本公开实施例提供的表情图像效果生成装置实施例一的结构示意图;
图5为本公开实施例提供的表情图像效果生成装置实施例二的结构示意图;
图6为根据本公开实施例提供的电子设备的结构示意图。
具体实施方式
以下通过特定的具体实例说明本公开的实施方式,本领域技术人员可由本说明书所揭露的内容轻易地了解本公开的其他优点与功效。显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。本公开还可以通过另外不同的具体实施方式加以实施或应用,本说明书中的各项细节也可以基于不同观点与应用,在没有背离本公开的精神下进行各种修饰或改变。需说明的是,在不冲突的情况下,以下实施例及实施例中的特征可以相互组合。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
需要说明的是,下文描述在所附权利要求书的范围内的实施例的各种方面。应显而易见,本文中所描述的方面可体现于广泛多种形式中,且本文中所描述的任何特定结构及/或功能仅为说明性的。基于本公开,所属领域的技术人员应了解,本文中所描述的一个方面可与任何其它方面独立地实施,且可以各种方式组合这些方面中的两者或两者以上。举例来说,可使用本文中所阐述的任何数目个方面来实施设备及/或实践方法。另外,可使用除了本文中所阐述的方面中的一或多者之外的其它结构及/或功能性实施此设备及/或实践此方法。
还需要说明的是,以下实施例中所提供的图示仅以示意方式说明本公开的基本构想,图式中仅显示与本公开中有关的组件而非按照实际实施时的组件数目、形状及尺寸绘制,其实际实施时各组件的型态、数量及比例可为一种随意的改变,且其组件布局型态也可能更为复杂。
另外,在以下描述中,提供具体细节是为了便于透彻理解实例。然而,所属领域的技术人员将理解,可在没有这些特定细节的情况下实践所述方面。
图1为本公开实施例提供的表情图像效果生成方法实施例一的流程图,本实施例提供的该表情图像效果生成方法可以由一表情图像效果生成装置来执行,该表情图像效果生成装置可以实现为软件,或者实现为软件和硬件的组合,该表情图像效果生成装置可以集成设置在图像处理系统中的某设备中,比如图像处理服务器或者图像处理终端设备中。如图1所示,该方法包括如下步骤:
步骤S101,获取第一图像,所述第一图像中包括人脸图像;
在一个实施例中,所述获取第一图像,包括从本地存储空间中获取第一图像或者从网络存储空间中获取第一图像,无论从哪里获取第一图像,首选需要获取第一图像的存储地址,之后从该存储地址获取第一图像,所述第一图像可以是视频图像也可以是图片,或者是带有动态效果的图片,在此不再赘述。
在一个实施例中,所述获取第一图像,包括获取第一视频,所述第一视频中的至少一个视频帧中包括人脸图像。在该实施例中,所述第一视频可以通过图像传感器来获取,图像传感器指可以采集图像的各种设备,典型的图像传感器为摄像机、摄像头、相机等。在该实施例中,所述图像传感器可以是移动终端上的摄像头,比如智能手机上的前置或者后置摄像头,摄像头采集的视频图像可以直接显示在手机的显示屏上,在该步骤中,获取图像传感器所拍摄的视频,用于在下一步进一步识别图像。
在该步骤中,所述第一图像中包括人脸图像,人脸图像是人脸表情的基础,在该实施例中,如果所述第一图像为图片,则图片中至少包括一个人脸图像,如果所述第一图像为视频,则所述第一图像中的视频帧中至少有一个视频帧中包括至少一个人脸图像。
步骤S102,识别所述人脸图像的当前人脸表情;
在一个实施例中,识别所述人脸图像的当前人脸表情,包括:识别所述第一图像中的人脸图像;在所述人脸图像中提取当前人脸表情特征;根据所述当前人脸表情特征对当前人脸表情进行识别。
识别人脸图像中的人脸表情,首先需要对图像中的人脸进行检测。人脸检测是任意给定一个图像或者一组图像序列,采用一定策略对其进行搜索,以确定所有人脸的位置和区域的一个过程,从各种不同图像或图像序列中确定人脸是否存在,并确定人脸数量和空间分布的过程。通常人脸检测的方法可以分为4类:(1)基于先验知识的方法,该方法将典型的人脸形成规则库对人脸进行编码,通过面部特征之间的关系进行人脸定位;(2)特征不变方法,该方法在姿态、视角或光照条件改变的情况下找到稳定的特征,然后使用这些特征确定人脸;(3)模板匹配方法,该方法存储几种标准的人脸模式,用来分别描述整个人脸和面部特征,然后计算输入图像和存储的模式间的相互关系并用于检测;(4)基于外观的方法,该方法与模板匹配方法相反,从训练图 像集中进行学习从而获得模型,并将这些模型用于检测。在此可以使用第(4)种方法中的一个实现方式来说明人脸检测的过程:首先需要提取特征完成建模,本实施例使用Haar特征作为判断人脸的关键特征,Haar特征是一种简单的矩形特征,提取速度快,一般Haar特征的计算所使用的特征模板采用简单的矩形组合由两个或多个全等的矩形组成,其中特征模板内有黑色和白色两种矩形;之后,使用AdaBoost算法从大量的Haar特征中找到起关键作用的一部分特征,并用这些特征产生有效的分类器,通过构建出的分类器可以对图像中的人脸进行检测。在人脸检测过程中,可以检测到多个人脸特征点,典型的可以使用106个特征点来识别人脸。
在检测到人脸图像之后,可以进一步对所述人脸图像做预处理,以便下一步识别人脸的表情。图像预处理的好坏直接影响表情特征提取的准确性和表情分类的效果,从而影响表情识别的准确率。人脸图像预处理主要包括去噪,进行尺度、灰度的归一化等。输入的图像通常具有比较复杂的场景,由人脸检测获取的人脸图像大小、长宽比例、光照条件、局部是否遮、头部偏转通常是不一样的,为了后续提取特征的统一处理,就需要将它们的尺寸、光照、头部姿态的矫正等进行归一化处理,改善图像质量,为进一步分析和理解面部表情做好准备。
在预处理之后,对人脸表情特征进行提取。面部表情特征提取的方法很多,根据图片的来源是否为静态还是动态的分为基于运动和基于形变的表情特征提取。基于运动的特征提取方法,主要根据序列图像中面部特征点的相对位置和距离的变动来描述表情变化,具体有光流法、运动模型、特征点跟踪等,此类方法鲁棒性好;基于形变的特征提取方法,主要用于静态图片提取特征,依靠与自然表情模型的外观或纹理对比获取模型特征,典型的算法有基于活动外观模型(AAM)和点分布模型(PDM)、基于纹理特征Gabor变换和局部二进制模式LBP。
提取人脸表情特征之后,进行人脸表情分类。表情分类即把前一阶段提取到的表情特征送入训练好的分类器或回归器,让分类器或回归器给出一个预测的值,判断表情特征所对应的表情类别。目前常见的表情分类的算法主要有线性分类器、神经网络分类器、支持向量机SVM、隐马尔可夫模型等分类识别方法。
可以理解的是,上述提到的人脸检测、人脸图像预处理、表情特征提取以及人脸表情分类的方法均为便于理解的举例,实际上任何可以识别人脸表情的方法均可以用到本公开的技术方案中,在此不再赘述。
步骤S103,获取先前的人脸表情;
在该步骤中,可以分为两种情况,第一种情况为当前时间为初始时间,也就是说第一次识别到人脸表情,此时实际上没有先前的人脸表情,因此在这种情况下,可以预先设置一个默认的人脸表情,该默认的人脸表情为识别出人脸图像的人脸表情之前预先设置的人脸表情;第二种情况为当前时间不是初始时间,也就是说在识别当前人脸表情之前已经识别过人脸表情了,此时先前的人脸表情为上一采样时间采集的人脸表情,比如采样时间为100ms,则先前的人脸表情为100ms之前所识别的人脸表情,而当前所识别出的人脸表情为100ms之后所识别的人脸表情的先前的人脸表情,在第二种情况中,还可以以上一视频帧中的人脸表情作为当前视频帧的人脸表情的先前的人脸表情。
步骤S104,比较当前的人脸表情和先前的人脸表情,得到第一比较结果;
在一个实施例中,所述比较当前的人脸表情和先前的人脸表情,得到第一比较结果,包括:比较当前的人脸表情的等级和先前的人脸表情的等级,得到当前的人脸表情的等级和先前的人脸表情的等级的大小关系。
在该实施例中,首先需要判断所述人脸表情的等级,所示判断所述人脸表情的等级,包括:将所述人脸表情与预设的模板表情进行对比;将与所述人脸表情的匹配度最高的模板表情的等级作为所述人脸表情的等级。所述的等级可以为表情的程度,可选的所述表情为笑脸,可以将所述笑脸分为多个等级,如可以分为100个等级,每个等级有一个标准的模板人脸表情图像与之对应,在判断所述人脸表情的等级时,将人脸的表情与这100个等级的模板人脸表情图像作对比,将匹配度最高的模板人脸表情图像所对应的等级作为所述人脸表情的等级。
可选的,所述判断所述人脸表情的等级,包括:将所述人脸表情与预设的模板表情进行对比;将所述人脸表情与预设的模板表情相似度作为所述人脸表情的等级。在该实施例中,所述模板人脸表情图像可以只有1个,将所 识别出的人脸表情与所述模板人脸表情图像作对比,所述对比的结果为一个相似度百分比,如对比之后得到人脸表情与所述模板人脸表情图像的相似度为90%,则可以得到所述人脸表情的等级为90级。
可以理解的,上述判断人脸表情的等级的具体实例仅为举例,不构成对本公开的限制,任何能够对人脸表情进行等级判断的方法,均可以应用到本公开中来,典型的,可以使用分类器的方法,将人脸表情的等级对应为不同的类别,使用样本对分类器进行训练,之后将识别出的人脸表情输入分类器中直接得出人脸表情的等级,其他方式在此不再赘述。
在得到当前人脸表情的等级和先前人脸表情的等级之后,可以通过比较两个等级的大小得到当前人脸表情的等级和先前人脸表情的等级关系,结果为:当前人脸表情等级=先前人脸表情等级,当前人脸表情等级>先前人脸表情等级,当前人脸表情等级<先前人脸表情等级中的一个。
步骤S105,根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果。
在该步骤中,根据当前人脸表情与先前人脸表情的比较结果,在第一图像中的预定位置上生成与所述比较结果对应的图像效果。可选的,所述图像效果可以是显示星级,显示动画等等。
在一个实施例中,所述根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果,包括:根据所述第一比较结果,获取与所述第一比较结果对应的图像效果配置文件和资源;根据所述图像效果配置文件和资源,在所述第一图像中渲染出所述图像效果。其中所述图像效果配置文件,用于配置图像效果的显示属性,如显示位置、显示大小、颜色、透明度等等;所述配置文件还用于配置所述图像效果中所使用的资源,如贴图、三维粒子等等。可选的,当所述第一比较结果为当前的人脸图像的等级>先前的人脸图像的等级,则获取与该结果对应的图像效果配置文件和资源,并在第一图像中渲染出表示当前的人脸图像等级>先前的人脸图像的等级的图像效果,比如使用星级来表示,如果先前渲染出的图像效果中为2星,则当前可以渲染出3星;可选的,当所述第一比较结果为当前的人脸图像的等级<先前的人脸图像的等级,则获取与该结果对应的图像效果配置文件和资源,并在第一图像中渲染出表示当前的人脸图像等级>先前的人脸图像的等 级的图像效果,比如使用星级来表示,如果先前渲染出的图像效果中为3星,则当前可以渲染出2星;可选的,当所述第一比较结果为当前的人脸图像的等级=先前的人脸图像的等级,则保持图像效果不变。
可以理解的,当先前的人脸表情为默认的人脸表情时,所述默认的人脸表情即成为所述图像效果的一个触发条件,只有在当前的人脸表情的等级>默认的人脸表情时,才会触发第一次图像效果的渲染。
在一个实施例中,也可以在识别出人脸表情之后,先渲染出透明的图像效果,当触发了第一次图像效果的渲染之后,再对透明的图像效果渲染颜色。
可选的,所述显示位置可以由人脸特征点决定,所述图像效果配置文件中包括显示位置的关联参数,所述关联参数描述图像效果序列帧关联哪几个人脸特征点,默认可以关联所有特征点,也可以设置跟随其中的几个特征点。除了关联参数外,图像效果配置文件中还包括图像效果与特征点的位置关系参数"point","point"中可以包括两组关联点,"point0"表示第一组关联点,"point1"表示第二组。对于每一组关联点,"point"描述了camera中的锚点位置,通过对若干组特征点及其权重,求加权平均得到;举例来说,设置图像效果跟随人脸的4个特征点,分别为9号、10号、11号和12号特征点,且每个特征点的权重为0.25,其中每个特征点的坐标分别为(X9,Y9),(X10,Y10),(X11,Y11),(X12,Y12),则可以得到图像效果所跟随的锚点的X轴坐标为Xa=X9*0.25+X10*0.25+X11*0.25+X12*0.25,锚点的Y轴坐标为Ya=Y9*0.25+Y10*0.25+Y11*0.25+Y1215*0.25。可以理解的是,"point"中可以包括任一组关联点,并不局限于两组。在上述具体实例中,可以得到两个锚点,图像效果跟随这两个锚点的位置发生移动。而实际上,锚点可以不止两个,这与所使用的关联点的组数有关。其中每个特征点的坐标可以有步骤S102中所获取的人脸特征点中获得。
可选的,所述显示大小可以是固定的大小,在图像效果配置文件中直接配置图像效果的作用区域以及该区域的大小;在另一个可选的实施例中,所述显示大小可以是动态的,根据人脸的位置对图像效果的作用区域进行缩放,此时所述图像效果配置文件中还可以包括图像效果的缩放程度与特征点的关系,使用参数"scaleX"和"scaleY"分别描述了x和y方向的缩放需求。对于每个方向,都包括两个参数"start_idx"和"end_idx",其对应了两个特征点, 这两个特征点之间的距离乘以"factor"的值后得到缩放的强度。其中factor为预先设置的值,可以为任意值。对于缩放来说,如果"position"中只有一组关联点"point0",那么x方向就是实际的水平向右方向;y方向为实际垂直向下方向;"scaleX"和"scaleY"都会生效,如果任一有缺失,则按照存在的那个参数保持图像效果原始长宽比进行缩放。如果"position"中"point0"和"point1"都有,那么x方向为point1.anchor-point0.anchor得到的向量方向;y方向由x方向顺时针旋转90度确定;"scaleX"无效,x方向的缩放由锚点跟随决定。"scaleY"会生效,若"scaleY"缺失,则保持图像效果原始长宽比进行缩放。
可选的,所述图像效果的颜色和透明度可以直接在所述图像效果配置文件中配置,典型的,可以配置所述图像效果的UV图,根据所述UV图中的颜色对应渲染图像效果的颜色,默认可以设置所述图像效果不透明,这样图像效果的区域完全覆盖第一图像中的对应区域即可;可选的,所述动画行为配置文件中还可以包括渲染混合模式,所述渲染混合是指将两种颜色混合在一起,具体到本公开中是指将某一像素位置的颜色与将要画上去的颜色混合在一起,从而实现特殊效果,而渲染混合模式是指混合所使用的方式,一般来说混合方式是指将源颜色和目标颜色做计算,得出混合后的颜色,在实际应用中常常将源颜色乘以源因子得到的结果与目标颜色乘以目标因子得到的结果做计算,得到混合后的颜色,以加法为例,则BLENDcolor=SRC_color*SCR_factor+DST_color*DST_factor,其中BLENDcolor为混合后的颜色,SRC_color为源颜色,SCR_factor为源颜色在混合颜色中的权重,DST_color为目标颜色,DST_factor为目标颜色在混合颜色中的权重,其中0≤SCR_factor≤1,0≤DST_factor≤1。根据上述运算公式,假设源颜色的四个分量(指红色,绿色,蓝色,alpha值)是(Rs,Gs,Bs,As),目标颜色的四个分量是(Rd,Gd,Bd,Ad),又设源因子为(Sr,Sg,Sb,Sa),目标因子为(Dr,Dg,Db,Da)。则混合产生的新颜色可以表示为:(Rs*Sr+Rd*Dr,
Gs*Sg+Gd*Dg,Bs*Sb+Bd*Db,As*Sa+Ad*Da),其中alpha值表示透明度,0≤alpha≤1。上述混合方式仅仅是举例,实际应用中,可以自行定义或者选择混合方式,所述计算可以是加、减、乘、除、取两者中较大的、取两者中较小的、逻辑运算(和、或、异或等等)。上述混合方式仅仅是举例,实际应用中,可以自行定义或者选择混合方式,所述计算可以是加、减、乘、 除、取两者中较大的、取两者中较小的、逻辑运算(和、或、异或等等)。
通过上述图像效果配置文件,可以根据所述第一比较结果,显示与该比较结果对应的图像效果,且该图像效果可以随着人脸表情的变化以及人脸位置的变化而变化。典型的,利用上述实施例中的技术方案,可以设计一种给人脸图像中的笑脸打星级的图像效果,可以在人脸的周围显示一个星级条,当人脸的笑容比先前的笑容程度高,则增加星级,当人脸的笑容比先前的笑容程度低,则减少星级,所述星级的多少与当前人脸笑容的绝对等级无关,只与当前笑容的先前笑容的等级有关。
在本公开中,在步骤S102之后,还可以包括:在第一次识别出人脸图像的人脸表情时,获取与所述人脸图像的人脸表情对应的图像效果配置文件。
在第一次识别出人脸表情之后,获取与所述人脸图像的人脸表情对应的图像效果配置文件,此时该图像效果配置文件,当执行到步骤S105时,根据第一比较结果,设置图像效果配置文件,生成与所述第一比较结果对应的图像效果配置文件,此时获取所述与所述第一比较结果对应的图像效果配置文件来渲染图像效果。
如图2a-2g所示,为上述实施例的一个具体实例。如图2a所示,获取第一图像,所述第一图像中包括人脸图像,在该实例中,所述第一图像为通过图像传感器采集到的视频图像帧,所述视频图像帧中包括人脸图像;如图2a所示,识别所述人脸图像的当前的人脸表情;获取先前的人脸表情;比较当前的人脸表情和先前的人脸表情,得到第一比较结果;根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果。在该实例中,所述人脸表情为笑容,根据人脸笑容的程度生成对人脸打星级的图像效果,如图2a所示,刚开始人脸没有笑容,与默认的先前的人脸笑容比较,该笑容程度较低,因此未渲染出图像效果;如图2b-2e所示,人脸的笑容程度逐渐变高,每一当前人脸笑容均比先前的笑容程度高,因此图像效果中的星星逐次变多;如图2f-2g所示,人脸的笑容程度逐渐变低,每一当前人脸笑容均比先前的笑容程度低,因此图像效果中的星星逐次变少。由上述实施例可以实现一种对人脸笑容进行打星级的图像效果,该星级中星星的个数由当前表情的程度和先前表情的程度决定,与表情的绝对程度无关。由此可以方便的使用户知道自己当前与先前的笑容相比,哪一个更好。
图3为本公开实施例提供的表情图像效果生成方法实施例二的流程图,本实施例提供的该表情图像效果生成方法可以由一表情图像效果生成装置来执行,该表情图像效果生成装置可以实现为软件,或者实现为软件和硬件的组合,该表情图像效果生成装置可以集成设置在图像处理系统中的某设备中,比如图像处理服务器或者图像处理终端设备中。如图3所示,该方法包括如下步骤:
步骤S301,获取第一图像,所述第一图像中包括至少两个人脸图像;
步骤S302,识别所述至少两个人脸图像中的每一个人脸图像的当前的人脸表情;
步骤S303,对每个人脸图像的当前的人脸表情,获取先前的人脸表情;
步骤S304,针对每个人脸图像的人脸表情,比较当前的人脸表情和先前的人脸表情,得到每个人脸图像的人脸表情的第一比较结果;
步骤S305,根据每个人脸图像的人脸表情的第一比较结果,在所述第一图像中生成与所述每个人脸图像的人脸表情的第一比较结果对应的图像效果。
该实施例中,涉及多个人脸的识别,也就是第一图像中包括了多个人脸图像,这时候,对每个人脸图像均进行如实施例一中所述的处理,在第一图像中可以方便的看出多个人脸表情相对于它之前的人脸表情是等级更高了还是等级更低了。
进一步的,在所述步骤S302,识别所述至少两个人脸图像中的每一个人脸图像的人脸表之后,还可以包括:
步骤S306,在第一次识别出每个人脸图像的人脸表情时,针对每一个人脸图像的人脸表情,获取对应的图像效果配置文件。
在该步骤中,针对每个人脸的每种表情,均生成一个独立的图像效果配置文件。比如当识别到第一图像中包括3个人脸,则将人脸编号为face1、face2和face3,检测到face1人脸的表情为笑脸,将该表情对应的图像效果配置文件命名为face1.ID1,之后根据该图像效果配置文件中的配置参数来显示图像效果;检测到face2人脸的表情为愤怒,则将该表情对应的图像效果配置文件命名为face2.ID2,之后根据该图像效果配置文件中的配置参数来显示图像效果;检测到face3人脸的表情为笑脸,将该表情对应的图像效果配 置文件命名为face3.ID1,之后根据该图像效果配置文件中的配置参数来显示图像效果。这样对于每个人脸的每种表情来说,其配置文件都是独立的,可以对每个人脸的表情进行独立的配置,以产生对多个人脸的多个表情产生不同图像效果的效果。
可以理解的,对于单个人脸的表情识别、等级判断以及图像效果的生成,可以使用实施例一中的技术方案,在此不再赘述。
本公开公开了一种表情图像效果生成方法、装置、电子设备和计算机可读存储介质。其中该表情图像效果生成方法包括:获取第一图像,所述第一图像中包括人脸图像;识别所述人脸图像的当前的人脸表情;获取先前的人脸表情;比较当前的人脸表情和先前的人脸表情,得到第一比较结果;根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果。本公开实施例通过比较人脸当前的表情和先前的表情,产生图像效果的方法,解决了现有技术中用户无法快速得知自己的表情程度的技术问题。
图4为本公开实施例提供的表情图像效果生成装置实施例一的结构示意图,如图4所示,该装置400包括:第一图像获取模块401、表情识别模块402、先前表情获取模块403、比较模块404、表情图像效果生成模块405。其中,
第一图像获取模块401,用于获取第一图像,所述第一图像中包括人脸图像;
表情识别模块402,用于识别所述人脸图像的当前的人脸表情;
先前表情获取模块403,用于获取先前的人脸表情;
比较模块404,用于比较当前的人脸表情和先前的人脸表情,得到第一比较结果;
表情图像效果生成模块405,用于根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果。
进一步的,所述第一图像获取模块401,还包括:
第一视频获取模块,用于获取第一视频,所述第一视频中的至少一个视频帧中包括人脸图像。
进一步的,所述表情识别模块402,还包括:
人脸图像识别模块,用于识别所述第一图像中的人脸图像;
表情特征提取模块,用于在所述人脸图像中提取当前人脸表情特征;
表情识别子模块,用于根据所述当前人脸表情特征对当前人脸表情进行识别。
进一步的,所述先前表情获取模块403,还包括:
默认表情获取模块,用于获取默认的先前的人脸表情,所述默认的先前的人脸表情为识别出人脸图像的人脸表情之前预先设置的人脸表情。
进一步的,所述先前表情获取模块403,还用于:
获取上一采样时刻的人脸表情或者获取上一视频帧中的人脸表情。
进一步的,所述比较模块404,还包括:
等级比较模块,用于比较当前的人脸表情的等级和先前的人脸表情的等级,得到当前的人脸表情的等级和先前的人脸表情的等级的大小关系。
进一步的,所述表情图像效果生成模块405,还包括:
配置文件获取模块,用于根据所述第一比较结果,获取与所述第一比较结果对应的图像效果配置文件;
渲染模块,用于根据所述图像效果配置文件,在所述第一图像中渲染出所述图像效果。
图4所示装置可以执行图1所示实施例的方法,本实施例未详细描述的部分,可参考对图1所示实施例的相关说明。该技术方案的执行过程和技术效果参见图1所示实施例中的描述,在此不再赘述。
图5为本公开实施例提供的表情图像效果生成装置实施例二的结构示意图,如图5所示,该装置500包括:第二图像获取模块501、第一表情识别模块502、第一先前表情获取模块503、第一比较模块504和第一表情图像效果生成模块505。其中,
第二图像获取模块501,获取第一图像,所述第一图像中包括至少两个人脸图像;
第一表情识别模块502,识别所述至少两个人脸图像中的每一个人脸图像的当前的人脸表情;
第一先前表情获取模块503,对每个人脸图像的当前的人脸表情,获取先前的人脸表情;
第一比较模块504,用于针对每个人脸图像的人脸表情,比较当前的人 脸表情和先前的人脸表情,得到每个人脸图像的人脸表情的第一比较结果;
第一表情图像效果生成模块505,用于根据每个人脸图像的人脸表情的第一比较结果,在所述第一图像中生成与所述每个人脸图像的人脸表情的第一比较结果对应的图像效果。
进一步的,所述装置500,还可以包括:
图像效果配置文件获取模块506,用于在第一次识别出每个人脸图像的人脸表情时,针对每一个人脸图像的人脸表情,获取对应的图像效果配置文件。
上述图5中实施例二中的装置可以执行图3所示实施例的方法,本实施例未详细描述的部分,可参考对图3所示实施例的相关说明。该技术方案的执行过程和技术效果参见图3所示实施例中的描述,在此不再赘述。
下面参考图6,其示出了适于用来实现本公开实施例的电子设备600的结构示意图。本公开实施例中的电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图6示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图6所示,电子设备600可以包括处理装置(例如中央处理器、图形处理25器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、图像传感器、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图6示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM602被安装。在该计算机程序被处理装置601执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取第一图像,所述第一图像中包括人脸图像;识别所述人脸图像的当前的人脸表情;获取先前的人脸表情; 比较当前的人脸表情和先前的人脸表情,得到第一比较结果;根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

Claims (16)

  1. 一种表情图像效果生成方法,其特征在于,包括:
    获取第一图像,所述第一图像中包括人脸图像;
    识别所述人脸图像的当前的人脸表情;
    获取先前的人脸表情;
    比较当前的人脸表情和先前的人脸表情,得到第一比较结果;
    根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果。
  2. 如权利要求1所述的表情图像效果生成方法,其特征在于,所述获取第一图像,所述第一图像中包括人脸图像,包括:
    获取第一视频图像,所述第一视频中的至少一个视频帧中包括人脸图像。
  3. 如权利要求1所述的表情图像效果生成方法,其特征在于,所述识别所述人脸图像的当前人脸表情,包括:
    识别所述第一图像中的人脸图像;
    在所述人脸图像中提取当前人脸表情特征;
    根据所述当前人脸表情特征对当前人脸表情进行识别。
  4. 如权利要求1所述的表情图像效果生成方法,其特征在于,所述获取先前的人脸表情,包括:
    获取默认的先前的人脸表情,所述默认的先前的人脸表情为识别出人脸图像的人脸表情之前预先设置的人脸表情。
  5. 如权利要求1所述的表情图像效果生成方法,其特征在于,所述获取先前的人脸表情,包括:
    获取上一采样时刻的人脸表情或者获取上一视频帧中的人脸表情。
  6. 如权利要求1所述的表情图像效果生成方法,其特征在于,所述比较当前的人脸表情和先前的人脸表情,得到第一比较结果,包括:
    比较当前的人脸表情的等级和先前的人脸表情的等级,得到当前的人脸表情的等级和先前的人脸表情的等级的大小关系。
  7. 如权利要求1所述的表情图像效果生成方法,其特征在于,所述根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果,包括:
    根据所述第一比较结果,获取与所述第一比较结果对应的图像效果配置文件;
    根据所述图像效果配置文件,在所述第一图像中渲染出所述图像效果。
  8. 如权利要求1所述的表情图像效果生成方法,其特征在于,所述获取第一图像,所述第一图像中包括人脸图像,包括:
    获取第一图像,所述第一图像中包括至少两个人脸图像。
  9. 如权利要求8所述的表情图像效果生成方法,其特征在于,所述识别所述人脸图像的当前的人脸表情,包括:
    识别所述至少两个人脸图像中的每一个人脸图像的当前的人脸表情。
  10. 如权利要求9所述的表情图像效果生成方法,其特征在于,在所述识别所述至少两个人脸图像中的每一个人脸图像的当前的人脸表情之后,还包括:
    在第一次识别出每个人脸图像的人脸表情时,针对每一个人脸图像的人脸表情,获取对应的图像效果配置文件。
  11. 如权利要求9或10所述的表情图像效果生成方法,其特征在于,所述获取先前的人脸表情,包括:
    对每个人脸图像的当前的人脸表情,获取先前的人脸表情。
  12. 如权利要求11所述的表情图像效果生成方法,其特征在于,所述比较当前的人脸表情和先前的人脸表情,得到第一比较结果,包括:
    针对每个人脸图像的人脸表情,比较当前的人脸表情和先前的人脸表情,得到每个人脸图像的人脸表情的第一比较结果。
  13. 如权利要求11所述的表情图像效果生成方法,其特征在于,所述根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果,包括:
    根据每个人脸图像的人脸表情的第一比较结果,在所述第一图像中生成与所述每个人脸图像的人脸表情的第一比较结果对应的图像效果。
  14. 一种表情图像效果生成装置,其特征在于,包括:
    第一图像获取模块,用于获取第一图像,所述第一图像中包括人脸图像;
    表情识别模块,用于识别所述人脸图像的当前的人脸表情;
    先前表情获取模块,用于获取先前的人脸表情;
    比较模块,用于比较当前的人脸表情和先前的人脸表情,得到第一比较结果;
    表情图像效果生成模块,用于根据所述第一比较结果,在所述第一图像中生成与所述第一比较结果对应的图像效果。
  15. 一种电子设备,包括:
    存储器,用于存储非暂时性计算机可读指令;以及
    处理器,用于运行所述计算机可读指令,使得所述处理器执行时实现根据权利要求1-13中任意一项所述的表情图像效果生成方法。
  16. 一种计算机可读存储介质,用于存储非暂时性计算机可读指令,当所述非暂时性计算机可读指令由计算机执行时,使得所述计算机执行权利要求1-13中任意一项所述的表情图像效果生成方法。
PCT/CN2019/129124 2019-01-31 2019-12-27 表情图像效果生成方法、装置和电子设备 WO2020155981A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/427,262 US12020469B2 (en) 2019-01-31 2019-12-27 Method and device for generating image effect of facial expression, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910101357.1 2019-01-31
CN201910101357.1A CN111507143B (zh) 2019-01-31 2019-01-31 表情图像效果生成方法、装置和电子设备

Publications (1)

Publication Number Publication Date
WO2020155981A1 true WO2020155981A1 (zh) 2020-08-06

Family

ID=71840241

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/129124 WO2020155981A1 (zh) 2019-01-31 2019-12-27 表情图像效果生成方法、装置和电子设备

Country Status (3)

Country Link
US (1) US12020469B2 (zh)
CN (1) CN111507143B (zh)
WO (1) WO2020155981A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220080195A1 (en) * 2020-09-11 2022-03-17 Nazmi Peyman Electrical stimulation system for facial expressions and a method of use thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541259A (zh) * 2011-12-26 2012-07-04 鸿富锦精密工业(深圳)有限公司 电子设备及其根据脸部表情提供心情服务的方法
US20130266222A1 (en) * 2012-04-10 2013-10-10 Olympus Imaging Corp. Image synthesis apparatus, image synthesis method and image synthesis program
CN104766041A (zh) * 2014-01-07 2015-07-08 腾讯科技(深圳)有限公司 一种图像识别方法、装置及系统
CN106372622A (zh) * 2016-09-30 2017-02-01 北京奇虎科技有限公司 一种人脸表情分类方法及装置

Family Cites Families (42)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005044330A (ja) * 2003-07-24 2005-02-17 Univ Of California San Diego 弱仮説生成装置及び方法、学習装置及び方法、検出装置及び方法、表情学習装置及び方法、表情認識装置及び方法、並びにロボット装置
JP4914398B2 (ja) * 2008-04-09 2012-04-11 キヤノン株式会社 表情認識装置、撮像装置、方法及びプログラム
CN101452582B (zh) * 2008-12-18 2013-09-18 北京中星微电子有限公司 一种实现三维视频特效的方法和装置
TWI430185B (zh) * 2010-06-17 2014-03-11 Inst Information Industry 臉部表情辨識系統及其辨識方法及其電腦程式產品
CN102455898A (zh) * 2010-10-29 2012-05-16 张明 视频聊天卡通表情辅助娱乐系统
JP2012181704A (ja) * 2011-03-01 2012-09-20 Sony Computer Entertainment Inc 情報処理装置および情報処理方法
CN103207662A (zh) * 2012-01-11 2013-07-17 联想(北京)有限公司 一种获得生理特征信息的方法及装置
US9405962B2 (en) * 2012-08-14 2016-08-02 Samsung Electronics Co., Ltd. Method for on-the-fly learning of facial artifacts for facial emotion recognition
CN103945140B (zh) * 2013-01-17 2017-11-28 联想(北京)有限公司 视频字幕的生成方法及系统
CN104333688B (zh) * 2013-12-03 2018-07-10 广州三星通信技术研究有限公司 基于拍摄的图像生成表情符的设备和方法
CN104063280B (zh) * 2014-06-25 2017-09-12 华为技术有限公司 一种智能终端的控制方法
CN105139438B (zh) * 2014-09-19 2018-01-12 电子科技大学 视频人脸卡通动画生成方法
CN104581347A (zh) * 2015-01-27 2015-04-29 苏州乐聚一堂电子科技有限公司 压感视觉特效系统及压感视觉特效处理方法
US9552510B2 (en) * 2015-03-18 2017-01-24 Adobe Systems Incorporated Facial expression capture for character animation
CN106155640B (zh) * 2015-03-24 2019-08-13 海信集团有限公司 一种音量显示方法及装置
CN104866091B (zh) * 2015-03-25 2018-02-23 百度在线网络技术(北京)有限公司 一种用于在计算机设备中输出音效信息的方法和装置
CN104780339A (zh) * 2015-04-16 2015-07-15 美国掌赢信息科技有限公司 一种即时视频中的表情特效动画加载方法和电子设备
CN107341785A (zh) * 2016-04-29 2017-11-10 掌赢信息科技(上海)有限公司 一种基于帧间滤波的表情迁移方法及电子设备
CN107437052A (zh) * 2016-05-27 2017-12-05 深圳市珍爱网信息技术有限公司 基于微表情识别的相亲满意度计算方法和系统
KR101728635B1 (ko) * 2016-05-31 2017-04-20 연세대학교 산학협력단 표정을 인식하기 위한 장치 및 방법
CN106127828A (zh) * 2016-06-28 2016-11-16 广东欧珀移动通信有限公司 一种增强现实的处理方法、装置及移动终端
CN106708257A (zh) * 2016-11-23 2017-05-24 网易(杭州)网络有限公司 游戏交互方法与装置
CN108229239B (zh) * 2016-12-09 2020-07-10 武汉斗鱼网络科技有限公司 一种图像处理的方法及装置
CN106658079B (zh) * 2017-01-05 2019-04-30 腾讯科技(深圳)有限公司 自定义生成表情图像的方法及装置
CN107229905B (zh) * 2017-05-05 2020-08-11 广州视源电子科技股份有限公司 嘴唇渲染颜色的方法、装置及电子设备
US10623724B2 (en) * 2017-07-19 2020-04-14 International Business Machines Corporation Adaptive display environment for dynamic applications
US20190023208A1 (en) * 2017-07-19 2019-01-24 Ford Global Technologies, Llc Brake prediction and engagement
CN107437272B (zh) * 2017-08-31 2021-03-12 深圳锐取信息技术股份有限公司 基于增强现实的互动娱乐方法、装置及终端设备
CN107742072B (zh) * 2017-09-20 2021-06-25 维沃移动通信有限公司 人脸识别方法及移动终端
CN107392193A (zh) * 2017-09-21 2017-11-24 天津呼噜互娱科技有限公司 人脸表情识别方法及装置
CN107844748B (zh) * 2017-10-17 2019-02-05 平安科技(深圳)有限公司 身份验证方法、装置、存储介质和计算机设备
CN107798308B (zh) * 2017-11-09 2020-09-22 一石数字技术成都有限公司 一种基于短视频训练法的人脸识别方法
CN108399358B (zh) * 2018-01-11 2021-11-05 中国地质大学(武汉) 一种在视频聊天的表情显示方法及系统
CN108307127A (zh) * 2018-01-12 2018-07-20 广州市百果园信息技术有限公司 视频处理方法及计算机存储介质、终端
TWI711980B (zh) * 2018-02-09 2020-12-01 國立交通大學 表情辨識訓練系統及表情辨識訓練方法
CN108335345B (zh) * 2018-02-12 2021-08-24 北京奇虎科技有限公司 面部动画模型的控制方法及装置、计算设备
CN108401129A (zh) * 2018-03-22 2018-08-14 广东小天才科技有限公司 基于穿戴式设备的视频通话方法、装置、终端及存储介质
CN108537749B (zh) * 2018-03-29 2021-05-11 Oppo广东移动通信有限公司 图像处理方法、装置、移动终端及计算机可读存储介质
CN108846881B (zh) * 2018-05-29 2023-05-12 珠海格力电器股份有限公司 一种表情图像的生成方法及装置
CN108898068B (zh) * 2018-06-06 2020-04-28 腾讯科技(深圳)有限公司 一种人脸图像的处理方法和装置以及计算机可读存储介质
CN109165546B (zh) * 2018-07-06 2021-04-02 深圳市科脉技术股份有限公司 人脸识别方法及装置
CN109064388A (zh) * 2018-07-27 2018-12-21 北京微播视界科技有限公司 人脸图像效果生成方法、装置和电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541259A (zh) * 2011-12-26 2012-07-04 鸿富锦精密工业(深圳)有限公司 电子设备及其根据脸部表情提供心情服务的方法
US20130266222A1 (en) * 2012-04-10 2013-10-10 Olympus Imaging Corp. Image synthesis apparatus, image synthesis method and image synthesis program
CN103369244A (zh) * 2012-04-10 2013-10-23 奥林巴斯映像株式会社 图像合成设备、图像合成方法
CN104766041A (zh) * 2014-01-07 2015-07-08 腾讯科技(深圳)有限公司 一种图像识别方法、装置及系统
CN106372622A (zh) * 2016-09-30 2017-02-01 北京奇虎科技有限公司 一种人脸表情分类方法及装置

Also Published As

Publication number Publication date
US12020469B2 (en) 2024-06-25
CN111507143B (zh) 2023-06-02
US20220101652A1 (en) 2022-03-31
CN111507143A (zh) 2020-08-07

Similar Documents

Publication Publication Date Title
CN110766777B (zh) 虚拟形象的生成方法、装置、电子设备及存储介质
JP7383714B2 (ja) 動物顔部の画像処理方法と装置
US11409794B2 (en) Image deformation control method and device and hardware device
WO2020248900A1 (zh) 全景视频的处理方法、装置及存储介质
US11922721B2 (en) Information display method, device and storage medium for superimposing material on image
CN110070551B (zh) 视频图像的渲染方法、装置和电子设备
CN109348277B (zh) 运动像素视频特效添加方法、装置、终端设备及存储介质
CN109003224A (zh) 基于人脸的形变图像生成方法和装置
WO2020155984A1 (zh) 人脸表情图像处理方法、装置和电子设备
US20230087489A1 (en) Image processing method and apparatus, device, and storage medium
US20240095886A1 (en) Image processing method, image generating method, apparatus, device, and medium
WO2022218042A1 (zh) 视频处理方法、装置、视频播放器、电子设备及可读介质
WO2020155981A1 (zh) 表情图像效果生成方法、装置和电子设备
CN110059739B (zh) 图像合成方法、装置、电子设备和计算机可读存储介质
CN111507139A (zh) 图像效果生成方法、装置和电子设备
CN111107264A (zh) 图像处理方法、装置、存储介质以及终端
CN110288552A (zh) 视频美化方法、装置及电子设备
CN111292247A (zh) 图像处理方法和装置
WO2020215854A1 (zh) 渲染图像的方法、装置、电子设备和计算机可读存储介质
CN111292276B (zh) 图像处理方法和装置
CN110807728B (zh) 对象的显示方法、装置、电子设备及计算机可读存储介质
CN111353929A (zh) 图像处理方法、装置和电子设备
CN111489769B (zh) 图像处理方法、装置和硬件装置
CN115714888B (zh) 视频生成方法、装置、设备与计算机可读存储介质
CN115798057A (zh) 一种图像处理方法、装置、存储介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19912275

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 13/12/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19912275

Country of ref document: EP

Kind code of ref document: A1