CN109587035B - Head portrait display method and device of session interface, electronic equipment and storage medium - Google Patents

Head portrait display method and device of session interface, electronic equipment and storage medium Download PDF

Info

Publication number
CN109587035B
CN109587035B CN201811246809.7A CN201811246809A CN109587035B CN 109587035 B CN109587035 B CN 109587035B CN 201811246809 A CN201811246809 A CN 201811246809A CN 109587035 B CN109587035 B CN 109587035B
Authority
CN
China
Prior art keywords
user
head portrait
orientation
avatar
main body
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811246809.7A
Other languages
Chinese (zh)
Other versions
CN109587035A (en
Inventor
盛鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology 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 Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201811246809.7A priority Critical patent/CN109587035B/en
Publication of CN109587035A publication Critical patent/CN109587035A/en
Application granted granted Critical
Publication of CN109587035B publication Critical patent/CN109587035B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/046Interoperability with other network applications or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/42Mailbox-related aspects, e.g. synchronisation of mailboxes

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses a head portrait display method of a session interface, belongs to the technical field of computers, and is used for solving the problem that session information issued by a user of the session interface is opposite to a head portrait main body in direction and does not conform to normal conversation habits. The head portrait display method disclosed by the application comprises the following steps: acquiring a conversation message display position of conversation information issued by a user in a conversation interface and an avatar display position of the user corresponding to the conversation message display position; determining the orientation of a target avatar body according to the conversation message display position and the avatar display position; acquiring a user head portrait of the user with the head portrait subject orientation consistent with the target head portrait subject orientation; and displaying the obtained user head portrait at the head portrait display position. According to the method and the device, the orientation of the head portrait main body of the user is consistent with that of the target head portrait main body, so that the orientation of the head portrait main body of the displayed user points to the session information issued by the user, and the normal conversation habit is better met.

Description

Head portrait display method and device of session interface, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for displaying an avatar on a session interface, an electronic device, and a storage medium.
Background
The avatar is a picture for showing and distinguishing different users and roles in an application system, a product or a service, for example: an instant messaging conversation interface, wherein the avatar is used for identifying different speakers; in an email application, the avatar is used to identify different senders in a sequence of emails; forums, blogs, etc. where avatars are used to identify different information publishers. In the prior art, an avatar is usually displayed in a fixed position of the user-output session information or outgoing mail identified by the avatar to identify the publisher of the piece of session information. However, due to the limitation of storage space and other factors, in the prior art, users can only store and display the same avatar in the same application system. For example, in a plurality of different conversation interfaces of a certain user, the displayed avatar of the user is the same, which may cause the display orientation of the conversation information issued by the user and the avatar body of the user to face away from each other, which is not in accordance with the normal conversation habit.
Disclosure of Invention
The application provides a method for displaying the head portrait of the conversation interface, which is beneficial to solving the problem that the conversation information issued by a user of the conversation interface is opposite to the head portrait body and does not conform to the normal conversation habit.
In order to solve the above problem, in a first aspect, an embodiment of the present application provides an avatar display method for a session interface, including:
acquiring a conversation message display position of conversation information issued by a user in a conversation interface and an avatar display position of the user corresponding to the conversation message display position;
determining the orientation of a target avatar body according to the conversation message display position and the avatar display position;
acquiring a user head portrait of the user with the head portrait subject orientation consistent with the target head portrait subject orientation;
and displaying the obtained user head portrait at the head portrait display position.
In a second aspect, an embodiment of the present application provides an avatar presenting apparatus for a session interface, including:
the display position acquisition module is used for acquiring a conversation message display position of conversation information issued by a user in a conversation interface and an avatar display position of the user corresponding to the conversation message display position;
the head portrait subject orientation determining module is used for determining the orientation of the target head portrait subject according to the conversation message display position and the head portrait display position;
the head portrait acquisition module is used for acquiring a user head portrait of the user, wherein the head portrait main body orientation is consistent with the target head portrait main body orientation;
and the head portrait display module is used for displaying the obtained user head portrait at the head portrait display position.
In a third aspect, an embodiment of the present application further discloses an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the avatar display method of the session interface according to the embodiment of the present application when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor, and the steps of the avatar rendering method for a conversation interface disclosed in the present application are provided.
The method for displaying the avatar of the session interface, disclosed by the embodiment of the application, comprises the steps of obtaining a session message display position of session information issued by a user in the session interface and an avatar display position of the user corresponding to the session message display position; determining the orientation of a target avatar body according to the conversation message display position and the avatar display position; acquiring a user head portrait of the user with the head portrait subject orientation consistent with the target head portrait subject orientation; the obtained user head portrait is displayed at the head portrait display position, and the problem that session information issued by a session interface user and a head portrait body face away from each other and are not in accordance with normal conversation habits in the prior art is solved. According to the method for displaying the head portrait of the session interface, the orientation of the head portrait main body of the displayed user head portrait points to the session information issued by the user by acquiring and displaying the user head portrait of the user with the orientation of the head portrait main body consistent with the orientation of the target head portrait main body, so that the head portrait main body orientation of the user head portrait displayed on the session interface is consistent with the session information, normal conversation habits are better met, and user experience is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of an avatar display method of a session interface according to a first embodiment of the present application;
FIG. 2 is a diagram illustrating the avatar and the message effects of a conversation interface in the prior art;
fig. 3 is a schematic diagram of a method for determining an orientation of an avatar body according to a second embodiment of the present application;
fig. 4 is a schematic diagram of an avatar display effect of a session interface according to a second embodiment of the present application;
FIG. 5 is a flowchart of a method for displaying an avatar of a session interface according to a third embodiment of the present application;
FIG. 6 is a schematic structural diagram of an avatar rendering apparatus of a session interface according to a fourth embodiment of the present application;
fig. 7 is a second schematic structural diagram of an avatar display apparatus of a session interface according to a fourth embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Example one
As shown in fig. 1, the method for displaying the avatar of the session interface disclosed in this embodiment includes: step 110 to step 140.
Step 110, acquiring a session message display position of the session information issued by the user in the session interface, and an avatar display position of the user corresponding to the session message display position.
The method for displaying the head portrait of the session interface disclosed by the embodiment of the application is suitable for simultaneously displaying the session message issued by the user and the application scene of the head portrait of the user, such as instant messaging application, mail application, forum page application, microblog and other applications. Generally, each application defines in advance the relationship between the avatar display position of the user and the display position of the conversation message issued by the user. Wherein, the head portrait display position is the display position of the head portrait of the user. For example, in the session interface of the instant messaging application shown in fig. 2, the user avatar 210 of the peer user is shown on the right side of the mirror position of the session interface, the session message 220 of the peer user is shown on the left side of the user avatar 210, the user avatar 230 of the home user is shown on the left side of the mirror position of the session interface, and the session message 240 of the home user is shown on the right side of the user avatar 230.
In specific implementation, according to the position relationship between the user avatar of the user and the session messages issued by the user, and the session message display rules such as the number of the session messages issued in the current session, the session message display position of the session information issued by the user in the session interface and the avatar display position of the user corresponding to the session message display position can be determined. In some embodiments of the present application, the conversation message presentation position and the avatar presentation position may be represented by coordinates of a conversation interface.
And 120, determining the orientation of the target avatar body according to the conversation message display position and the avatar display position.
In the embodiment of the present application, the avatar body orientation refers to the indication direction of the main content in the user avatar. For example, when the user avatar includes a face image, the main body of the user avatar is oriented in a face orientation; when the user avatar includes an image of a target object whose direction may be indicated by an arrow, a wind vane, a gesture, or the like, the body of the user avatar is oriented in the direction of the arrow, wind vane, or gesture.
Further, the orientation of the target avatar body is determined according to the conversation message display position and the avatar display position. Wherein the target avatar body orientation is used to indicate a desired avatar body orientation. For example, when the conversation message presentation position is on the left side of the avatar presentation position, determining that the target avatar body is oriented to the left; when the conversation message display position is on the right side of the avatar display position, determining that the orientation of the target avatar body is towards the right; when the conversation message display position is below the avatar display position, determining that the orientation of the target avatar body is downward; when the conversation message display position is above the avatar display position, determining that the target avatar body is oriented upward.
In specific implementation, the orientation of the target avatar body may be determined to be other orientations according to the conversation message display position and the avatar display position, which is not illustrated in this embodiment.
And step 130, acquiring the user head portrait of the user with the head portrait subject orientation consistent with the target head portrait subject orientation.
Then, a user avatar of the user is obtained. In a specific implementation, the number of the user icons of the user may be one or more. Each avatar of the user may or may not have an attribute of the orientation of the main body of the avatar set in advance.
When the attribute of the orientation of the main body of the avatar is preset in the avatar of the user (i.e. the user avatar), a user avatar of the user whose main body of the avatar is in accordance with the orientation of the target main body of the avatar determined in the previous step may be selected as the user avatar to be currently displayed by the user according to the attribute. When the user avatar of the user with the orientation consistent with the orientation of the target avatar main body is not found according to the preset avatar main body orientation attribute in the user avatar of the user, the orientation of the avatar main body in the processed user avatar of the user can be consistent with the orientation of the target avatar main body by performing image processing (for example, turning and/or rotating, perspective processing on the user avatar of the user) on one user avatar of the user.
When the user head portrait of the user does not preset the attribute of the head portrait main body orientation, the head portrait main body orientation in the user head portrait can be determined through an image recognition technology. Then, if the orientation of the avatar main body determined through image recognition coincides with the orientation of the target avatar main body, the user avatar of the user is directly used. If the orientation of the main body of the avatar determined through image recognition is not consistent with the orientation of the target main body of the avatar, the orientation of the main body of the avatar in the processed user avatar can be consistent with the orientation of the target main body of the avatar by performing image processing on the user avatar of the user (for example, turning and/or rotating the user avatar of the user, perspective processing).
And 140, displaying the obtained user head portrait at the head portrait display position.
And finally, displaying the user head portrait of the user with the orientation of the acquired head portrait main body consistent with the orientation of the target head portrait main body at the head portrait display position in the conversation interface. The obtained user head portrait may be an original image of the user head portrait, or may be a user image obtained after image processing.
The method for displaying the avatar of the session interface, disclosed by the embodiment of the application, comprises the steps of obtaining a session message display position of session information issued by a user in the session interface and an avatar display position of the user corresponding to the session message display position; determining the orientation of a target avatar body according to the conversation message display position and the avatar display position; acquiring a user head portrait of the user with the head portrait subject orientation consistent with the target head portrait subject orientation; the obtained user head portrait is displayed at the head portrait display position, and the problem that session information issued by a session interface user and a head portrait body face away from each other and are not in accordance with normal conversation habits in the prior art is solved. According to the method for displaying the head portrait of the session interface, the orientation of the head portrait main body of the displayed user head portrait points to the session information issued by the user by acquiring and displaying the user head portrait of the user with the orientation of the head portrait main body consistent with the orientation of the target head portrait main body, so that the head portrait main body orientation of the user head portrait of the user displayed on the session interface is consistent with the session information, normal conversation habits are better met, and user experience is further improved.
Example two
Based on the first embodiment, in a specific implementation of the method for displaying the avatar of the session interface disclosed in this embodiment, the obtaining of the user avatar of the user whose avatar body has a same orientation as the target avatar body includes: determining the orientation of an avatar main body corresponding to the user avatar by performing image recognition on the user avatar of the user; and if the determined orientation of the main body of the head portrait is not consistent with the orientation of the main body of the target head portrait, performing image processing on the head portrait of the user to obtain the head portrait of the user with the orientation of the main body of the head portrait consistent with the orientation of the main body of the target head portrait.
In some embodiments of the present application, when the user avatar of the user has no avatar body orientation attribute set in advance, the avatar body orientation of the user avatar of the user can be identified through a neural network model trained in advance. In specific implementation, the avatar image with the avatar body facing the label preset can be used as a training sample to train the avatar body facing the neural network model offline. In the online application process, the user head portrait of the user is input to the trained neural network model of the head portrait main body orientation, and the head portrait main body orientation probability of the user head portrait can be determined.
In other embodiments of the present application, when the user avatar of the user does not have the avatar main body orientation attribute set in advance, the avatar picture may be processed based on an image recognition technology to determine the avatar main body orientation of the user avatar. For example, when the user avatar is a picture including a face image, determining the avatar body orientation corresponding to the user avatar by performing image recognition on the user avatar of the user includes: the method comprises the steps of carrying out facial recognition on a user head portrait of a user, and determining a facial width positioning line segment, a pupil positioning line segment and a facial physiological central point of a face in the user head portrait, wherein the pupil positioning line segment is a line segment connecting two pupils, the facial width positioning line segment is a line segment which is parallel to the pupil positioning line segment and is located at the widest position of the face, and the facial physiological central point comprises the following steps: the eyebrow, nose tip, lip tip; determining a first midpoint of the face width locator line segment and a second midpoint of the pupil locator line segment; and determining the orientation of the main head portrait body of the user head portrait according to the position relation between the physiological center point of the face and the first center point and the second center point.
In specific implementation, the face position and the pupil position in the user head portrait of the user can be determined through the face positioning and detecting technology in the prior art. Generally, as shown in fig. 3, the determined face position is a rectangular region R including eyebrows, eyes, nose and mouth, the width of the face is the width of the rectangle, and the face position P is output after the face is positioned1And P2And, including, but not limited to, the eyebrow center O1Nasal tip O2Lip tip O3Etc. the positions of the feature points. Furthermore, because the human face has a symmetrical structure, in the embodiment of the present application, the eyebrow, the nose tip, and the lip tip are called facial componentsAnd (4) centering the center point.
And then, determining the orientation of the main body of the head portrait corresponding to the head portrait of the user according to the direction of the pattern of the head portrait of the user deviating from the physiological central point of the face. For example, first according to the located pupil position P1And P2Determining a pupil location line segment P1P2And locate the pupil at the line segment P1P2Midpoint P of0As a second midpoint P0Determining a face width positioning line segment L under the pupil positioning line segment according to the determined face region1L2And locate the face width by line segment L1L2Midpoint L0As the first midpoint L0. Finally, according to the face physiological central point O1、O2And O3And the first midpoint L0And said second midpoint P0And determining the orientation of the head portrait main body corresponding to the head portrait of the user.
Optionally, the determining, according to the position relationship between the facial physiological center point and the first midpoint and the second midpoint, an avatar body orientation of the user avatar includes: if the face physiological center points are located on the same side of the first midpoint and the second midpoint, determining that the head portrait main body corresponding to the head portrait of the user faces one side of the first midpoint and the second midpoint where the face physiological center points are located. Taking the head portrait shown in fig. 3 as an example, the physiological center point O of the face1、O2And O3Are all located at the first midpoint L0And said second midpoint P0And on the right side, determining that the head portrait main body of the head portrait of the user faces to the right. The method for determining the orientation of the head portrait subject of the user including the face image is simple and effective, the calculation amount is small, and the efficiency is higher.
In other embodiments of the present application, if the facial physiological center point is located on the left side of both the first midpoint and the second midpoint, it is determined that the avatar body corresponding to the user avatar is oriented to the left.
In other embodiments of the present applicationThe physiological center point O of the face can be further determined1、O2And O3And determining the orientation of the head portrait main body of the head portrait of the user to be upward or downward according to the distance between the head portrait and the pupil positioning line segment and the state of human eyes.
After determining the avatar body orientation of the user's avatar, the user's avatar may be used directly if the avatar body orientation of the user's avatar coincides with the determined target avatar body orientation. And if the orientation of the head portrait main body of the user head portrait is not consistent with the orientation of the determined target head portrait main body, image processing needs to be carried out on the head portrait of the user. In the conversation message presentation interface shown in fig. 2, since the conversation message 220 issued by the opposite user is presented on the left side of the avatar 210 of the user thereof, the avatar of the user with the avatar body oriented to the left needs to be presented. In specific implementation, the user head portrait with the head portrait body facing to the left can be obtained by turning the user head portrait shown in fig. 3.
And then, displaying the head portrait of the user subjected to image processing at the head portrait display position of the conversation interface. The display effect is shown in fig. 4. Because the conversation message issued by the opposite-end user set by the instant messaging application is displayed on the left side of the user avatar of the opposite-end user, the message issued by the conversation message for the corresponding user is displayed more clearly in visual effect by displaying the user avatar with the avatar main body facing to the left, so that the avatar main body facing to the user avatar displayed on the conversation interface is consistent with the conversation message, the conversation interface better conforms to normal conversation habits, and the user experience is further improved.
In other embodiments of the present application, user avatars with different main body orientations may also be generated by simple picture processing, such as vertical flipping, perspective deformation, or other image processing means, according to a user avatar with a known avatar main body orientation.
EXAMPLE III
Referring to fig. 5, the avatar display method for a session interface disclosed in this embodiment includes steps 510 to 550.
Step 510, setting the head portrait main body orientation of the user head portrait of the user according to the head portrait information input by the user.
In some embodiments of the present application, before acquiring a conversation message display position of conversation information issued by a user in a conversation interface and an avatar display position of the user corresponding to the conversation message display position, the method further includes: and setting the head portrait main body orientation of the user head portrait of the user according to the head portrait information input by the user.
For example, when the orientation of the avatar body of the user's avatar cannot be determined by the image recognition technology, or the user is dissatisfied with the avatar of the specified avatar body orientation obtained by image processing the original avatar, the user may actively upload avatars of various avatar body orientations and set the avatar body orientation attribute of each avatar. Then, the system saves the head portrait uploaded by the user and the head portrait main body orientation attribute of the head portrait for subsequent display. The head portrait uploaded by the user is the user head portrait of the user.
Step 520, acquiring a session message display position of the session information issued by the user in the session interface, and an avatar display position of the user corresponding to the session message display position.
For a specific implementation of obtaining a session message display position of session information issued by a user in a session interface and a avatar display position of the user corresponding to the session message display position, refer to embodiment one, which is not described in detail in this embodiment.
Step 530, determining the orientation of the target avatar body according to the conversation message display position and the avatar display position.
Referring to the first embodiment, a specific implementation of determining the orientation of the target avatar body according to the session message display position and the avatar display position is described, and details are not repeated in this embodiment.
And 540, acquiring the user head portrait of the user with the head portrait subject orientation consistent with the target head portrait subject orientation.
In some embodiments of the present application, obtaining the user avatar of the user with the avatar body oriented in accordance with the target avatar body orientation includes: and selecting a user head portrait with the preset head portrait main body orientation matched with the target head portrait main body orientation from the user head portrait library of the user.
In specific implementation, when the user uploads the avatar with the attribute of the avatar body orientation in advance, according to the attribute, a user avatar of the user with the avatar body orientation consistent with the target avatar body orientation determined in the previous step may be selected as the user avatar to be currently displayed by the user.
And step 550, displaying the obtained user head portrait at the head portrait display position.
And finally, displaying the user head portrait of the user with the orientation of the acquired head portrait main body consistent with the orientation of the target head portrait main body at the head portrait display position in the conversation interface.
According to the method for displaying the head portrait of the conversation interface, the orientation attribute of the head portrait body of the user head portrait of the user is set and stored according to head portrait information input by the user, and after a conversation message display position of the conversation information issued by the user in the conversation interface and the head portrait display position of the user corresponding to the conversation message display position are obtained, the orientation of the target head portrait body is determined according to the conversation message display position and the head portrait display position; acquiring a user head portrait of the user with the head portrait subject orientation consistent with the target head portrait subject orientation; the obtained user head portrait is displayed at the head portrait display position, and the problem that session information issued by a session interface user and a head portrait body face away from each other and are not in accordance with normal conversation habits in the prior art is solved. According to the method for displaying the head portrait of the session interface, the orientation of the head portrait main body of the displayed user head portrait points to the session information issued by the user by acquiring and displaying the user head portrait of the user with the orientation of the head portrait main body consistent with the orientation of the target head portrait main body, so that the head portrait main body orientation of the user head portrait displayed on the session interface is consistent with the session information, normal conversation habits are better met, and user experience is further improved. The user head portraits with various head portraits main body orientations are stored in advance according to user operation and are used for displaying in corresponding scenes, and the diversity of interface display effects can be further improved.
Example four
As shown in fig. 6, the apparatus for displaying the avatar of the session interface disclosed in this embodiment includes:
a display position obtaining module 610, configured to obtain a session message display position of session information issued by a user in a session interface, and an avatar display position of the user corresponding to the session message display position;
an avatar body orientation determining module 620, configured to determine an orientation of a target avatar body according to the conversation message display position and the avatar display position;
an avatar obtaining module 630, configured to obtain a user avatar of the user whose avatar body is oriented in a direction consistent with the orientation of the target avatar body;
and an avatar display module 640, configured to display the obtained user avatar at the avatar display position.
In some embodiments of the present application, as shown in fig. 7, the avatar acquisition module 630 further includes:
the first avatar acquisition sub-module 6301 is configured to select one user avatar, of which the preset avatar body orientation is matched with the target avatar body orientation, from the user avatar library of the user. And a plurality of head portraits of the user are stored in the user head portraits library in advance, and each head portrait is provided with head portrait main body orientation information.
In some embodiments of the present application, as shown in fig. 7, the avatar acquisition module 630 further includes:
the second avatar acquisition submodule 6302 is configured to determine an avatar main body orientation corresponding to the user avatar by performing image recognition on the user avatar of the user; and the number of the first and second groups,
and if the determined orientation of the main body of the head portrait is not consistent with the orientation of the main body of the target head portrait, performing image processing on the head portrait of the user to obtain the head portrait of the user with the orientation of the main body of the head portrait consistent with the orientation of the main body of the target head portrait.
In some embodiments of the present application, determining an orientation of an avatar body corresponding to the avatar of the user by performing image recognition on the avatar of the user includes:
the method comprises the steps of carrying out facial recognition on a user head portrait of a user, and determining a facial width positioning line segment, a pupil positioning line segment and a facial physiological central point of a face in the user head portrait, wherein the pupil positioning line segment is a line segment connecting two pupils, the facial width positioning line segment is a line segment which is parallel to the pupil positioning line segment and is located at the widest position of the face, and the facial physiological central point comprises the following steps: the eyebrow, nose tip, lip tip;
determining a first midpoint of the face width locator line segment and a second midpoint of the pupil locator line segment;
and determining the orientation of the main head portrait body of the user head portrait according to the position relation between the physiological center point of the face and the first center point and the second center point.
In some embodiments of the present application, the determining the orientation of the main head portrait of the user according to the position relationship between the facial physiological center point and the first center point and the second center point comprises:
if the face physiological center points are located on the same side of the first midpoint and the second midpoint, determining that the head portrait main body corresponding to the head portrait of the user faces one side of the first midpoint and the second midpoint where the face physiological center points are located.
In some embodiments of the present application, as shown in fig. 7, the apparatus further comprises:
the avatar body orientation setting module 650 is configured to set an avatar body orientation of the user avatar of the user according to the avatar information input by the user.
The avatar display device for the session interface disclosed in the embodiments of the present application is used to implement the steps of the avatar display method for the session interface described in the first and second embodiments of the present application, and the specific implementation of each module of the device refers to the corresponding step, which is not described herein again.
The head portrait display device of the session interface disclosed by the embodiment of the application acquires a session message display position of session information issued by a user in the session interface and a head portrait display position of the user corresponding to the session message display position; determining the orientation of a target avatar body according to the conversation message display position and the avatar display position; acquiring a user head portrait of the user with the head portrait subject orientation consistent with the target head portrait subject orientation; the obtained user head portrait is displayed at the head portrait display position, and the problem that session information issued by a session interface user and a head portrait body face away from each other and are not in accordance with normal conversation habits in the prior art is solved. According to the head portrait display device of the conversation interface, the orientation of the head portrait main body is consistent with the orientation of the target head portrait main body, so that the orientation of the head portrait main body of the displayed user head portrait points to the conversation information issued by the user, the orientation of the head portrait main body of the user head portrait displayed on the conversation interface is consistent with the conversation information, normal conversation habits are better met, and user experience is further improved. The user head portraits with various head portraits main body orientations are stored in advance according to user operation and are used for displaying in corresponding scenes, and the diversity of interface display effects can be further improved.
Correspondingly, the application also discloses an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein when the processor executes the computer program, the processor realizes the avatar display method of the session interface according to the first embodiment and the second embodiment of the application. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer and the like.
The application also discloses a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the avatar presentation method of the session interface according to the first and second embodiments of the application.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The method and the device for displaying the avatar of the session interface provided by the application are described in detail above, a specific example is applied in the description to explain the principle and the implementation of the application, and the description of the above embodiment is only used to help understand the method and the core idea of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.

Claims (11)

1. A method for displaying an avatar of a session interface is characterized by comprising the following steps:
acquiring a conversation message display position of conversation information issued by a user in a conversation interface and an avatar display position of the user corresponding to the conversation message display position;
determining the orientation of a target avatar body according to the conversation message display position and the avatar display position;
acquiring a user head portrait of the user with the head portrait subject orientation consistent with the target head portrait subject orientation; the orientation of the head portrait subject is the face orientation of a face image or the orientation of an image of a target object for indicating the direction;
displaying the obtained user head portrait at the head portrait display position, wherein the obtained user head portrait is an original image of the user head portrait or a user image obtained after processing;
wherein, the user image obtained after the processing is obtained through the following steps:
determining the orientation of an avatar main body corresponding to the user avatar by performing image recognition on the user avatar of the user;
and if the determined orientation of the main body of the head portrait is not consistent with the orientation of the main body of the target head portrait, performing image processing on the head portrait of the user to obtain a processed image, wherein the processed image is the head portrait of the user with the orientation of the main body of the head portrait consistent with the orientation of the main body of the target head portrait.
2. The method of claim 1, wherein the step of obtaining the user avatar of the user with the avatar body oriented in line with the target avatar body orientation comprises:
and selecting a user head portrait with the preset head portrait main body orientation matched with the target head portrait main body orientation from the user head portrait library of the user.
3. The method of claim 1, wherein the step of obtaining the user avatar of the user with the avatar body oriented in line with the target avatar body orientation comprises:
determining the orientation of an avatar main body corresponding to the user avatar by performing image recognition on the user avatar of the user;
and if the determined orientation of the main body of the head portrait is not consistent with the orientation of the main body of the target head portrait, performing image processing on the head portrait of the user to obtain the head portrait of the user with the orientation of the main body of the head portrait consistent with the orientation of the main body of the target head portrait.
4. The method of claim 3, wherein the step of determining the orientation of the main body of the head portrait corresponding to the user head portrait by performing image recognition on the user head portrait of the user comprises:
the method comprises the steps of carrying out facial recognition on a user head portrait of a user, and determining a facial width positioning line segment, a pupil positioning line segment and a facial physiological central point of a face in the user head portrait, wherein the pupil positioning line segment is a line segment connecting two pupils, the facial width positioning line segment is a line segment which is parallel to the pupil positioning line segment and is located at the widest position of the face, and the facial physiological central point comprises the following steps: the eyebrow, nose tip, lip tip;
determining a first midpoint of the face width locator line segment and a second midpoint of the pupil locator line segment;
and determining the orientation of the main head portrait body of the user head portrait according to the position relation between the physiological center point of the face and the first center point and the second center point.
5. The method according to claim 4, wherein the step of determining the orientation of the main body of the head portrait of the user according to the position relationship between the physiological center point of the face and the first and second center points comprises:
if the face physiological center points are located on the same side of the first midpoint and the second midpoint, determining that the head portrait main body corresponding to the head portrait of the user faces one side of the first midpoint and the second midpoint where the face physiological center points are located.
6. The method according to any one of claims 1 to 5, wherein, before the step of obtaining the conversation information display position of the conversation information published by the user in the conversation interface and the avatar display position of the user corresponding to the conversation information display position, the method further comprises:
and setting the head portrait main body orientation of the user head portrait of the user according to the head portrait information input by the user.
7. An avatar presentation apparatus for a conversational interface, comprising:
the display position acquisition module is used for acquiring a conversation message display position of conversation information issued by a user in a conversation interface and an avatar display position of the user corresponding to the conversation message display position;
the head portrait subject orientation determining module is used for determining the orientation of the target head portrait subject according to the conversation message display position and the head portrait display position;
the head portrait acquisition module is used for acquiring a user head portrait of the user, wherein the head portrait main body orientation is consistent with the target head portrait main body orientation; the orientation of the head portrait subject is the face orientation of a face image or the orientation of an image of a target object for indicating the direction;
and the head portrait display module is used for displaying the acquired user head portrait at the head portrait display position, wherein the acquired user head portrait is an original image of the user head portrait or a user image obtained after processing.
8. The apparatus of claim 7, wherein the avatar acquisition module further comprises:
and the first head portrait acquisition sub-module is used for selecting a user head portrait with the preset head portrait main body orientation matched with the target head portrait main body orientation from the user head portrait library of the user.
9. The apparatus of claim 7, wherein the avatar acquisition module further comprises:
the second head portrait acquisition sub-module is used for carrying out image recognition on the user head portrait of the user and determining the head portrait main body orientation corresponding to the user head portrait; and the number of the first and second groups,
and if the determined orientation of the main body of the head portrait is not consistent with the orientation of the main body of the target head portrait, performing image processing on the head portrait of the user to obtain the head portrait of the user with the orientation of the main body of the head portrait consistent with the orientation of the main body of the target head portrait.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the avatar rendering method of the session interface of any one of claims 1 to 6 when executing the computer program.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the avatar rendering method of a conversational interface as claimed in any one of claims 1 to 6.
CN201811246809.7A 2018-10-24 2018-10-24 Head portrait display method and device of session interface, electronic equipment and storage medium Active CN109587035B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811246809.7A CN109587035B (en) 2018-10-24 2018-10-24 Head portrait display method and device of session interface, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811246809.7A CN109587035B (en) 2018-10-24 2018-10-24 Head portrait display method and device of session interface, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109587035A CN109587035A (en) 2019-04-05
CN109587035B true CN109587035B (en) 2020-08-07

Family

ID=65920467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811246809.7A Active CN109587035B (en) 2018-10-24 2018-10-24 Head portrait display method and device of session interface, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109587035B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113271246B (en) * 2020-02-14 2023-03-31 钉钉控股(开曼)有限公司 Communication method and device
CN113395201B (en) * 2021-06-10 2024-02-23 广州繁星互娱信息科技有限公司 Head portrait display method, device, terminal and server in chat session

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104574321A (en) * 2015-01-29 2015-04-29 京东方科技集团股份有限公司 Image correction method and device and video system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090141047A1 (en) * 2007-11-29 2009-06-04 International Business Machines Corporation Virtual world communication display method
US10339365B2 (en) * 2016-03-31 2019-07-02 Snap Inc. Automated avatar generation
CN105920839A (en) * 2016-05-15 2016-09-07 大连文森特软件科技有限公司 Network game dialogue online editing system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104574321A (en) * 2015-01-29 2015-04-29 京东方科技集团股份有限公司 Image correction method and device and video system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
仙剑4中感人对话及画面你喜欢哪张(3);黑衣羽林;《httpwww.07073.comxjolxinwen654376_3.html》;20121102;第一页 *

Also Published As

Publication number Publication date
CN109587035A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
US11182591B2 (en) Methods and apparatuses for detecting face, and electronic devices
KR102586855B1 (en) Combining first user interface content into a second user interface
US11450051B2 (en) Personalized avatar real-time motion capture
US11763481B2 (en) Mirror-based augmented reality experience
US11455765B2 (en) Method and apparatus for generating virtual avatar
CN113383369A (en) Body posture estimation
JP2019117646A (en) Method and system for providing personal emotional icons
CN115735229A (en) Updating avatar garments in messaging systems
CN111260754B (en) Face image editing method and device and storage medium
CN107168619B (en) User generated content processing method and device
JP2020504877A (en) Automatic suggestion to share images
CN112527115B (en) User image generation method, related device and computer program product
KR101743764B1 (en) Method for providing ultra light-weight data animation type based on sensitivity avatar emoticon
US20220300728A1 (en) True size eyewear experience in real time
US11856255B2 (en) Selecting ads for a video within a messaging system
CN109587035B (en) Head portrait display method and device of session interface, electronic equipment and storage medium
US20230120037A1 (en) True size eyewear in real time
CN113223125B (en) Face driving method, device, equipment and medium for virtual image
CN105022480A (en) Input method and terminal
CN111010526A (en) Interaction method and device in video communication
CN113408452A (en) Expression redirection training method and device, electronic equipment and readable storage medium
KR20240090542A (en) Mirror-based augmented reality experience
CN117041651A (en) Barrage processing method and related equipment
CN115426505A (en) Preset expression special effect triggering method based on face capture and related equipment
CN113908553A (en) Game character expression generation method and device, electronic equipment and storage medium

Legal Events

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