Image processing method, device, equipment and computer readable storage medium
By combining facial and human expression types for recognition and editing, the problem of low accuracy in emoticon package production in the existing technology is solved, achieving more accurate emotional expression and improving user experience.
Patent Information
- Application Number
- CN202010192033.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-18
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2040-03-18
AI Technical Summary
Existing emoticon package production methods only produce facial expressions based on facial expression types, resulting in poor recognition accuracy and inability to truly represent the user's emotions.
By obtaining the image processing instructions sent by the terminal device, the key frames in the video to be processed are determined, and the facial expression type and human expression type are combined for recognition, the target expression type is comprehensively determined, and editing is performed to generate the target expression image.
It improves the accuracy of user expression recognition, enables the generated emoticon package to more accurately represent the true emotion of the image, enhances the authenticity and applicability of the emoticon package, and improves the user experience.
Smart Images

Figure CN111767779B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an image processing method, device, equipment and computer-readable storage medium. Background Art
[0002] As living standards continue to improve, people's entertainment needs are increasing day by day. When users chat on social applications, in order to more clearly express their current emotions, they generally send emoticons during the chat. Since images can more accurately express emotions than text and are also entertaining, users are more inclined to customize emoticon packages through images than preset emoticons on social applications.
[0003] In order to create a custom emoticon package, the user is generally required to first input an image for creating the emoticon package, recognize the facial expressions in the image through a preset expression recognition model, and set text and stickers based on the recognition results.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: the existing expression package production method often only takes into account the factors of facial expression type, and the facial expression type cannot represent the user's true emotions in many cases. For example, when the user is in a bad mood and smiles bitterly, the expression recognition model may recognize the expression of the face as happy or joyful. Therefore, the recognition accuracy is poor, and the accuracy of the expression package produced according to the facial expression type is also not high, and it cannot represent the user's true emotions. Summary of the invention
[0005] The present invention provides an image processing method, device, equipment and computer-readable storage medium, which are used to solve the technical problem that the existing emoticon package production method only produces emoticon packages according to facial expression types, and the produced emoticon packages cannot truly express user emotions due to poor recognition accuracy.
[0006] A first aspect of the present invention is to provide an image processing method, comprising:
[0007] Obtaining an image processing instruction sent by a terminal device, wherein the image processing instruction includes a video to be processed;
[0008] Determining at least one key frame to be processed in the video to be processed according to the image processing instruction;
[0009] Performing facial expression recognition and human expression recognition on the key frame, and determining a target expression type according to the recognized facial expression type and human expression type;
[0010] Performing an editing operation on the key frame according to the target expression type to obtain a target expression image;
[0011] The target expression image is sent to a terminal device so that a user can edit the target expression image.
[0012] In a possible design, the step of performing facial expression type recognition and body expression type recognition on the key frame includes:
[0013] Inputting the key frame into a preset facial expression recognition model to obtain the facial expression type corresponding to the key frame;
[0014] Performing a screening operation on the key frames according to the facial expression types corresponding to the key frames to obtain target key frames;
[0015] A human expression type recognition operation is performed on the target key frame to obtain the human expression type corresponding to the target key frame.
[0016] In a possible design, the filtering operation on the key frames according to the facial expression types corresponding to the key frames includes:
[0017] Acquire candidate key frames in the key frames, the confidence level corresponding to the facial expression type exceeding a preset confidence level threshold;
[0018] The key frames within a preset time interval before and after the candidate key frames in the video to be processed are used as the target key frames.
[0019] In a possible design, performing a human expression type recognition operation on the target key frame to obtain the human expression type corresponding to the target key frame includes:
[0020] Inputting the target key frame into a preset human body recognition model to obtain posture information corresponding to the target key frame;
[0021] The human expression type corresponding to the target key frame is determined according to the posture information and a preset human posture emotion table, wherein the human posture emotion table includes joint bending angles corresponding to a plurality of preset human expression types.
[0022] In a possible design, before performing facial expression type recognition and body expression type recognition on the key frame, the method further includes:
[0023] The facial key points in the at least one key frame are identified by using a preset key point recognition model, and a face alignment operation is performed on the at least one key frame according to the facial key points.
[0024] In a possible design, before performing facial expression type recognition and body expression type recognition on the key frame, the method further includes:
[0025] Obtain the target face image pre-entered by the user;
[0026] Determining the similarity between the face image in the key frame and the target face image;
[0027] When the similarity exceeds a preset similarity threshold, facial expression type recognition and human body expression type recognition are performed on the key frame.
[0028] In a possible design, the editing operation on the key frame according to the target expression type to obtain the target expression image includes:
[0029] Acquiring preset text and / or stickers corresponding to the target expression type from a data server according to the target expression type;
[0030] The key frame is edited according to the text and / or sticker corresponding to the target expression type to obtain a target expression image.
[0031] Another aspect of the present invention is to provide an image processing device, comprising:
[0032] An acquisition module, used for acquiring an image processing instruction sent by a terminal device, wherein the image processing instruction includes a video to be processed;
[0033] A determination module, configured to determine at least one key frame to be processed in the video to be processed according to the image processing instruction;
[0034] A processing module, used for performing facial expression recognition and human expression recognition on the key frame, and obtaining a target expression type according to the recognized facial expression type and human expression type;
[0035] An editing module, used for editing the key frame according to the target expression type to obtain a target expression image;
[0036] The sending module is used to send the target expression image to a terminal device so that a user can edit the target expression image.
[0037] In one possible design, the processing module includes:
[0038] A first recognition unit, used for inputting the key frame into a preset facial expression recognition model to obtain the facial expression type corresponding to the key frame;
[0039] A screening unit, used for screening the key frames according to the facial expression types corresponding to the key frames to obtain target key frames;
[0040] The second recognition unit is used to perform a human expression type recognition operation on the target key frame to obtain the human expression type corresponding to the target key frame.
[0041] In a possible design, the second identification unit is used to:
[0042] Acquire candidate key frames in the key frames, the confidence level corresponding to the facial expression type exceeding a preset confidence level threshold;
[0043] The key frames within a preset time interval before and after the candidate key frames in the video to be processed are used as the target key frames.
[0044] In a possible design, the second identification unit is used to:
[0045] Inputting the target key frame into a preset human body recognition model to obtain posture information corresponding to the target key frame;
[0046] The human expression type corresponding to the target key frame is determined according to the posture information and a preset human posture emotion table, wherein the human posture emotion table includes joint bending angles corresponding to a plurality of preset human expression types.
[0047] In one possible design, the device further includes:
[0048] The preprocessing module is used to identify the facial key points in the at least one key frame through a preset key point recognition model, and perform a face alignment operation on the at least one key frame according to the facial key points.
[0049] In one possible design, the device further includes:
[0050] An image acquisition module is used to acquire a target face image input in advance by a user;
[0051] A similarity determination module, used to determine the similarity between the face image in the key frame and the target face image;
[0052] The recognition module is used to perform facial expression type recognition and human body expression type recognition on the key frame when the similarity exceeds a preset similarity threshold.
[0053] In a possible design, the editing module is used to:
[0054] Acquiring preset text and / or stickers corresponding to the target expression type from a data server according to the target expression type;
[0055] The key frame is edited according to the text and / or sticker corresponding to the target expression type to obtain a target expression image.
[0056] Another aspect of the present invention is to provide an image processing device, comprising: a memory, a processor;
[0057] Memory; Memory for storing instructions executable by the processor;
[0058] Wherein, the processor is configured to execute the image processing method as described in the first aspect.
[0059] Another aspect of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the image processing method as described in the first aspect.
[0060] The image processing method, device, equipment and computer-readable storage medium provided by the present invention determine at least one key frame in the video to be processed according to the image processing instruction sent by the terminal device, determine the facial expression type and human expression type corresponding to each key frame, and comprehensively determine the target expression type of the user image in the key frame according to the facial expression type and human expression type, and then edit the key frame according to the target expression type to obtain the target expression image, and send the target expression image to the terminal device for display. By respectively determining the facial expression type and the human expression type, and jointly determining the target expression type according to the facial expression type and the human expression type, the accuracy of user expression recognition can be improved, and then the target expression image produced according to the target expression type can more accurately represent the real emotion of the image, improve the authenticity and applicability of the target expression image, and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention, and a person skilled in the art can also obtain other drawings based on these drawings.
[0062] Figure 1 A schematic diagram of the system architecture based on an embodiment of the present invention;
[0063] Figure 2 A schematic diagram of the flow of an image processing method provided in Embodiment 1 of the present invention;
[0064] Figure 3 A schematic diagram of face alignment provided by an embodiment of the present invention;
[0065] Figure 4A schematic diagram of a flow chart of an image processing method provided in Embodiment 2 of the present invention;
[0066] Figure 5 A schematic diagram of a classic expression provided by an embodiment of the present invention;
[0067] Figure 6 A schematic diagram of the effect of the face detection model provided by an embodiment of the present invention;
[0068] Figure 7 A schematic diagram of the recognition result of the human body recognition model provided by an embodiment of the present invention;
[0069] Figure 8 A human body posture emotion table provided by an embodiment of the present invention;
[0070] Fig. 9 A schematic diagram of a flow chart of an image processing method provided in Embodiment 3 of the present invention;
[0071] Fig.10 A schematic diagram of a flow chart of an image processing method provided in Embodiment 4 of the present invention;
[0072] Fig.11 Another system architecture diagram based on the embodiment of the present invention;
[0073] Fig.12 A schematic diagram of the structure of an image processing device provided in Embodiment 5 of the present invention;
[0074] Fig.13 A schematic diagram of the structure of an image processing device provided in Embodiment 6 of the present invention;
[0075] Fig.14 A schematic diagram of the structure of an image processing device provided in Embodiment 7 of the present invention;
[0076] Fig.15 This is a schematic diagram of the structure of an image processing device provided in Embodiment 8 of the present invention. DETAILED DESCRIPTION
[0077] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained based on the embodiments in the present invention belong to the scope of protection of the present invention.
[0078] In view of the technical problem that the existing emoticon package production method mentioned above only produces emoticon packages according to facial expression types, and the produced emoticon packages cannot truly express the user's emotions due to poor recognition accuracy, the present invention provides an image processing method, device, equipment and computer-readable storage medium.
[0079] It should be noted that the image processing method, apparatus, device and computer-readable storage medium provided by the present application can be used in various scenarios of producing emoticon packages based on user images.
[0080] The existing emoticon package production method generally obtains the emoticon package production instruction including the face image, then uses the preset expression recognition model to identify the facial expression type of the face image, and performs corresponding editing and processing on the face image according to the facial expression type to obtain the emoticon package. However, the face image often cannot accurately express the user's true emotions, and accordingly, the effect of the emoticon package produced according to the facial expression type cannot meet the needs of the user.
[0081] In view of the defects of the prior art, the inventor found in the process of research that humans have different body movements under different emotions, for example, they may dance when they are happy, and they may curl up their limbs when they are frustrated. In order to improve the authenticity and applicability of the emoticon package, it is possible to determine the user's real emotions based on the facial expression type and the human body expression type. Then, the emoticon package is produced based on the real emotions.
[0082] The inventor further discovered that by determining at least one key frame in the video to be processed according to the image processing instruction sent by the terminal device, determining the facial expression type and human expression type corresponding to each key frame, and comprehensively determining the target expression type of the user image in the key frame according to the facial expression type and human expression type, the key frame can be edited and processed according to the target expression type to obtain a target expression image, and the target expression image is sent to the terminal device for display. By separately determining the facial expression type and human expression type, and jointly determining the target expression type according to the facial expression type and human expression type, the accuracy of user expression recognition can be improved, and the target expression image produced according to the target expression type can more accurately represent the real emotion of the image, improve the authenticity and applicability of the target expression image, and improve the user experience.
[0083] Figure 1 Schematic diagram of the system architecture based on the embodiment of the present invention, such as Figure 1 As shown, the system architecture based on the present invention at least includes: a terminal device 1 and an image processing device 2. The image processing device 2 is written in languages such as C / C++, Java, Shell or Python; the terminal device 1 can be, for example, a desktop computer, a tablet computer, etc.
[0084] Figure 2 A flowchart of an image processing method provided in Embodiment 1 of the present invention is shown in FIG. Figure 2 As shown, the method includes:
[0085] Step 101: Obtain an image processing instruction sent by a terminal device, wherein the image processing instruction includes a video to be processed.
[0086] The execution subject of this embodiment is an image processing device, which is connected to the terminal device in communication so as to be able to exchange information with the terminal device. It should be noted that the image processing device can be set in the terminal device or can be an independent device, and the present invention does not limit this.
[0087] In this embodiment, in order to realize the production of expression images, the user can send an image processing instruction to the image processing device on the terminal device. Specifically, the user can select a video to be processed for producing expression images on the terminal device, and can send the image processing instruction by triggering a preset production button on the display interface. Correspondingly, the image processing device can receive the image processing instruction, wherein the image processing instruction includes the video to be processed.
[0088] Specifically, the image processing instruction may also include an image to be processed, so that the image processing device can realize the production of a static expression image based on the image to be processed. Correspondingly, when the image processing instruction includes a video to be processed, the image processing device can realize the production of a static expression image based on the video to be processed, and can also realize the production of a dynamic expression image.
[0089] Step 102: According to the image processing instruction, determine at least one key frame to be processed in the video to be processed.
[0090] In this embodiment, after obtaining the image processing instruction, the image processing instruction can perform frame extraction processing on the video to be processed according to the image processing instruction to obtain at least one key frame to be processed. Specifically, any existing tool that can realize video frame extraction can be used to obtain the key frame, and the present invention does not limit this. In practical applications, the number of frames extracted per second can be set according to actual needs.
[0091] Step 103: performing facial expression recognition and human expression recognition on the key frame, and determining a target expression type according to the recognized facial expression type and human expression type.
[0092] In this embodiment, in order to improve the accuracy of determining the emotion of the user image in the key frame, the facial expression type and the human expression type corresponding to the key frame can be determined. Specifically, the facial expression type and the human expression type can be identified on the key frame to obtain the facial expression type and the human expression type, respectively. Thus, the facial expression type and the human expression type can be combined to achieve the determination of the target expression type.
[0093] Different from the existing solution of only producing emoticon packages based on facial expression types, by separately determining the facial expression types and human expression types corresponding to the key frames, the accuracy of user expression recognition can be improved, and the target expression image produced according to the target expression type can more accurately represent the true emotion of the image.
[0094] Step 104: Edit the key frame according to the target expression type to obtain a target expression image.
[0095] In this embodiment, after determining the target expression type corresponding to the key frame, the image processing device can edit the key frame according to the target expression type to obtain the target image. For example, when the target expression type is happy, stickers such as flowers and ribbons representing happiness can be added to the key frame; happy words can also be added to the key frame; as an implementable method, the color of the key frame can also be adjusted to a brighter color.
[0096] Step 105: Send the target expression image to a terminal device so that the user can edit the target expression image.
[0097] In this embodiment, after the target expression image is produced, in order to enable the user to view and edit the target expression type, the target expression image can be sent to the terminal device. Accordingly, after receiving the target expression image, the terminal device can display the target expression image on the display interface. Thus, the user can further modify or set the target expression image according to actual needs.
[0098] Further, based on any of the above embodiments, before step 103, the method further includes:
[0099] The facial key points in the at least one key frame are identified by using a preset key point recognition model, and a face alignment operation is performed on the at least one key frame according to the facial key points.
[0100] In this embodiment, since some facial images in the key frames are tilted or rotated, in order to improve the efficiency of producing the target expression image, it is necessary to perform face alignment on the key frames. Specifically, the face key points in at least one key frame can be identified by a preset key point recognition model, and the face alignment operation can be performed on at least one key frame according to the face key points. Specifically, the face alignment operation can be performed using the key point coordinates regressed by MTCNN and the standard face key point positions. Affine transformation is performed using the key points to transform irregular key frames into standard key frames for feature extraction. Standard key frames are more conducive to subsequent feature recognition and classification.
[0101] Figure 3 A schematic diagram of face alignment provided by an embodiment of the present invention, such as Figure 3 As shown, the face image in the key frame is tilted to the right. In order to facilitate the subsequent recognition of the facial expression type of the key frame, the key frame can be aligned to obtain a key frame with the face centered.
[0102] Specifically, based on any of the above embodiments, the number of the facial expression type and the body expression type is at least one;
[0103] Accordingly, step 103 specifically includes:
[0104] The overlapping expressions between the facial expression type and the human body expression type are used as the target expression type.
[0105] In this embodiment, after performing facial expression type recognition and human body expression type recognition on the key frame, multiple different expressions may be obtained. For example, after facial expression type recognition, the result may be happiness, sadness, and anger; and after human body expression type recognition, the result may be anger, fear, and disgust. Among them, both facial expression types and human body expression types include anger, so anger can be used as the target expression type.
[0106] The image processing method provided in this embodiment determines at least one key frame in the video to be processed according to the image processing instruction sent by the terminal device, determines the facial expression type and human expression type corresponding to each key frame, and comprehensively determines the target expression type of the user image in the key frame according to the facial expression type and human expression type, and then can edit and process the key frame according to the target expression type to obtain the target expression image, and send the target expression image to the terminal device for display. By determining the facial expression type and human expression type respectively, and jointly determining the target expression type according to the facial expression type and human expression type, the accuracy of user expression recognition can be improved, and then the target expression image produced according to the target expression type can more accurately represent the real emotion of the image, improve the authenticity and applicability of the target expression image, and improve the user experience.
[0107] Figure 4 The flowchart of the image processing method provided in the second embodiment of the present invention is based on the first embodiment. Figure 4 As shown, step 103 specifically includes:
[0108] Step 201: input the key frame into a preset facial expression recognition model to obtain the facial expression type corresponding to the key frame;
[0109] Step 202: screening the key frames according to the facial expression types corresponding to the key frames to obtain target key frames;
[0110] Step 203: Perform a human expression type recognition operation on the target key frame to obtain the human expression type corresponding to the target key frame.
[0111] In this embodiment, in order to realize the recognition of facial expression types and human body recognition of key frames, first, the image processing device can input the key frames into a preset facial expression recognition model to obtain the facial expression type corresponding to the key frames. The model can be trained in advance by using images corresponding to multiple expressions classified according to classic expressions to obtain an expression recognition model, so that the expression recognition model can recognize the expression type of the key frames. Figure 5 A schematic diagram of a classic expression provided by an embodiment of the present invention, such as Figure 5 Shown, from left to right, are happiness, sadness, anger, fear, disgust and surprise, as well as a neutral expression with relatively no obvious emotional expression.
[0112] It should be noted that, in order to implement expression recognition operations on key frames, before performing expression type recognition through a preset expression recognition model, it is also necessary to detect the face area through a preset face detection model. Figure 6 The effect diagram of the face detection model provided by the embodiment of the present invention is as follows: Figure 6 As shown, the face detection model can detect the face area in the key frame and mark the face area with a rectangular frame.
[0113] In practical applications, in order to improve the fun and applicability of expression images, when making expression images, it is generally necessary to select images with larger expression ranges and more dramatic expressions. Therefore, after the key frames are identified for facial expression types, the key frames can be screened according to the facial expression types to obtain the target key frames. Then, the human expression type recognition operation can be performed on the target key frames to obtain the human expression type corresponding to the target key frames.
[0114] Specifically, based on any of the above embodiments, step 202 specifically includes:
[0115] Acquire candidate key frames in the key frames, the confidence level corresponding to the facial expression type exceeding a preset confidence level threshold;
[0116] The key frames within a preset time interval before and after the candidate key frames in the video to be processed are used as the target key frames.
[0117] In this embodiment, in order to improve the effect of the target expression image, it is first necessary to determine the key frames with higher scores for the facial expression types. Specifically, candidate key frames whose confidences corresponding to the facial expression types exceed a preset confidence threshold can be obtained from the key frames, wherein the confidence can be a value output by the expression recognition model. Thus, the key frames within a preset time interval before and after the candidate key frames can be used as target key frames, for example, the key frames within 5 seconds before and after the candidate key frames can be used as target key frames.
[0118] Further, based on any of the above embodiments, step 203 specifically includes:
[0119] Inputting the target key frame into a preset human body recognition model to obtain posture information corresponding to the target key frame;
[0120] The human expression type corresponding to the target key frame is determined according to the posture information and a preset human posture emotion table, wherein the human posture emotion table includes joint bending angles corresponding to a plurality of preset human expression types.
[0121] In this embodiment, in order to realize the recognition of the human expression type of the target key frame, it is first necessary to determine the posture information corresponding to the target key frame. Specifically, the posture information of the target key frame can be recognized by a preset human recognition model. Figure 7 A schematic diagram of the recognition result of the human body recognition model provided by the embodiment of the present invention, such as Figure 7As shown, the human body posture model can first detect the human body in the target key frame, and then regress the human body key points of the detected human body frame to obtain the human body posture information.
[0122] After obtaining the posture information corresponding to the target key frame, the human expression type corresponding to the target key frame can be determined according to the posture information and a preset human posture emotion table. Figure 8 The human body posture emotion table provided by the embodiment of the present invention is as follows: Figure 8 As shown, the human posture emotion table includes joint bending angles corresponding to multiple preset human expression types. For example, the chest curvature corresponding to the angry expression type is 20°~40°, the head curvature is -20°~25°, the upper arm extension is -80°~-60°, the upper arm swing is 45°~90°, the elbow bending is 50°~110°, and the center of gravity tilt direction is forward. Therefore, after obtaining the posture information corresponding to the key frame through the human body recognition model, the corresponding human expression type can be queried in the human posture emotion table according to the posture information.
[0123] The image processing method provided in this embodiment can improve the accuracy of user expression recognition by, after determining the facial expression type corresponding to the key frame, screening the key frame according to the facial expression type, obtaining the target key frame, identifying the human expression type of the target key frame, and jointly determining the target expression type according to the facial expression type and the human expression type, thereby improving the accuracy of user expression recognition, and then the target expression image produced according to the target expression type can more accurately represent the real emotion of the image. In addition, by selecting the key frame corresponding to the facial expression type with a higher score to perform the human expression type recognition operation, the effect of the target expression image can be further improved.
[0124] Fig. 9 The flowchart of the image processing method provided in the third embodiment of the present invention is based on any of the above embodiments. Fig. 9 As shown, before step 103, the following steps are also included:
[0125] Step 301: Obtain a target face image pre-input by a user;
[0126] Step 302: Determine the similarity between the face image in the key frame and the target face image;
[0127] Step 303: When the similarity exceeds a preset similarity threshold, facial expression type recognition and body expression type recognition are performed on the key frame.
[0128] In this embodiment, since there may be multiple different characters in the video to be processed in the image processing instruction, correspondingly, during the key frame capture process, there may be images of multiple users in the key frame at the same time. Therefore, in order to realize the production of expression images of specific users, before performing expression recognition on the key frame, it is also necessary to perform a comparison operation on the key frame. Specifically, the target face image pre-input by the user can be obtained, and the similarity between the face image in the key frame and the target face image can be calculated. When the similarity exceeds the preset similarity threshold, the key frame is characterized as an image of a specific user. At this time, the facial expression type recognition and human body expression type recognition operations can continue. On the contrary, if the similarity does not exceed the preset similarity threshold, the current key frame can be discarded, or other face images in the key frame can be selected for calculation, or an error instruction can be sent to the terminal device.
[0129] The image processing method provided in this embodiment can realize the production of expression images for specific users by comparing key frames with preset target facial images before performing expression recognition on key frames, so that the produced target expression images can better meet the needs of users and improve user experience.
[0130] Fig.10 A flowchart of an image processing method provided in Embodiment 4 of the present invention is provided. Based on any of the above embodiments, Fig.10 As shown, step 104 specifically includes:
[0131] Step 401: acquiring preset text and / or stickers corresponding to the target expression type from a data server according to the target expression type;
[0132] Step 402: Edit the key frame according to the text and / or sticker corresponding to the target expression type to obtain a target expression image.
[0133] Fig.11 Another system architecture diagram based on the embodiment of the present invention is shown in FIG. Fig.11 As shown, the system architecture diagram based on the present invention may also include a data server 3, which is communicatively connected to the image processing device 2, so as to be able to exchange information with the image processing device 2. The data server 3 may be a cloud server or a server cluster, which stores a large amount of data.
[0134] In this embodiment, after determining the target expression type corresponding to the key frame, the image processing device can edit the key frame according to the target expression type to obtain the target image. Specifically, according to the target expression type, the preset text and / or sticker corresponding to the target expression type can be obtained from a preset data server, and the text and / or sticker can be added to the key frame to obtain the target expression image.
[0135] It should be noted that, in order to improve the effect of the target expression image, when editing the key frame according to the text and / or sticker, it is necessary to ensure that the text and / or sticker cannot cover the user's facial area.
[0136] The image processing method provided in this embodiment obtains preset text and / or stickers corresponding to the target expression type from a preset data server, edits the key frames according to the text and / or stickers corresponding to the target expression type, and obtains the target expression image, thereby improving the interest of the target expression image.
[0137] Fig.12 A structural diagram of an image processing device provided in Embodiment 5 of the present invention is shown in FIG. Fig.12 As shown, the device includes: an acquisition module 51, a determination module 52, a processing module 53, an editing module 54 and a sending module 55, wherein the acquisition module 51 is used to acquire an image processing instruction sent by a terminal device, wherein the image processing instruction includes a video to be processed; the determination module 52 is used to determine at least one key frame to be processed in the video to be processed according to the image processing instruction; the processing module 53 is used to perform facial expression recognition and human expression recognition on the key frame, and determine a target expression type according to the facial expression type and human expression type obtained by recognition; the editing module 54 is used to edit the key frame according to the target expression type to obtain a target expression image; and the sending module 55 is used to send the target expression image to the terminal device so that the user can edit the target expression image.
[0138] Furthermore, based on the fifth embodiment, the device further includes:
[0139] The preprocessing module is used to identify the facial key points in the at least one key frame through a preset key point recognition model, and perform a face alignment operation on the at least one key frame according to the facial key points.
[0140] Further, based on the fifth embodiment, the number of the facial expression type and the body expression type is at least one;
[0141] Accordingly, the processing module is used for:
[0142] The overlapping expression type between the facial expression type and the human body expression type is used as the target expression type.
[0143] The image processing device provided in this embodiment determines at least one key frame in the video to be processed according to the image processing instruction sent by the terminal device, determines the facial expression type and human expression type corresponding to each key frame, and comprehensively determines the target expression type of the user image in the key frame according to the facial expression type and human expression type, and then can edit and process the key frame according to the target expression type to obtain the target expression image, and send the target expression image to the terminal device for display. By determining the facial expression type and human expression type respectively, and jointly determining the target expression type according to the facial expression type and human expression type, the accuracy of user expression recognition can be improved, and then the target expression image produced according to the target expression type can more accurately represent the real emotion of the image, improve the authenticity and applicability of the target expression image, and improve the user experience.
[0144] Fig.13 This is a schematic diagram of the structure of an image processing device provided in Embodiment 6 of the present invention, based on Embodiment 5, as shown in FIG. Fig.13 As shown, the processing module includes: a first recognition unit 61, a screening unit 62 and a second recognition unit 63, wherein the first recognition unit 61 is used to input the key frame into a preset facial expression recognition model to obtain the facial expression type corresponding to the key frame; the screening unit 62 is used to perform a screening operation on the key frame according to the facial expression type corresponding to the key frame to obtain a target key frame; the second recognition unit 63 is used to perform a human expression type recognition operation on the target key frame to obtain the human expression type corresponding to the target key frame.
[0145] Further, based on any of the above embodiments, the second identification unit is used to:
[0146] Acquire candidate key frames in the key frames, the confidence level corresponding to the facial expression type exceeding a preset confidence level threshold;
[0147] The key frames within a preset time interval before and after the candidate key frames in the video to be processed are used as the target key frames.
[0148] Further, based on any of the above embodiments, the second identification unit is used to:
[0149] Inputting the target key frame into a preset human body recognition model to obtain posture information corresponding to the target key frame;
[0150] The human expression type corresponding to the target key frame is determined according to the posture information and a preset human posture emotion table, wherein the human posture emotion table includes joint bending angles corresponding to a plurality of preset human expression types.
[0151] The image processing device provided in this embodiment can improve the accuracy of user expression recognition by screening the key frames according to the facial expression type after determining the facial expression type corresponding to the key frames, obtaining the target key frames, identifying the human expression type of the target key frames, and jointly determining the target expression type according to the facial expression type and the human expression type, so that the target expression image produced according to the target expression type can more accurately represent the real emotion of the image. In addition, by selecting the key frames corresponding to the facial expression types with higher scores to perform the human expression type recognition operation, the effect of the target expression image can be further improved.
[0152] Fig.14 The structure diagram of the image processing device provided in the seventh embodiment of the present invention is based on any of the above embodiments. Fig.14 As shown, the device also includes: an image acquisition module 71, a similarity determination module 72 and a recognition module 73, wherein the image acquisition module 71 is used to acquire a target face image pre-input by a user; the similarity determination module 72 is used to determine the similarity between the face image in the key frame and the target face image; and the recognition module 73 is used to perform facial expression type recognition and human expression type recognition on the key frame when the similarity exceeds a preset similarity threshold.
[0153] The image processing device provided in this embodiment can produce expression images for specific users by comparing key frames with preset target facial images before performing expression recognition on key frames, so that the produced target expression images can better meet the needs of users and improve user experience.
[0154] Another embodiment of the present invention further provides an image processing device. Based on any of the above embodiments, the editing module is used to:
[0155] Acquiring preset text and / or stickers corresponding to the target expression type from a data server according to the target expression type;
[0156] The key frame is edited according to the text and / or sticker corresponding to the target expression type to obtain a target expression image.
[0157] The image processing device provided in this embodiment obtains preset text and / or stickers corresponding to the target expression type from a preset data server, edits the key frames according to the text and / or stickers corresponding to the target expression type, and obtains the target expression image, thereby improving the interest of the target expression image.
[0158] Fig.15 A structural diagram of an image processing device provided in Embodiment 8 of the present invention is shown in FIG. Fig.15 As shown, the image processing device includes: a memory 81, a processor 82;
[0159] Memory 81; Memory 81 for storing instructions executable by the processor 82;
[0160] The processor 82 is configured to execute the image processing method as described in any of the above embodiments.
[0161] The memory 81 is used to store programs. Specifically, the program may include program codes, and the program codes include computer operation instructions. The memory 81 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0162] The processor 82 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0163] Optionally, in a specific implementation, if the memory 81 and the processor 82 are implemented independently, the memory 81 and the processor 82 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.14 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0164] Optionally, in a specific implementation, if the memory 81 and the processor 82 are integrated on a chip, the memory 81 and the processor 82 can communicate with each other through an internal interface.
[0165] Yet another embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the image processing method as described in any of the above embodiments.
[0166] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0167] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An image processing method, It is characterized in that include: Obtaining an image processing instruction sent by a terminal device, wherein the image processing instruction includes a video to be processed; Determining at least one key frame to be processed in the video to be processed according to the image processing instruction; Inputting the key frame into a preset facial expression recognition model to obtain the facial expression type corresponding to the key frame; The key frames are screened according to the facial expression types corresponding to the key frames to obtain target key frames; the target key frames are input into a preset human body recognition model to obtain posture information corresponding to the target key frames; the human expression types corresponding to the target key frames are determined according to the posture information and a preset human body posture emotion table, and the target expression type is determined according to the recognized facial expression types and human body expression types; wherein the human body posture emotion table includes joint bending angles corresponding to a plurality of preset human body expression types; Performing an editing operation on the key frame according to the target expression type to obtain a target expression image; The target expression image is sent to a terminal device so that a user can edit the target expression image.
2. The method according to claim 1, It is characterized in that The filtering operation on the key frames according to the facial expression types corresponding to the key frames includes: Acquire candidate key frames in the key frames, the confidence level corresponding to the facial expression type exceeding a preset confidence level threshold; The key frames within a preset time interval before and after the candidate key frames in the video to be processed are used as the target key frames.
3. The method according to claim 1 or 2, It is characterized in that Before performing facial expression type recognition and body expression type recognition on the key frame, the method further comprises: The facial key points in the at least one key frame are identified by using a preset key point recognition model, and a face alignment operation is performed on the at least one key frame according to the facial key points.
4. The method according to claim 1 or 2, It is characterized in that Before performing facial expression type recognition and body expression type recognition on the key frame, the method further comprises: Obtain the target face image pre-entered by the user; Determining the similarity between the face image in the key frame and the target face image; When the similarity exceeds a preset similarity threshold, facial expression type recognition and human body expression type recognition are performed on the key frame.
5. The method according to claim 1 or 2, It is characterized in that The step of editing the key frame according to the target expression type to obtain a target expression image includes: Acquiring preset text and / or stickers corresponding to the target expression type from a data server according to the target expression type; The key frame is edited according to the text and / or sticker corresponding to the target expression type to obtain a target expression image.
6. An image processing device, It is characterized in that include: An acquisition module, used for acquiring an image processing instruction sent by a terminal device, wherein the image processing instruction includes a video to be processed; A determination module, configured to determine at least one key frame to be processed in the video to be processed according to the image processing instruction; A processing module, used for inputting the key frame into a preset facial expression recognition model to obtain the facial expression type corresponding to the key frame; filtering the key frame according to the facial expression type corresponding to the key frame to obtain a target key frame; inputting the target key frame into a preset human body recognition model to obtain posture information corresponding to the target key frame; determining the human expression type corresponding to the target key frame according to the posture information and a preset human body posture emotion table, and determining the target expression type according to the recognized facial expression type and human body expression type; wherein the human body posture emotion table includes joint bending angles corresponding to a plurality of preset human expression types; An editing module, used for editing the key frame according to the target expression type to obtain a target expression image; The sending module is used to send the target expression image to a terminal device so that a user can edit the target expression image.
7. An image processing device, It is characterized in that include: Memory, processor; Memory; a memory for storing instructions executable by the processor; The processor is configured to execute the image processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the image processing method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.
