WO2020244074A1 - 表情交互方法、装置、计算机设备及可读存储介质 - Google Patents

表情交互方法、装置、计算机设备及可读存储介质 Download PDF

Info

Publication number
WO2020244074A1
WO2020244074A1 PCT/CN2019/103370 CN2019103370W WO2020244074A1 WO 2020244074 A1 WO2020244074 A1 WO 2020244074A1 CN 2019103370 W CN2019103370 W CN 2019103370W WO 2020244074 A1 WO2020244074 A1 WO 2020244074A1
Authority
WO
WIPO (PCT)
Prior art keywords
expression
feature vector
preset
recognized
facial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2019/103370
Other languages
English (en)
French (fr)
Inventor
郭玲玲
黄帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2020244074A1 publication Critical patent/WO2020244074A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06V40/175Static expression

Definitions

  • This application relates to the field of electronic communication technology, and in particular to an expression interaction method, device, computer equipment, and non-volatile readable storage medium.
  • Facial expressions are a basic way for humans to express emotions and an effective means in nonverbal communication.
  • Existing electronic devices are generally equipped with virtual robots to realize human-machine interaction, but virtual robots generally only support human-machine voice interaction, cannot distinguish the user's expression, and cannot realize human-computer interaction based on the user's expression.
  • An embodiment of the present application provides an expression interaction method, the method includes:
  • a face image If a face image is detected, locate a key feature area of the face image, and extract an expression feature that characterizes the facial expression to be recognized from the key feature area;
  • the extracted expression features are compared with the expression features of each expression in the preset expression library to obtain the similarity probability of the facial expression to be recognized and each expression in the preset expression library, which will be compared with The expression with the greatest probability of similarity in the preset expression library is used as the facial expression to be recognized;
  • the step of performing face detection includes:
  • the extracted expression feature is compared with the expression feature of each expression in the preset expression library to obtain
  • the step of the similarity probability of the facial expression to be recognized and each expression in the preset expression library includes:
  • the probability of similarity between the facial expression to be recognized and each expression in the preset expression library is determined according to the calculated distance value.
  • the extracted expression feature is compared with the expression feature of each expression in the preset expression library to obtain
  • the step of the similarity probability of the facial expression to be recognized and each expression in the preset expression library includes:
  • the probability of similarity between the facial expression to be recognized and each expression in the preset expression library is determined according to the calculated distance value.
  • the distance value is calculated by the following formula:
  • y is the shape feature vector/texture feature vector of the facial expression to be recognized
  • x j is the shape feature vector/texture feature vector of the j-th expression in the preset expression library
  • M is the preset target metric matrix
  • j is An integer greater than or equal to 1
  • d M (y, x j ) is between the shape feature vector/texture feature vector of the facial expression to be recognized and the shape feature vector/texture feature vector of the j-th expression in the preset expression library
  • Yx j is the difference between the shape feature vector/texture feature vector of the facial expression to be recognized and the shape feature vector/texture feature vector of the j-th expression in the preset expression library
  • (yx j ) T Is the transposition of the difference between the shape feature vector/texture feature vector of the facial expression to be recognized and the shape feature vector/texture feature vector of the j-th expression in the preset expression library
  • the similarity probability is calculated by the following formula:
  • p ⁇ 1+exp[Db] ⁇ -1 , where p is the similarity probability, D is the distance value, and b is the preset offset.
  • the feedback information includes voice information or expression information after watching the terminal device output the interactive content.
  • the feedback information is expression information after watching the terminal device output the interactive content
  • the step of continuously controlling the content output of the terminal device according to the feedback information includes:
  • the interactive content output by the terminal device is not adjusted.
  • An embodiment of the present application provides an expression interaction device, the device includes:
  • the detection module is configured to receive an interaction request instruction, and pop up a detection box to perform face detection according to the interaction request instruction;
  • the judgment module is used to judge whether a face image is detected
  • An extraction module used for locating a key feature area of the face image when a face image is detected, and extracting expression features that characterize the facial expression to be recognized from the key feature area;
  • the comparison module is used to compare the extracted expression characteristics with the expression characteristics of each expression in the preset expression library to obtain the facial expression to be recognized and the expression of each expression in the preset expression library Similarity probability, and use an expression with the greatest probability of similarity in the preset expression library as the facial expression to be recognized;
  • the output module is used to control the terminal device to output corresponding interactive content according to the recognition result of the facial expression to be recognized;
  • the control module is configured to obtain feedback information after the interactive content is output, and continuously control the content output of the terminal device according to the feedback information.
  • An embodiment of the present application provides a computer device that includes a processor and a memory, and a number of computer-readable instructions are stored on the memory.
  • the processor is used to execute the computer-readable instructions stored in the memory, The steps of the aforementioned facial expression interaction method.
  • An embodiment of the present application provides a non-volatile readable storage medium having computer readable instructions stored thereon, and when the computer readable instructions are executed by a processor, the steps of the expression interaction method as described above are realized.
  • the above-mentioned expression interaction method, device, computer equipment and non-volatile readable storage medium can recognize the user’s expression and control the computer device to output corresponding interactive content according to the result of expression recognition, and can realize functions such as alleviating the user’s tension, anxiety, and comforting the user’s mood. At the same time, it can further analyze the user's expression after the interactive content is played, and continuously control the interactive content output of the computer device according to the analysis result, so that the interaction with the computer device is more vivid and interesting, and the user experience is improved.
  • FIG. 1 is a flowchart of the steps of an expression interaction method in an embodiment of this application.
  • Fig. 2 is a functional block diagram of an expression interaction device in an embodiment of the application.
  • Figure 3 is a schematic diagram of a computer device in an embodiment of the application.
  • the expression interaction method of the present application is applied to one or more computer devices.
  • the computer device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions.
  • Its hardware includes, but is not limited to, a microprocessor and an Application Specific Integrated Circuit (ASIC) , Field-Programmable Gate Array (FPGA), Digital Processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Processor
  • embedded equipment etc.
  • the computer device may be a computing device such as a desktop computer, a notebook computer, a tablet computer, a server, and a mobile phone.
  • the computer device can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device.
  • Fig. 1 is a flowchart of the steps of a preferred embodiment of the expression interaction method of the present application. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted.
  • the expression interaction method specifically includes the following steps.
  • Step S11 Receive an interaction request instruction, and pop up a detection box to perform face detection according to the interaction request instruction.
  • the computer device when receiving an interaction request instruction from a user, the computer device will pop up a detection frame according to the interaction request instruction, and perform face detection through the detection frame.
  • the user can input an interaction request instruction through touch screen, input an interaction request instruction through keys, or input an interaction request instruction through voice.
  • face detection can be realized by establishing and training a convolutional neural network model.
  • the face detection can be implemented in the following manner: a face sample database can be constructed first and a convolutional neural network model for face detection can be established, the face sample database containing face information of multiple people, The face information of each person can include multiple angles, and the face information of each angle can have multiple pictures; the face image in the face sample database is input to the convolutional neural network model, and the convolutional neural network is used
  • the default parameters of the model are trained for convolutional neural network; according to the intermediate training results, the initial weight, training rate, number of iterations, etc. of the default parameters are continuously adjusted until the optimal network parameters of the convolutional neural network model are obtained.
  • the convolutional neural network model with optimal network parameters is used as the final recognition model. After the training is completed, the finally obtained convolutional neural network model can be used for face detection.
  • Step S12 Determine whether a face image is detected.
  • Step S13 If a face image is detected, a key feature area of the face image is located, and an expression feature representing the facial expression to be recognized is extracted from the key feature area.
  • a prompt message may be output.
  • a face image is detected at the preset time, locate the key feature area of the face image, and extract the expression features that characterize the facial expression to be recognized from the key feature area, because it is not for the face image Feature extraction and calculation are performed on all areas of, which can reduce the amount of calculation and improve the speed of facial expression recognition.
  • the key feature regions of the face image may include eyes, nose, mouth, eyebrows, etc.
  • the key feature areas such as eyes, nose, mouth, and eyebrows of the face image can be located by integral projection. Since eyes are the more prominent facial features in the face, the eyes can be located first, and other organs of the face, such as eyebrows, mouth, nose, etc., can be more accurately located based on the potential distribution relationship. For example, the location of the key feature area is performed by corresponding to the peaks or troughs generated under different integral projection methods.
  • the integral projection is divided into vertical projection and horizontal projection.
  • f (x, y) represent the image (x, y)
  • the gray value of, the horizontal integral projection M h (y) and vertical integral projection M v (x) in the image [y1, y2] and [x1, x2] area are expressed as:
  • the horizontal integral projection is to accumulate the gray values of all pixels in a row before displaying
  • the vertical integral projection is to accumulate the gray values of all pixels in a column before displaying.
  • the eyebrows and eyes are the relatively black areas in the face image, which correspond to the first two minimum points on the horizontal integral projection curve.
  • the first minimum point corresponds to the position of the eyebrows on the vertical axis, denoted as y brow
  • the second minimum point corresponds to the position of the eye on the vertical axis, denoted as y eye
  • the third pole corresponds to the position of the nose on the vertical axis, recorded as y nose
  • the fourth minimum point corresponds to the position of the mouth on the vertical axis, recorded as y month .
  • the position of the mouth and nose on the horizontal axis is (x left-eye + x right-eye )/2, and the eye area, lips area, eyebrow area, and nose area can be determined according to the coordinates of key features and preset rules.
  • the eye area includes the area centered on the left eye coordinates, 15 pixels to the left, 15 pixels to the right, 10 pixels up, and 10 pixels down, and the area centered on the right eye coordinates, 15 pixels to the left, 15 pixels to the right, and up 10 pixels, 10 pixels down area.
  • human facial expressions may have the following expressions: facial movements when happy: the corners of the mouth are raised, the cheeks are lifted up, the eyelids are contracted, and "crow's feet" are formed at the tails of the eyes.
  • Facial features during contempt the corner of the mouth is raised, making a sneer or a smug smile, etc.
  • the facial expression features that characterize the facial expression can be extracted from the key feature region.
  • a differential energy map (DEI)-based method/centralized binary pattern (CGBP) method can be used to extract expression features that represent facial expressions from key feature regions.
  • Step S14 Compare the extracted expression features with the expression features of each expression in the preset expression library to obtain the probability of similarity between the facial expression to be recognized and each expression in the preset expression library. And an expression with the greatest probability of similarity with the preset expression library is used as the facial expression to be recognized.
  • the preset expression library may include a variety of expressions, such as happy, surprised, sad, angry, disgusted, fear and other expressions, and a variety of composite expressions, such as sad and fearful, sad and surprised, Anger and fear etc.
  • the expression feature of the expression to be recognized may be a shape feature vector or a texture feature vector.
  • the shape feature vector of the expression to be recognized is acquired
  • the texture feature vector of the expression to be recognized is acquired.
  • the probability of similarity between the extracted expression feature (shape feature vector or texture feature vector) and each expression in the preset expression library can be determined by the following method: acquiring the feature of the expression to be recognized The distance value between the vector (shape feature vector or texture feature vector) and the feature vector of each expression in the preset expression library; according to the distance value, the facial expression to be recognized and each expression in the preset expression library are determined Probability of similar expressions.
  • acquiring the shape feature vector of the facial expression to be recognized calculating the distance value between the shape feature vector of the facial expression to be recognized and the shape feature vector of each expression in the preset expression library, and The probability of similarity between the facial expression to be recognized and each expression in the preset expression library is determined according to the calculated distance value.
  • acquiring the texture feature vector of the facial expression to be recognized calculating the distance between the texture feature vector of the facial expression to be recognized and the texture feature vector of each expression in the preset expression library, And determining the similarity probability of the facial expression to be recognized and each expression in the preset expression library according to the calculated distance value.
  • the distance value may be a generalized Mahalanobis distance.
  • the distance value between the feature vector of the expression to be recognized and the feature vector of each expression in the preset expression library can be calculated by the following formula:
  • y is the shape feature vector (texture feature vector) of the facial expression to be recognized
  • x j is the shape feature vector (texture feature vector) of the j-th expression in the preset expression library
  • M is the preset target metric matrix
  • j is an integer greater than or equal to 1
  • d M (y, x j ) is the shape feature vector (texture feature vector) of the facial expression to be recognized and the shape feature vector of the j-th expression in the preset expression library (texture feature Vector)
  • (yx j ) is the difference between the shape feature vector (texture feature vector) of the facial expression to be recognized and the shape feature vector (texture feature vector) of the j-th expression in the preset expression library
  • (Yx j ) T is the transposition of the difference between the shape feature vector (texture feature vector) of the facial expression to be recognized and the shape feature vector (texture feature vector) of the j-th expression in the preset expression library
  • the similarity probability can be calculated by the
  • p ⁇ 1+exp[Db] ⁇ -1 , where p is the similarity probability, D is the distance value, and b is the preset offset.
  • the expression with the greatest probability of similarity to the preset expression library may be used as the Describe the expression to be recognized.
  • Step S15 Control the computer device to output corresponding interactive content according to the recognition result of the facial expression to be recognized.
  • a plurality of mapping relationship tables between expressions and interactive content output by the computer device may be established in advance, and the computer device can be controlled according to the expression recognition result according to the mapping relationship table.
  • the interactive content may be that the computer device provides corresponding actions, voices, pictures, texts, videos, etc. according to the facial expression recognition results to interact with the user, so as to relieve the user's tension and anxiety and delight the user's mood.
  • the computer device can be controlled to output soothing music to relieve the user's nervousness or the computer device can be controlled to output suggestions on ways to relieve tension (for example, the suggested content is: try to breathe slowly and deeply.
  • the computer device can be controlled to output articles, music, and videos that alleviate sadness, or the computer device can be controlled to output suggestions on how to relieve sadness for the user's reference .
  • Step S16 Obtain feedback information after the interactive content is output, and continuously control the content output of the computer device according to the feedback information.
  • the feedback information may include voice information or expression information after watching the computer device output the interactive content.
  • control the computer equipment to relieve the user’s current nervous expression and output soothing music to relieve the user’s nervousness.
  • the control terminal will Play the soothing music that was played the previous moment again; for example, to control the computer equipment to relieve the user’s current nervous expression, output soothing music to relieve the user’s nervousness, when the soothing music is played and the detected user expression is still nervous .
  • the interactive content output by the computer device can be adjusted directly according to the voice information requirements.
  • the feedback information is the user's expression after watching the interactive content output by the computer device
  • it can also be judged whether the expression change between the expression before watching and the expression after watching the interactive content meets the preset adjustment rules. If it meets the preset adjustment rules, then adjust the interactive content output by the computer device. If the preset adjustment rule is not adjusted, the interactive content output by the computer device is not adjusted.
  • the preset rule is the expression change from happy to sad. If the expression change between the expression recognized before watching and the expression after watching the interactive content is from sad to happy, it does not meet the preset Adjustment rules, no adjustments.
  • the above-mentioned expression interaction method can recognize the user's expression and control the computer device to output the corresponding interactive content according to the result of expression recognition. It can realize the functions of alleviating the user's tension, anxiety, and soothing the user's mood. At the same time, it can further improve the user's expression after the interactive content is played. Analyze, and continuously control the interactive content output of the computer equipment according to the analysis result, realize more vivid and interesting interaction with the computer equipment, and improve the user experience.
  • FIG. 2 is a diagram of functional modules of a preferred embodiment of the emoticon interaction device of this application.
  • the expression interaction device 10 may include a detection module 101, a judgment module 102, an extraction module 103, a comparison module 104, an output module 105, and a control module 106.
  • the detection module 101 is configured to receive an interaction request instruction, and pop up a detection box to perform face detection according to the interaction request instruction.
  • the detection module 101 when an interaction request instruction from a user is received, the detection module 101 will pop up a detection frame according to the interaction request instruction, and perform face detection through the detection frame.
  • the user can touch-input an interaction request instruction through a touch screen, input an interaction request instruction through a button, or input an interaction request instruction through voice.
  • the detection module 101 may implement face detection by establishing and training a convolutional neural network model in advance.
  • the detection module 101 can implement face detection in the following manner: a face sample database can be constructed first and a convolutional neural network model for face detection can be established.
  • the face sample database contains multiple persons.
  • the face information of each person can include multiple angles, and the face information of each angle can have multiple pictures;
  • the face images in the face sample database are input to the convolutional neural network model,
  • Network parameters Next, the convolutional neural network model with the optimal network parameters is used as the final recognition model.
  • the detection module 101 can use the finally obtained convolutional neural network model to perform face detection.
  • the judgment module 102 is used to judge whether a face image is detected.
  • the judgment module 102 may judge whether a face image is detected according to the output of the convolutional neural network model.
  • the extraction module 103 is used for locating the key feature area of the face image when the face image is detected, and extracting the expression features that characterize the facial expression to be recognized from the key feature area.
  • the judgment module 102 when the judgment module 102 judges that no face image is detected within a preset time, it may output a prompt message.
  • the extraction module 103 locates the key feature area of the face image, and extracts and characterizes the person to be recognized from the key feature area.
  • the expression features of facial expressions since feature extraction and calculation are not performed on all areas of the face image, the amount of calculation can be reduced and the speed of facial expression recognition can be improved.
  • the key feature regions of the face image may include eyes, nose, mouth, eyebrows, etc.
  • the extraction module 103 can locate the key feature regions such as eyes, nose, mouth, and eyebrows of the face image by means of integral projection. Since eyes are the more prominent facial features in the face, the eyes can be located first, and other organs of the face, such as eyebrows, mouth, nose, etc., can be more accurately located based on the potential distribution relationship. For example, the location of the key feature area is performed by corresponding to the peaks or troughs generated under different integral projection methods. The integral projection is divided into vertical projection and horizontal projection.
  • f (x, y) represent the image (x, y)
  • the gray value of, the horizontal integral projection M h (y) and vertical integral projection M v (x) in the image [y1, y2] and [x1, x2] area are expressed as:
  • the horizontal integral projection is to accumulate the gray values of all pixels in a row before displaying
  • the vertical integral projection is to accumulate the gray values of all pixels in a column before displaying.
  • the eyebrows and eyes are the relatively black areas in the face image, which correspond to the first two minimum points on the horizontal integral projection curve.
  • the first minimum point corresponds to the position of the eyebrows on the vertical axis, denoted as y brow
  • the second minimum point corresponds to the position of the eye on the vertical axis, denoted as y eye
  • the third pole corresponds to the position of the nose on the vertical axis, recorded as y nose
  • the fourth minimum point corresponds to the position of the mouth on the vertical axis, recorded as y month .
  • the position of the mouth and nose on the horizontal axis is (x left-eye + x right-eye )/2, and the eye area, lips area, eyebrow area, and nose area can be determined according to the coordinates of key features and preset rules.
  • the eye area includes the area centered on the left eye coordinates, 15 pixels to the left, 15 pixels to the right, 10 pixels up, and 10 pixels down, and the area centered on the right eye coordinates, 15 pixels to the left, 15 pixels to the right, and up 10 pixels, 10 pixels down area.
  • human facial expressions may have the following expressions: facial movements when happy: the corners of the mouth are raised, the cheeks are lifted up, the eyelids are contracted, and "crow's feet" are formed at the tails of the eyes.
  • Facial features during contempt the corner of the mouth is raised, making a sneer or a smug smile, etc.
  • the facial expression features that characterize the facial expression can be extracted from the key feature region.
  • a differential energy map (DEI)-based method/centralized binary pattern (CGBP) method can be used to extract expression features that represent facial expressions from key feature regions.
  • the comparison module 104 is configured to compare the extracted expression features with the expression features of each expression in the preset expression library, to obtain the facial expression to be recognized and each expression in the preset expression library.
  • the similarity probability of the expression, and the expression with the greatest similarity probability in the preset expression library is used as the facial expression to be recognized.
  • the preset expression library may include a variety of expressions, such as happy, surprised, sad, angry, disgusted, fear and other expressions, and a variety of composite expressions, such as sad and fearful, sad and surprised, Anger and fear etc.
  • the expression feature of the expression to be recognized may be a shape feature vector or a texture feature vector.
  • the shape feature vector of the expression to be recognized is acquired .
  • the texture feature vector of the expression to be recognized is obtained for comparison.
  • the comparison module 104 may determine the similarity probability between the extracted expression feature (shape feature vector or texture feature vector) and each expression in the preset expression library in the following manner: The distance value between the feature vector (shape feature vector or texture feature vector) of the expression to be recognized and the feature vector of each expression in the preset expression library; the distance value is used to determine the facial expression to be recognized and the prediction Suppose the similarity probability of each expression in the expression library.
  • the comparison module 104 obtains the shape feature vector of the facial expression to be recognized, and calculates the difference between the shape feature vector of the facial expression to be recognized and the shape feature vector of each expression in the preset expression library.
  • the comparison module 104 obtains the texture feature vector of the facial expression to be recognized, calculates the texture feature vector of the facial expression to be recognized and the texture feature vector of each expression in the preset expression library And determine the similarity probability between the facial expression to be recognized and each expression in the preset expression library according to the calculated distance value.
  • the distance value may be a generalized Mahalanobis distance.
  • the comparison module 104 may calculate the distance value between the feature vector of the expression to be recognized and the feature vector of each expression in the preset expression library by using the following formula:
  • y is the shape feature vector (texture feature vector) of the facial expression to be recognized
  • x j is the shape feature vector (texture feature vector) of the j-th expression in the preset expression library
  • M is the preset target metric matrix
  • j is an integer greater than or equal to 1
  • d M (y, x j ) is the shape feature vector (texture feature vector) of the facial expression to be recognized and the shape feature vector of the j-th expression in the preset expression library (texture feature Vector)
  • (yx j ) is the difference between the shape feature vector (texture feature vector) of the facial expression to be recognized and the shape feature vector (texture feature vector) of the j-th expression in the preset expression library
  • (Yx j ) T is the transposition of the difference between the shape feature vector (texture feature vector) of the facial expression to be recognized and the shape feature vector (texture feature vector) of the j-th expression in the preset expression library
  • the similarity probability can be calculated by the
  • p ⁇ 1+exp[Db] ⁇ -1 , where p is the similarity probability, D is the distance value, and b is the preset offset.
  • the comparison module 104 may compare the similarity with the expression in the preset expression library. Expressions with similar probabilities are used as the expressions to be recognized.
  • the output module 105 is configured to control the computer device to output corresponding interactive content according to the recognition result of the facial expression to be recognized.
  • a plurality of mapping relationship tables between expressions and interactive content output by the computer device may be established in advance, and the computer device can be controlled according to the expression recognition result according to the mapping relationship table.
  • the interactive content may be that the computer device provides corresponding actions, voices, pictures, texts, videos, etc. according to the facial expression recognition results to interact with the user, so as to relieve the user's tension and anxiety and delight the user's mood.
  • the output module 105 can control the computer device to output soothing music to relieve the user's nervousness or control the computer device to output suggestions on ways to relieve the nervousness (for example, the recommended content is : Try to breathe slowly and deeply to relieve tension) for the user's reference; when it is determined that the facial expression to be recognized is a sad expression, the output module 105 can control the computer device to output articles, music, and videos that relieve sadness or control the output of the computer device Suggestions on how to relieve grief are for users’ reference.
  • the control module 106 is configured to obtain feedback information after the interactive content is output, and continuously control the content output of the computer device according to the feedback information.
  • the feedback information may include voice information or expression information after watching the computer device output the interactive content.
  • the control The module 106 controls the terminal to play the soothing music played at the previous moment again; another example is to control the computer equipment to relieve the user’s current nervous expression and output soothing music to relieve the user’s nervousness.
  • the control module 106 can control the terminal to play another soothing music or not to play soothing music, and instead control the computer device to output suggestions on how to relieve tension to the user.
  • the control module 106 can directly adjust the interactive content output by the computer device according to the voice information requirements.
  • the control module 106 may also determine whether the expression change between the expression before viewing and the expression after viewing the interactive content meets the preset adjustment rule. If it meets the preset adjustment rule, the control module 106 The module 106 adjusts the interactive content output by the computer device, and if it does not meet the preset adjustment rule, does not adjust the interactive content output by the computer device.
  • the preset rule is the expression change from happy to sad. If the expression change between the expression recognized before watching and the expression after watching the interactive content is from sad to happy, it does not meet the preset Adjustment rules, no adjustments.
  • the above-mentioned expression interaction device can recognize the user’s expression and control the computer device to output the corresponding interactive content according to the result of expression recognition. It can realize functions such as alleviating the user’s tension, anxiety, and soothing the user’s mood. At the same time, it can further improve the user’s expression after the interactive content is played. Analyze, and continuously control the interactive content output of the computer equipment according to the analysis result, realize more vivid and interesting interaction with the computer equipment, and improve the user experience.
  • FIG. 3 is a schematic diagram of a preferred embodiment of the computer equipment of this application.
  • the computer device 1 includes a memory 20, a processor 30, and computer-readable instructions 40 stored in the memory 20 and running on the processor 30, such as an expression interaction program.
  • the processor 30 executes the computer-readable instruction 40
  • the steps in the embodiment of the above-mentioned expression interaction method are implemented, for example, steps S11 to S16 shown in FIG. 1.
  • the processor 30 executes the computer-readable instruction 40
  • the functions of the modules in the above-mentioned emoji interaction apparatus embodiment are implemented, for example, the modules 101 to 106 in FIG. 2.
  • the computer-readable instructions 40 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 20 and executed by the processor 30, To complete this application.
  • the one or more modules/units may be a series of computer-readable instruction instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer-readable instruction 40 in the computer device 1.
  • the computer-readable instruction 40 may be divided into the detection module 101, the judgment module 102, the extraction module 103, the comparison module 104, the output module 105, and the control module 106 in FIG. 2. Refer to the second embodiment for the specific functions of each module.
  • the computer device 1 may be a computing device such as a desktop computer, a notebook, a palmtop computer, a mobile phone, a tablet computer, and a cloud server.
  • a computing device such as a desktop computer, a notebook, a palmtop computer, a mobile phone, a tablet computer, and a cloud server.
  • the schematic diagram is only an example of the computer device 1 and does not constitute a limitation on the computer device 1. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. Components, for example, the computer device 1 may also include input and output devices, network access devices, buses, and so on.
  • the so-called processor 30 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (ASIC), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor, or the processor 30 may also be any conventional processor, etc.
  • the processor 30 is the control center of the computer device 1 and connects the entire computer device 1 with various interfaces and lines. Parts.
  • the memory 20 may be used to store the computer-readable instructions 40 and/or modules/units, and the processor 30 can run or execute the computer-readable instructions and/or modules/units stored in the memory 20, and
  • the data stored in the memory 20 is called to realize various functions of the computer device 1.
  • the memory 20 may mainly include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data (such as audio data) created in accordance with the use of the computer device 1 and the like are stored.
  • the memory 20 may include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, a flash memory card (Flash Card), At least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.
  • non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, a flash memory card (Flash Card), At least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.
  • the integrated modules/units of the computer device 1 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through computer-readable instructions.
  • the computer-readable instructions can be stored in a non-volatile memory. In the read storage medium, when the computer-readable instructions are executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer-readable instruction includes computer-readable instruction code, and the computer-readable instruction code may be in the form of source code, object code, executable file, or some intermediate form.
  • the computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
  • the functional units in the various embodiments of the present application may be integrated in the same processing unit, or each unit may exist alone physically, or two or more units may be integrated in the same unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

一种表情交互方法,包括:接收交互请求指令,并根据所述交互请求指令弹出检测框进行人脸检测;定位人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表情的表情特征;将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,并将与所述预设表情库中的具有最大相似概率的表情作为所述待识别人脸表情;根据表情识别结果控制终端设备输出对应的互动内容;及获取所述互动内容输出后的反馈信息,并根据所述反馈信息接续控制互动内容输出。本申请还提供一种表情交互装置、计算机设备及非易失性可读存储介质。本申请涉及人脸识别技术领域,可实现与终端设备交互更生动有趣,提高了用户使用体验。

Description

表情交互方法、装置、计算机设备及可读存储介质
本申请要求于2019年06月05日提交中国专利局,申请号为201910487847.X发明名称为“表情交互方法、装置、计算机装置及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子通信技术领域,具体涉及一种表情交互方法、装置、计算机设备及非易失性可读存储介质。
背景技术
随着今科技的发展,手机、平板电脑等电子设备日益成为绝大多数人们生活中不可或缺的部分,不断的改变我们社交以及生活中方方面面。表情是人类用来表达情绪的一种基本方式,是非语言交流中的一种有效手段。现有的电子设备一般装载有虚拟机器人来实现人机互动,然而虚拟机器人一般只支持进行人机语音互动,不能够辨别用户的表情,无法根据用户的表情来实现人机互动。
发明内容
鉴于以上内容,有必要提出一种表情交互方法、装置、计算机设备及非易失性可读存储介质,其可通过表情实现对终端设备进行控制,提高了用户使用体验。
本申请一实施方式提供一种表情交互方法,所述方法包括:
接收交互请求指令,并根据所述交互请求指令弹出一检测框进行人脸检测;
判断是否检测到人脸图像;
若检测到人脸图像,则定位所述人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表情的表情特征;
将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率,并将与所述预设表情库中的具有最大相似概率的表情作为所述待识别人脸表情;
根据所述待识别人脸表情的识别结果控制终端设备输出对应的互动内容;及
获取所述互动内容输出后的反馈信息,并根据所述反馈信息接续控制所述终端设备的内容输出。
优选地,所述进行人脸检测的步骤包括:
根据预设多个人脸样本训练得到用于进行人脸检测的卷积神经网络模型;及
利用所述卷积神经网络模型进行人脸检测。
优选地,当所述预设表情库中的每一表情的表情特征为形状特征向量时,所述将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率的步骤包括:
获取所述待识别人脸表情的形状特征向量;
计算所述待识别人脸表情的形状特征向量和所述预设表情库中的每一表情的形状特征向量之间的距离值;及
根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。
优选地,当所述预设表情库中的每一表情的表情特征为纹理特征向量时,所述将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率的步骤包括:
获取所述待识别人脸表情的纹理特征向量;
计算所述待识别人脸表情的纹理特征向量和所述预设表情库中的每一表情的纹理特征向量之间的距离值;及
根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。
优选地,所述距离值通过以下公式计算得到:
d M(y,x j)=(y-x j) T*M*(y-x j)
其中,y为待识别人脸表情的形状特征向量/纹理特征向量,x j为预设表情库中的第j个表情的形状特征向量/纹理特征向量,M为预设目标度量矩阵,j为大于或者等于1的整数,d M(y,x j)为待识别人脸表情的形状特征向量/纹理特征向量和预设表情库中的第j个表情的形状特征向量/纹理特征向量之间的距离值,(y-x j)为待识别人脸表情的形状特征向量/纹理特征向量与预设表情库中的第j个表情的形状特征向量/纹理特征向量的差值,(y-x j) T为待识别人脸表情的形状特征向量/纹理特征向量与预设表情库中的第j个表情的形状特征向量/纹理特征向量的差值的转置;所述相似概率通过以下公式计算得到:
p={1+exp[D-b]} -1,其中,p为相似概率,D为距离值,b为预设偏置量。
优选地,所述反馈信息包括语音信息或者观看所述终端设备输出所述互动内容后的表情信息。
优选地,所述反馈信息为观看所述终端设备输出所述互动内容后的表情信息,所述根据所述反馈信息接续控制所述终端设备的内容输出的步骤包括:
判断观看所述终端设备输出所述互动内容前后的表情变化是否符合预设调整规则;
若符合所述预设调整规则,则调整所述终端设备输出的互动内容;及
若不符合所述预设调整规则,则不调整所述终端设备输出的互动内容。
本申请一实施方式提供一种表情交互装置,所述装置包括:
检测模块,用于接收交互请求指令,并根据所述交互请求指令弹出一检测框进行人脸检测;
判断模块,用于判断是否检测到人脸图像;
提取模块,用于在检测到人脸图像时,定位所述人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表情的表情特征;
比对模块,用于将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率,并将与所述预设表情库中的具有最大相似概率的表情作为所述待识别人脸表情;
输出模块,用于根据所述待识别人脸表情的识别结果控制终端设备输出对应的互动内容;及
控制模块,用于获取所述互动内容输出后的反馈信息,并根据所述反馈信息接续控制所述终端设备的内容输出。
本申请一实施方式提供一种计算机设备,所述计算机设备包括处理器及存储器,所述存储器上存储有若干计算机可读指令,所述处理器用于执行存储器中存储的计算机可读指令时实现如前面所述的表情交互方法的步骤。
本申请一实施方式提供一种非易失性可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如前面所述的表情交互方法的步骤。
上述表情交互方法、装置、计算机设备及非易失性可读存储介质,可识别用户表情并根据表情识别结果控制计算机设备输出对应的互动内容,可实现舒缓用户紧张、焦虑、抚慰用户心情等功能,同时还可以对互动内容播放后的用户表情进行进一步分析,并根据分析结果接续控制计算机设备的互动内容输出,实现与计算机设备交互更生动有趣,提高了用户使用体验。
附图说明
图1为本申请一实施例中表情交互方法的步骤流程图。
图2为本申请一实施例中表情交互装置的功能模块图。
图3为本申请一实施例中计算机设备示意图。
如下具体实施方式将结合上述附图进一步说明本申请。
具体实施方式
为了能够更清楚地理解本申请的上述目的、特征和优点,下面结合附图和具体实施例对本申请进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本申请,所描述的实施方式仅仅是本申请一部分实施方式,而不是全部的实施方式。基于本申请中的实施方式,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施方式,都属于本申请保护的范围。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施方式的目的,不是旨在于限制本申请。
优选地,本申请的表情交互方法应用在一个或者多个计算机设备中。所述计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。
所述计算机设备可以是桌上型计算机、笔记本电脑、平板电脑、服务器、手机等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。
实施例一:
图1是本申请表情交互方法较佳实施例的步骤流程图。根据不同的需求,所述流程图中步骤的顺序可以改变,某些步骤可以省略。
参阅图1所示,所述表情交互方法具体包括以下步骤。
步骤S11、接收交互请求指令,并根据所述交互请求指令弹出一检测框进行人脸检测。
在一实施方式中,当接收到用户发出交互请求指令时,计算机设备将会根据所述交互请求指令弹出一检测框,并通过该检测框来进行人脸检测。比如用户可以通过触控屏触输入交互请求指 令、通过按键输入交互请求指令、或者通过语音输入交互请求指令。
在一实施方式中,可以通过建立并训练一卷积神经网络模型来实现人脸检测。具体地,可以通过以下方式来实现人脸检测:可以先构建人脸样本数据库并建立一用于进行人脸检测的卷积神经网络模型,所述人脸样本数据库包含多个人的人脸信息,每个人的人脸信息可以包括多种角度,每种角度的人脸信息可以有多张图片;将人脸样本数据库中的人脸图像输入至所述卷积神经网络模型,使用卷积神经网络模型的默认参数进行卷积神经网络训练;根据训练中间结果,对默认参数的初始权值、训练速率、迭代次数等进行不断调整,直到得到最优的卷积神经网络模型的网络参数,最后将具有最优网络参数的卷积神经网络模型作为最终的识别模型,训练完成后,即可利用该最终得到的卷积神经网络模型进行人脸检测。
步骤S12、判断是否检测到人脸图像。
在一实施方式中,可以根据所述卷积神经网络模型的输出来判断是否检测到人脸图像。若检测到人脸图像,则跳转至步骤S13。若未检测到人脸图像,则返回至步骤S11。
步骤S13,若检测到人脸图像,则定位所述人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表情的表情特征。
在一实施方式中,当在一预设时间内未检测到人脸图像时,可以输出一提示信息。当在所述预设时间检测到人脸图像时,定位所述人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表情的表情特征,由于不是对人脸图像的全部区域进行特征提取与运算,可以减少了运算量,提高人脸表情识别速度。所述人脸图像的关键特征区域可以包括眼睛、鼻子、嘴巴、眉毛等。
在一实施方式中,可以通过积分投影方式定位出人脸图像的眼睛、鼻子、嘴巴、眉毛等关键特征区域。由于眼睛是人脸当中比较突出的人脸特征,可以先对眼睛进行定位,则脸部其他器官,如:眼眉、嘴巴、鼻子等,可以由潜在的分布关系得出比较准确的定位。举例而言,关键特征区域定位通过对应于不同积分投影方式下产生的波峰或波谷进行,其中,积分投影分为垂直投影和水平投影,设f(x,y)表示图像(x,y)处的灰度值,在图像[y1,y2]和[x1,x2]区域的水平积分投影M h(y)和垂直积分投影M v(x)分别表示为:
Figure PCTCN2019103370-appb-000001
Figure PCTCN2019103370-appb-000002
其中,水平积分投影是将一行所有像素点的灰度值进行累加后再显示,而垂直积分投影是将一 列所有像素点的灰度值进行累加后再显示。通过定位两个波谷点x1、x2从人脸图像中把横轴[x1,x2]区域的图像截取出来,即可实现人脸图像左右边界的定位。对左右边界定位后二值化待识别人脸图像,分别进行水平积分投影和垂直积分投影。
进一步的,利用对人脸图像的先验知识可知,眉毛和眼睛是人脸图像中较近的黑色区域,其对应着水平积分投影曲线上的前两个极小值点。第一个极小值点对应的是眉毛在纵轴上的位置,记做y brow,第二个极小值点对应的是眼睛在纵轴上的位置,记做y eye,第三个极小值点对应的是鼻子在纵轴上的位置,记做y nose,第四个极小值点对应的是嘴巴在纵轴上的位置,记做y month。同样,人脸图像中心对称轴两侧出现两个极小值点,分别对应左右眼在横轴上的位置,记做x left-eye、x right-eye,眉毛在横轴上的位置和眼睛相同,嘴巴和鼻子在横轴上的位置为(x left-eye+x right-eye)/2,进而可以根据关键特征的坐标及预设规则确定眼睛区域、嘴唇区域、眉毛区域及鼻子区域,比如眼睛区域包括以左眼坐标为中心,向左15像素,向右15像素,向上10像素,向下10像素的区域及以右眼坐标为中心,向左15像素,向右15像素,向上10像素,向下10像素的区域。
在一实施方式中,人脸表情可以具有以下表现形式:高兴时的面部动作:嘴角翘起,面颊上抬起皱,眼睑收缩,眼睛尾部会形成“鱼尾纹”。伤心时的面部特征:眯眼,眉毛收紧,嘴角下拉,下巴抬起或收紧。害怕时的面部特征:嘴巴和眼睛张开,眉毛上扬,鼻孔张大。愤怒时的面部特征:眉毛下垂,前额紧皱,眼睑和嘴唇紧张。厌恶时的面部特征:嗤鼻,上嘴唇上抬,眉毛下垂,眯眼。惊讶时的面部特征:下颚下垂,嘴唇和嘴巴放松,眼睛张大,眼睑和眉毛微抬。轻蔑时的面部特征:嘴角一侧抬起,作讥笑或得意笑状等。当完成关键特征区域定位后,可以从关键特征区域中提取表征人脸表情的表情特征。比如可以采用基于差分能量图(DEI)法/中心化二值模式(CGBP)法来实现从关键特征区域中提取表征人脸表情的表情特征。
步骤S14、将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率,并将与所述预设表情库中的具有最大相似概率的表情作为所述待识别人脸表情。
在一实施方式中,所述预设表情库可以包括多种表情,比如包括:高兴、吃惊、悲伤、愤怒、厌恶、恐惧等表情,以及多种复合表情,如悲伤且恐惧、悲伤且吃惊、愤怒且恐惧等。所述待识别表情的表情特征可以是形状特征向量或纹理特征向量,当预设表情库中的每一表情的表情特征是以形状特征向量表征时,则获取所述待识别表情的形状特征向量,当预设表情库中的每个表 情的表情特征是以纹理特征向量表征时,则获取所述待识别表情的纹理特征向量。
在一实施方式中,可以通过以下方式来确定提取得到的表情特征(形状特征向量或纹理特征向量)与所述预设表情库中的每个表情的相似概率:获取所述待识别表情的特征向量(形状特征向量或纹理特征向量)和预设表情库中的每个表情的特征向量之间的距离值;根据距离值确定所述待识别人脸表情与所述预设表情库中的每个表情的相似概率。比如,获取所述待识别人脸表情的形状特征向量,计算所述待识别人脸表情的形状特征向量和所述预设表情库中的每一表情的形状特征向量之间的距离值,及根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。再比如,获取所述待识别人脸表情的纹理特征向量,计算所述待识别人脸表情的纹理特征向量和所述预设表情库中的每一表情的纹理特征向量之间的距离值,及根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。
在一实施方式中,所述距离值可以为广义马氏距离。可以通过如下公式计算得到所述待识别表情的特征向量和预设表情库中的每个表情的特征向量之间的距离值:
d M(y,x j)=(y-x j) T*M*(y-x j)。
其中,y为待识别人脸表情的形状特征向量(纹理特征向量),x j为预设表情库中的第j个表情的形状特征向量(纹理特征向量),M为预设目标度量矩阵,j为大于或者等于1的整数,d M(y,x j)为待识别人脸表情的形状特征向量(纹理特征向量)和预设表情库中的第j个表情的形状特征向量(纹理特征向量)之间的距离值,(y-x j)为待识别人脸表情的形状特征向量(纹理特征向量)与预设表情库中的第j个表情的形状特征向量(纹理特征向量)的差值,(y-x j) T为待识别人脸表情的形状特征向量(纹理特征向量)与预设表情库中的第j个表情的形状特征向量(纹理特征向量)的差值的转置;所述相似概率可以通过以下公式计算得到:
p={1+exp[D-b]} -1,其中,p为相似概率,D为距离值,b为预设偏置量。
在一实施方式中,当计算得到所述待识别人脸表情与所述预设表情库中的每个表情的相似概率后,可以将与预设表情库中的具有最大相似概率的表情作为所述待识别表情。
步骤S15、根据所述待识别人脸表情的识别结果控制计算机设备输出对应的互动内容。
在一实施方式中,可以预先建立多个表情与计算机设备输出 的互动内容的映射关系表,并根据所述映射关系表来实现根据表情识别结果控制计算机设备。所述互动内容可以是计算机设备根据表情识别结果给出对应的动作、语音、图片、文字、视频等来与用户互动,以实现舒缓用户紧张、焦虑,愉悦用户心情。比如,当判定所述待识别人脸表情为紧张表情时,可以控制计算机设备输出舒缓的音乐缓解用户紧张情绪或者控制计算机设备输出如何缓解紧张方法的建议内容(比如建议内容为:尝试缓慢深呼吸来缓解紧张情绪)供用户参考;当判定所述待识别人脸表情为悲伤表情时,可以控制计算机设备输出缓解悲伤的文章、音乐、视频或者控制计算机设备输出如何缓解悲伤方法的建议内容供用户参考。
步骤S16、获取所述互动内容输出后的反馈信息,并根据所述反馈信息接续控制所述计算机设备的内容输出。
在一实施方式中,所述反馈信息可以包括语音信息或者观看所述计算机设备输出所述互动内容后的表情信息。比如,控制计算机设备缓解用户当前的紧张表情,输出舒缓音乐来缓解用户紧张情绪,当该舒缓音乐播放完毕且接收到用户输入的“请重复播放或者请再次播放”的语音信息后,控制终端会再次播放前一刻播放的舒缓音乐;再比如,控制计算机设备为了缓解用户当前的紧张表情,输出舒缓音乐来缓解用户紧张情绪,当该舒缓音乐播放完毕且侦测到的用户表情仍然为紧张情绪时,可以控制终端播放另一首舒缓音乐或者不播放舒缓音乐,改为控制计算机设备输出如何缓解紧张方法的建议内容给用户。
在一实施方式中,当反馈信息是用户输入的语音信息时,可以直接根据语音信息要求调整所述计算机设备输出的互动内容,当反馈信息是用户观看所述计算机设备输出的互动内容后的表情信息时,还可以判断观看前的表情与观看互动内容后的表情之间的表情变化是否符合预设调整规则,若符合预设调整规则,则调整所述计算机设备输出的互动内容,若不符合预设调整规则,则不调整所述计算机设备输出的互动内容。比如,所述预设规则是表情从高兴转变悲伤的表情变化,若观看前识别得到的表情与观看互动内容后的表情之间的表情变化是从悲伤转变为高兴,则不符合所述预设调整规则,不进行调整。
上述表情交互方法,可识别用户表情并根据表情识别结果控制计算机设备输出对应的互动内容,可实现舒缓用户紧张、焦虑、抚慰用户心情等功能,同时还可以对互动内容播放后的用户表情进行进一步分析,并根据分析结果接续控制计算机设备的互动内容输出,实现与计算机设备交互更生动有趣,提高了用户使用体 验。
实施例二:
图2为本申请表情交互装置较佳实施例的功能模块图。
参阅图2所示,所述表情交互装置10可以包括检测模块101、判断模块102、提取模块103、比对模块104、输出模块105及控制模块106。
所述检测模块101用于接收交互请求指令,并根据所述交互请求指令弹出一检测框进行人脸检测。
在一实施方式中,当接收到用户发出交互请求指令时,所述检测模块101将会根据所述交互请求指令弹出一检测框,并通过该检测框来进行人脸检测。比如用户可以通过触控屏触输入交互请求指令、通过按键输入交互请求指令、或者通过语音输入交互请求指令。
在一实施方式中,所述检测模块101可以预先通过建立并训练一卷积神经网络模型来实现人脸检测。具体地,所述检测模块101可以通过以下方式来实现人脸检测:可以先构建人脸样本数据库并建立一用于进行人脸检测的卷积神经网络模型,所述人脸样本数据库包含多个人的人脸信息,每个人的人脸信息可以包括多种角度,每种角度的人脸信息可以有多张图片;将人脸样本数据库中的人脸图像输入至所述卷积神经网络模型,使用卷积神经网络模型的默认参数进行卷积神经网络训练;根据训练中间结果,对默认参数的初始权值、训练速率、迭代次数等进行不断调整,直到得到最优的卷积神经网络模型的网络参数,最后将具有最优网络参数的卷积神经网络模型作为最终的识别模型,训练完成后,所述检测模块101即可利用该最终得到的卷积神经网络模型进行人脸检测。
所述判断模块102用于判断是否检测到人脸图像。
在一实施方式中,所述判断模块102可以根据所述卷积神经网络模型的输出来判断是否检测到人脸图像。
所述提取模块103用于在检测到人脸图像时,定位所述人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表情的表情特征。
在一实施方式中,当所述判断模块102在一预设时间内判断未检测到人脸图像时,可以输出一提示信息。当所述判断模块102在所述预设时间内判断检测到人脸图像时,所述提取模块103定位所述人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表情的表情特征,由于不是对人脸图像的全部区域进行特征提取与运算,可以减少了运算量,提高人脸表情识别 速度。所述人脸图像的关键特征区域可以包括眼睛、鼻子、嘴巴、眉毛等。
在一实施方式中,所述提取模块103可以通过积分投影方式定位出人脸图像的眼睛、鼻子、嘴巴、眉毛等关键特征区域。由于眼睛是人脸当中比较突出的人脸特征,可以先对眼睛进行定位,则脸部其他器官,如:眼眉、嘴巴、鼻子等,可以由潜在的分布关系得出比较准确的定位。举例而言,关键特征区域定位通过对应于不同积分投影方式下产生的波峰或波谷进行,其中,积分投影分为垂直投影和水平投影,设f(x,y)表示图像(x,y)处的灰度值,在图像[y1,y2]和[x1,x2]区域的水平积分投影M h(y)和垂直积分投影M v(x)分别表示为:
Figure PCTCN2019103370-appb-000003
其中,水平积分投影是将一行所有像素点的灰度值进行累加后再显示,而垂直积分投影是将一列所有像素点的灰度值进行累加后再显示。通过定位两个波谷点x1、x2从人脸图像中把横轴[x1,x2]区域的图像截取出来,即可实现人脸图像左右边界的定位。对左右边界定位后二值化待识别人脸图像,分别进行水平积分投影和垂直积分投影。
进一步的,利用对人脸图像的先验知识可知,眉毛和眼睛是人脸图像中较近的黑色区域,其对应着水平积分投影曲线上的前两个极小值点。第一个极小值点对应的是眉毛在纵轴上的位置,记做y brow,第二个极小值点对应的是眼睛在纵轴上的位置,记做y eye,第三个极小值点对应的是鼻子在纵轴上的位置,记做y nose,第四个极小值点对应的是嘴巴在纵轴上的位置,记做y month。同样,人脸图像中心对称轴两侧出现两个极小值点,分别对应左右眼在横轴上的位置,记做x left-eye、x right-eye,眉毛在横轴上的位置和眼睛相同,嘴巴和鼻子在横轴上的位置为(x left-eye+x right-eye)/2,进而可以根据关键特征的坐标及预设规则确定眼睛区域、嘴唇区域、眉毛区域及鼻子区域,比如眼睛区域包括以左眼坐标为中心,向左15像素,向右15像素,向上10像素,向下10像素的区域及以右眼坐标为中心,向左15像素,向右15像素,向上10像素,向下10像素的区域。
在一实施方式中,人脸表情可以具有以下表现形式:高兴时的面部动作:嘴角翘起,面颊上抬起皱,眼睑收缩,眼睛尾部会形成“鱼尾纹”。伤心时的面部特征:眯眼,眉毛收紧,嘴角下拉,下巴抬起或收紧。害怕时的面部特征:嘴巴和眼睛张开,眉毛上扬,鼻孔张大。愤怒时的面部特征:眉毛下垂,前额紧皱,眼睑和嘴唇紧张。厌恶时的面部特征:嗤鼻,上嘴唇上抬,眉毛下垂,眯眼。惊讶时的面部特征:下颚下垂,嘴唇和嘴巴放松,眼睛张大,眼睑和眉毛微抬。轻蔑时的面部特征:嘴角一侧抬起,作讥笑或得意笑状等。当完成关键特征区域定位后,可以从关键特征区域中提取表征人脸表情的表情特征。 比如可以采用基于差分能量图(DEI)法/中心化二值模式(CGBP)法来实现从关键特征区域中提取表征人脸表情的表情特征。
所述比对模块104用于将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率,并将与所述预设表情库中的具有最大相似概率的表情作为所述待识别人脸表情。
在一实施方式中,所述预设表情库可以包括多种表情,比如包括:高兴、吃惊、悲伤、愤怒、厌恶、恐惧等表情,以及多种复合表情,如悲伤且恐惧、悲伤且吃惊、愤怒且恐惧等。所述待识别表情的表情特征可以是形状特征向量或纹理特征向量,当预设表情库中的每一表情的表情特征是以形状特征向量表征时,则获取所述待识别表情的形状特征向量,以进行比对,当预设表情库中的每个表情的表情特征是以纹理特征向量表征时,则获取所述待识别表情的纹理特征向量,以进行比对。
在一实施方式中,所述比对模块104可以通过以下方式来确定提取得到的表情特征(形状特征向量或纹理特征向量)与所述预设表情库中的每个表情的相似概率:获取所述待识别表情的特征向量(形状特征向量或纹理特征向量)和预设表情库中的每个表情的特征向量之间的距离值;根据距离值确定所述待识别人脸表情与所述预设表情库中的每个表情的相似概率。比如,所述比对模块104获取所述待识别人脸表情的形状特征向量,计算所述待识别人脸表情的形状特征向量和所述预设表情库中的每一表情的形状特征向量之间的距离值,及根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。再比如,所述比对模块104获取所述待识别人脸表情的纹理特征向量,计算所述待识别人脸表情的纹理特征向量和所述预设表情库中的每一表情的纹理特征向量之间的距离值,及根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。
在一实施方式中,所述距离值可以为广义马氏距离。所述比对模块104可以通过如下公式计算得到所述待识别表情的特征向量和预设表情库中的每个表情的特征向量之间的距离值:
d M(y,x j)=(y-x j) T*M*(y-x j)。
其中,y为待识别人脸表情的形状特征向量(纹理特征向量),x j为预设表情库中的第j个表情的形状特征向量(纹理特征向量),M为预设目标度量矩阵,j为大于或者等于1的整数,d M(y,x j)为待识别人脸表情的形状特征向量(纹理特征向量)和预设表情库中的第j个表情的形状特征向量(纹理特征向量)之间的距离值,(y-x j)为待 识别人脸表情的形状特征向量(纹理特征向量)与预设表情库中的第j个表情的形状特征向量(纹理特征向量)的差值,(y-x j) T为待识别人脸表情的形状特征向量(纹理特征向量)与预设表情库中的第j个表情的形状特征向量(纹理特征向量)的差值的转置;所述相似概率可以通过以下公式计算得到:
p={1+exp[D-b]} -1,其中,p为相似概率,D为距离值,b为预设偏置量。
在一实施方式中,当计算得到所述待识别人脸表情与所述预设表情库中的每个表情的相似概率后,所述比对模块104可以将与预设表情库中的具有最大相似概率的表情作为所述待识别表情。
所述输出模块105用于根据所述待识别人脸表情的识别结果控制计算机设备输出对应的互动内容。
在一实施方式中,可以预先建立多个表情与计算机设备输出的互动内容的映射关系表,并根据所述映射关系表来实现根据表情识别结果控制计算机设备。所述互动内容可以是计算机设备根据表情识别结果给出对应的动作、语音、图片、文字、视频等来与用户互动,以实现舒缓用户紧张、焦虑,愉悦用户心情。比如,当判定所述待识别人脸表情为紧张表情时,所述输出模块105可以控制计算机设备输出舒缓的音乐缓解用户紧张情绪或者控制计算机设备输出如何缓解紧张方法的建议内容(比如建议内容为:尝试缓慢深呼吸来缓解紧张情绪)供用户参考;当判定所述待识别人脸表情为悲伤表情时,所述输出模块105可以控制计算机设备输出缓解悲伤的文章、音乐、视频或者控制计算机设备输出如何缓解悲伤方法的建议内容供用户参考。
所述控制模块106用于获取所述互动内容输出后的反馈信息,并根据所述反馈信息接续控制所述计算机设备的内容输出。
在一实施方式中,所述反馈信息可以包括语音信息或者观看所述计算机设备输出所述互动内容后的表情信息。比如,控制计算机设备缓解用户当前的紧张表情,输出舒缓音乐来缓解用户紧张情绪,当该舒缓音乐播放完毕且接收到用户输入的“请重复播放或者请再次播放”的语音信息后,所述控制模块106控制终端会再次播放前一刻播放的舒缓音乐;再比如,控制计算机设备为了缓解用户当前的紧张表情,输出舒缓音乐来缓解用户紧张情绪,当该舒缓音乐播放完毕且侦测到的用户表情仍然为紧张情绪时,所述控制模块106可以控制终端播放另一首舒缓音乐或者不播放舒缓音乐,改为控制计算机设备输出如何缓解紧张方法的建议内容给用户。
在一实施方式中,当反馈信息是用户输入的语音信息时,所 述控制模块106可以直接根据语音信息要求调整所述计算机设备输出的互动内容,当反馈信息是用户观看所述计算机设备输出的互动内容后的表情信息时,所述控制模块106还可以判断观看前的表情与观看互动内容后的表情之间的表情变化是否符合预设调整规则,若符合预设调整规则,则所述控制模块106调整所述计算机设备输出的互动内容,若不符合预设调整规则,则不调整所述计算机设备输出的互动内容。比如,所述预设规则是表情从高兴转变悲伤的表情变化,若观看前识别得到的表情与观看互动内容后的表情之间的表情变化是从悲伤转变为高兴,则不符合所述预设调整规则,不进行调整。
上述表情交互装置,可识别用户表情并根据表情识别结果控制计算机设备输出对应的互动内容,可实现舒缓用户紧张、焦虑、抚慰用户心情等功能,同时还可以对互动内容播放后的用户表情进行进一步分析,并根据分析结果接续控制计算机设备的互动内容输出,实现与计算机设备交互更生动有趣,提高了用户使用体验。
图3为本申请计算机设备较佳实施例的示意图。
所述计算机设备1包括存储器20、处理器30以及存储在所述存储器20中并可在所述处理器30上运行的计算机可读指令40,例如表情交互程序。所述处理器30执行所述计算机可读指令40时实现上述表情交互方法实施例中的步骤,例如图1所示的步骤S11~S16。或者,所述处理器30执行所述计算机可读指令40时实现上述表情交互装置实施例中各模块的功能,例如图2中的模块101~106。
示例性的,所述计算机可读指令40可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器20中,并由所述处理器30执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令指令段,所述指令段用于描述所述计算机可读指令40在所述计算机设备1中的执行过程。例如,所述计算机可读指令40可以被分割成图2中的检测模块101、判断模块102、提取模块103、比对模块104、输出模块105及控制模块106。各模块具体功能参见实施例二。
所述计算机设备1可以是桌上型计算机、笔记本、掌上电脑、手机、平板电脑及云端服务器等计算设备。本领域技术人员可以理解,所述示意图仅仅是计算机设备1的示例,并不构成对计算机设备1的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述计算机设备1还可以包括输入输出设备、网络接入设备、总线等。
所称处理器30可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal  Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者所述处理器30也可以是任何常规的处理器等,所述处理器30是所述计算机设备1的控制中心,利用各种接口和线路连接整个计算机设备1的各个部分。
所述存储器20可用于存储所述计算机可读指令40和/或模块/单元,所述处理器30通过运行或执行存储在所述存储器20内的计算机可读指令和/或模块/单元,以及调用存储在存储器20内的数据,实现所述计算机设备1的各种功能。所述存储器20可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机设备1的使用所创建的数据(比如音频数据)等。此外,存储器20可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。
所述计算机设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性可读存储介质中,所述计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。
在本申请所提供的几个实施例中,应该理解到,所揭露的计算机设备和方法,可以通过其它的方式实现。例如,以上所描述的计算机设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
另外,在本申请各个实施例中的各功能单元可以集成在相同处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在相同单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其 他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。计算机设备权利要求中陈述的多个单元或计算机设备也可以由同一个单元或计算机设备通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种表情交互方法,其特征在于,所述方法包括:
    接收交互请求指令,并根据所述交互请求指令弹出一检测框进行人脸检测;
    判断是否检测到人脸图像;
    若检测到人脸图像,则定位所述人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表情的表情特征;
    将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率,并将与所述预设表情库中的具有最大相似概率的表情作为所述待识别人脸表情;
    根据所述待识别人脸表情的识别结果控制终端设备输出对应的互动内容;及
    获取所述互动内容输出后的反馈信息,并根据所述反馈信息接续控制所述终端设备的内容输出。
  2. 如权利要求1所述的表情交互方法,其特征在于,所述进行人脸检测的步骤包括:
    根据预设多个人脸样本训练得到用于进行人脸检测的卷积神经网络模型;及
    利用所述卷积神经网络模型进行人脸检测。
  3. 如权利要求1所述的表情交互方法,其特征在于,当所述预设表情库中的每一表情的表情特征为形状特征向量时,所述将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率的步骤包括:
    获取所述待识别人脸表情的形状特征向量;
    计算所述待识别人脸表情的形状特征向量和所述预设表情库中的每一表情的形状特征向量之间的距离值;及
    根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。
  4. 如权利要求1所述的表情交互方法,其特征在于,当所述预设表情库中的每一表情的表情特征为纹理特征向量时,所述将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率的步骤包括:
    获取所述待识别人脸表情的纹理特征向量;
    计算所述待识别人脸表情的纹理特征向量和所述预设表情库中的每一表情的纹理特征向量之间的距离值;及
    根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。
  5. 如权利要求3或4所述的表情交互方法,其特征在于,所述距离值通过以下公式计算得到:
    d M(y,x j)=(y-x j) T*M*(y-x j);
    其中,y为待识别人脸表情的形状特征向量/纹理特征向量,x j为预设表情库中的第j个表情的形状特征向量/纹理特征向量,M为预设目标度量矩阵,j为大于或者等于1的整数,d M(y,x j)为待识别人脸表情的形状特征向量/纹理特征向量和预设表情库中的第j个表情的形状特征向量/纹理特征向量之间的距离值,(y-x j)为待识别人脸表情的形状特征向量/纹理特征向量与预设表情库中的第j个表情的形状特征向量/纹理特征向量的差值,(y-x j) T为待识别人脸表情的形状特征向量/纹理特征向量与预设表情库中的第j个表情的形状特征向量/纹理特征向量的差值的转置;所述相似概率通过以下公式计算得到:
    p={1+exp[D-b]} -1,其中,p为相似概率,D为距离值,b为预设偏置量。
  6. 如权利要求1至4任意一项所述的表情交互方法,其特征在于,所述反馈信息包括语音信息或者观看所述终端设备输出所述互动内容后的表情信息。
  7. 如权利要求1至4任意一项所述的表情交互方法,其特征在于,所述反馈信息为观看所述终端设备输出所述互动内容后的表情信息,所述根据所述反馈信息接续控制所述终端设备的内容输出的步骤包括:
    判断观看所述终端设备输出所述互动内容前后的表情变化是否符合预设调整规则;
    若符合所述预设调整规则,则调整所述终端设备输出的互动内容;及
    若不符合所述预设调整规则,则不调整所述终端设备输出的互动内容。
  8. 一种表情交互装置,其特征在于,所述装置包括:
    检测模块,用于接收交互请求指令,并根据所述交互请求指令弹出一检测框进行人脸检测;
    判断模块,用于判断是否检测到人脸图像;
    提取模块,用于在检测到人脸图像时,定位所述人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表 情的表情特征;
    比对模块,用于将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率,并将与所述预设表情库中的具有最大相似概率的表情作为所述待识别人脸表情;
    输出模块,用于根据所述待识别人脸表情的识别结果控制终端设备输出对应的互动内容;及
    控制模块,用于获取所述互动内容输出后的反馈信息,并根据所述反馈信息接续控制所述终端设备的内容输出。
  9. 一种计算机设备,其特征在于,所述计算机设备包括处理器和存储器,所述存储器用于存储计算机可读指令,所述处理器执行所述计算机可读指令以实现以下步骤:
    接收交互请求指令,并根据所述交互请求指令弹出一检测框进行人脸检测;
    判断是否检测到人脸图像;
    若检测到人脸图像,则定位所述人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表情的表情特征;
    将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率,并将与所述预设表情库中的具有最大相似概率的表情作为所述待识别人脸表情;
    根据所述待识别人脸表情的识别结果控制终端设备输出对应的互动内容;及
    获取所述互动内容输出后的反馈信息,并根据所述反馈信息接续控制所述终端设备的内容输出。
  10. 如权利要求9所述的计算机设备,其特征在于,当所述预设表情库中的每一表情的表情特征为形状特征向量时,所述将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率的步骤包括:
    获取所述待识别人脸表情的形状特征向量;
    计算所述待识别人脸表情的形状特征向量和所述预设表情库中的每一表情的形状特征向量之间的距离值;及
    根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。
  11. 如权利要求9所述的计算机设备,其特征在于,当所述预设表情库中的每一表情的表情特征为纹理特征向量时,所述将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对, 得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率的步骤包括:
    获取所述待识别人脸表情的纹理特征向量;
    计算所述待识别人脸表情的纹理特征向量和所述预设表情库中的每一表情的纹理特征向量之间的距离值;及
    根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。
  12. 如权利要求10或11所述的计算机设备,其特征在于,所述距离值通过以下公式计算得到:
    d M(y,x j)=(y-x j) T*M*(y-x j);
    其中,y为待识别人脸表情的形状特征向量/纹理特征向量,x j为预设表情库中的第j个表情的形状特征向量/纹理特征向量,M为预设目标度量矩阵,j为大于或者等于1的整数,d M(y,x j)为待识别人脸表情的形状特征向量/纹理特征向量和预设表情库中的第j个表情的形状特征向量/纹理特征向量之间的距离值,(y-x j)为待识别人脸表情的形状特征向量/纹理特征向量与预设表情库中的第j个表情的形状特征向量/纹理特征向量的差值,(y-x j) T为待识别人脸表情的形状特征向量/纹理特征向量与预设表情库中的第j个表情的形状特征向量/纹理特征向量的差值的转置;所述相似概率通过以下公式计算得到:
    p={1+exp[D-b]} -1,其中,p为相似概率,D为距离值,b为预设偏置量。
  13. 如权利要求9至11任意一项所述的计算机设备,其特征在于,所述反馈信息包括语音信息或者观看所述终端设备输出所述互动内容后的表情信息。
  14. 如权利要求9至11任意一项所述的计算机设备,其特征在于,所述反馈信息为观看所述终端设备输出所述互动内容后的表情信息,所述根据所述反馈信息接续控制所述终端设备的内容输出的步骤包括:
    判断观看所述终端设备输出所述互动内容前后的表情变化是否符合预设调整规则;
    若符合所述预设调整规则,则调整所述终端设备输出的互动内容;及
    若不符合所述预设调整规则,则不调整所述终端设备输出的互动内容。
  15. 一种非易失性可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现以下步骤:
    接收交互请求指令,并根据所述交互请求指令弹出一检测框 进行人脸检测;
    判断是否检测到人脸图像;
    若检测到人脸图像,则定位所述人脸图像的关键特征区域,并从所述关键特征区域中提取表征待识别人脸表情的表情特征;
    将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率,并将与所述预设表情库中的具有最大相似概率的表情作为所述待识别人脸表情;
    根据所述待识别人脸表情的识别结果控制终端设备输出对应的互动内容;及
    获取所述互动内容输出后的反馈信息,并根据所述反馈信息接续控制所述终端设备的内容输出。
  16. 如权利要求15所述的存储介质,其特征在于,当所述预设表情库中的每一表情的表情特征为形状特征向量时,所述将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率的步骤包括:
    获取所述待识别人脸表情的形状特征向量;
    计算所述待识别人脸表情的形状特征向量和所述预设表情库中的每一表情的形状特征向量之间的距离值;及
    根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。
  17. 如权利要求15所述的存储介质,其特征在于,当所述预设表情库中的每一表情的表情特征为纹理特征向量时,所述将提取得到的表情特征与预设表情库中的每一表情的表情特征进行比对,得到所述待识别人脸表情与所述预设表情库中的每一表情的相似概率的步骤包括:
    获取所述待识别人脸表情的纹理特征向量;
    计算所述待识别人脸表情的纹理特征向量和所述预设表情库中的每一表情的纹理特征向量之间的距离值;及
    根据计算得到的距离值确定所述待识别人脸表情与所述预设表情库中的每一表情的相似概率。
  18. 如权利要求16或17所述的存储介质,其特征在于,所述距离值通过以下公式计算得到:
    d M(y,x j)=(y-x j) T*M*(y-x j);
    其中,y为待识别人脸表情的形状特征向量/纹理特征向量,x j为预设表情库中的第j个表情的形状特征向量/纹理特征向量,M为预设目标度量矩阵,j为大于或者等于1的整数,d M(y,x j)为待识别人 脸表情的形状特征向量/纹理特征向量和预设表情库中的第j个表情的形状特征向量/纹理特征向量之间的距离值,(y-x j)为待识别人脸表情的形状特征向量/纹理特征向量与预设表情库中的第j个表情的形状特征向量/纹理特征向量的差值,(y-x j) T为待识别人脸表情的形状特征向量/纹理特征向量与预设表情库中的第j个表情的形状特征向量/纹理特征向量的差值的转置;所述相似概率通过以下公式计算得到:
    p={1+exp[D-b]} -1,其中,p为相似概率,D为距离值,b为预设偏置量。
  19. 如权利要求15至17任意一项所述的存储介质,其特征在于,所述反馈信息包括语音信息或者观看所述终端设备输出所述互动内容后的表情信息。
  20. 如权利要求15至17任意一项所述的存储介质,其特征在于,所述反馈信息为观看所述终端设备输出所述互动内容后的表情信息,所述根据所述反馈信息接续控制所述终端设备的内容输出的步骤包括:
    判断观看所述终端设备输出所述互动内容前后的表情变化是否符合预设调整规则;
    若符合所述预设调整规则,则调整所述终端设备输出的互动内容;及
    若不符合所述预设调整规则,则不调整所述终端设备输出的互动内容。
PCT/CN2019/103370 2019-06-05 2019-08-29 表情交互方法、装置、计算机设备及可读存储介质 Ceased WO2020244074A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910487847.X 2019-06-05
CN201910487847.XA CN110363079A (zh) 2019-06-05 2019-06-05 表情交互方法、装置、计算机装置及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2020244074A1 true WO2020244074A1 (zh) 2020-12-10

Family

ID=68215622

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103370 Ceased WO2020244074A1 (zh) 2019-06-05 2019-08-29 表情交互方法、装置、计算机设备及可读存储介质

Country Status (2)

Country Link
CN (1) CN110363079A (zh)
WO (1) WO2020244074A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113269145A (zh) * 2021-06-22 2021-08-17 中国平安人寿保险股份有限公司 表情识别模型的训练方法、装置、设备及存储介质
CN113723299A (zh) * 2021-08-31 2021-11-30 上海明略人工智能(集团)有限公司 会议质量评分方法、系统和计算机可读存储介质
CN114971554A (zh) * 2022-05-26 2022-08-30 重庆金宝保信息技术服务有限公司 一种信息保真的保函业务自动审批系统

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764618A (zh) * 2019-10-25 2020-02-07 郑子龙 一种仿生交互系统、方法及相应的生成系统和方法
CN111507149B (zh) * 2020-01-03 2023-10-27 京东方艺云(杭州)科技有限公司 基于表情识别的交互方法、装置和设备
CN111638784B (zh) * 2020-05-26 2023-07-18 浙江商汤科技开发有限公司 人脸表情互动方法、互动装置以及计算机存储介质
CN112381019B (zh) * 2020-11-19 2021-11-09 平安科技(深圳)有限公司 复合表情识别方法、装置、终端设备及存储介质
CN112530543B (zh) * 2021-01-27 2021-11-02 张强 药品管理系统
CN113961680B (zh) * 2021-09-28 2025-07-18 京东方智慧物联科技有限公司 基于人机交互的会话处理方法及装置、介质、电子设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446753A (zh) * 2015-08-06 2017-02-22 南京普爱医疗设备股份有限公司 一种消极表情识别鼓励系统
KR20190008036A (ko) * 2017-07-14 2019-01-23 한국생산기술연구원 안드로이드 로봇의 얼굴 표정 생성 시스템 및 방법
CN109819100A (zh) * 2018-12-13 2019-05-28 平安科技(深圳)有限公司 手机控制方法、装置、计算机装置及计算机可读存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446753A (zh) * 2015-08-06 2017-02-22 南京普爱医疗设备股份有限公司 一种消极表情识别鼓励系统
KR20190008036A (ko) * 2017-07-14 2019-01-23 한국생산기술연구원 안드로이드 로봇의 얼굴 표정 생성 시스템 및 방법
CN109819100A (zh) * 2018-12-13 2019-05-28 平安科技(深圳)有限公司 手机控制方法、装置、计算机装置及计算机可读存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113269145A (zh) * 2021-06-22 2021-08-17 中国平安人寿保险股份有限公司 表情识别模型的训练方法、装置、设备及存储介质
CN113269145B (zh) * 2021-06-22 2023-07-25 中国平安人寿保险股份有限公司 表情识别模型的训练方法、装置、设备及存储介质
CN113723299A (zh) * 2021-08-31 2021-11-30 上海明略人工智能(集团)有限公司 会议质量评分方法、系统和计算机可读存储介质
CN114971554A (zh) * 2022-05-26 2022-08-30 重庆金宝保信息技术服务有限公司 一种信息保真的保函业务自动审批系统

Also Published As

Publication number Publication date
CN110363079A (zh) 2019-10-22

Similar Documents

Publication Publication Date Title
WO2020244074A1 (zh) 表情交互方法、装置、计算机设备及可读存储介质
CN109461167B (zh) 图像处理模型的训练方法、抠图方法、装置、介质及终端
US11703949B2 (en) Directional assistance for centering a face in a camera field of view
EP3726471B1 (en) Augmented reality method and device
JP2022528294A (ja) 深度を利用した映像背景減算法
CN109766759A (zh) 情绪识别方法及相关产品
WO2021213067A1 (zh) 物品显示方法、装置、设备及存储介质
WO2018028546A1 (zh) 一种关键点的定位方法及终端、计算机存储介质
WO2020244160A1 (zh) 终端设备控制方法、装置、计算机设备及可读存储介质
KR102045575B1 (ko) 스마트 미러 디스플레이 장치
US11017253B2 (en) Liveness detection method and apparatus, and storage medium
WO2021083125A1 (zh) 通话控制方法及相关产品
CN103562964A (zh) 图像处理装置、信息生成装置、图像处理方法、信息生成方法、控制程序及记录介质
CN108961314B (zh) 运动图像生成方法、装置、电子设备及计算机可读存储介质
US11216648B2 (en) Method and device for facial image recognition
JP2022518520A (ja) 画像変形の制御方法、装置およびハードウェア装置
WO2021169736A1 (zh) 美颜处理方法及装置
WO2020151156A1 (zh) 视频流播放方法、系统、计算机装置及可读存储介质
US20230306097A1 (en) Confirm Gesture Identity
CN109819100A (zh) 手机控制方法、装置、计算机装置及计算机可读存储介质
CN118632049A (zh) 一种aigc短剧生成信息处理方法及系统
CN108255995A (zh) 一种输出图像的方法及装置
WO2023197648A1 (zh) 截图处理方法及装置、电子设备和计算机可读介质
CN113657173B (zh) 一种数据处理方法、装置和用于数据处理的装置
JP2023043849A (ja) 仮想顔部モデルを調整する方法、装置、電子機器及び記憶媒体

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: 19931688

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19931688

Country of ref document: EP

Kind code of ref document: A1