Meme generation method and apparatus
Patent Information
- Application Number
- CN202210141293.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-16
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2042-02-16
AI Technical Summary
[0005]本公开实施例提供一种表情包生成方法及设备,以克服表情包中部件的动态效果的制作难度较高的问题
[0011] The emoticon generation method and device provided in this embodiment acquire a material image of a target component on a virtual avatar. In an emoticon containing the virtual avatar, the target component is in motion. Based on the material image, the global position of the target component is determined. The periodic motion amplitude of the target component in the emoticon is determined. The emoticon is generated based on the material image, the global position, and the periodic motion amplitude. Therefore, the above process achieves dynamic effects for components in emoticons without requiring users to master specific software or use complex techniques for vertex layout and movement, nor does it involve specific model files. This reduces the difficulty of emoticon creation, improves emoticon creation efficiency, and provides users with a better emoticon creation experience.
Smart Images

Figure CN116645450B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method and apparatus for generating emojis. Background Technology
[0002] Emoticons, presented in the form of static images and animated images, are vivid, interesting, and loved by users. In addition to using emoticons in chat, creating emoticons has also become a hobby for some users.
[0003] In animated emoticons, the most difficult aspects to depict are the dynamic effects of certain components, such as the flowing hair and breathing movements. Currently, Live2D (a rendering technology) can be used to generate these effects, but this requires the artist to master specific software and employ complex techniques for vertex layout and movement, placing a high technical barrier on the artist. Alternatively, a physics engine-based approach can be used to design flowing hair and breathing movements, but this requires creating different specific model files, making the process complex and challenging.
[0004] Therefore, how to reduce the difficulty of creating dynamic effects for components in emojis is an urgent problem to be solved. Summary of the Invention
[0005] This disclosure provides a method and apparatus for generating emojis, overcoming the problem of the high difficulty in creating dynamic effects for components in emojis.
[0006] In a first aspect, embodiments of this disclosure provide a method for generating emoticons, comprising: acquiring a material image of a target component on a virtual avatar, wherein the target component is in motion within an emoticon containing the virtual avatar; determining the global position of the target component based on the material image; determining the periodic motion amplitude of the target component within the emoticon; and generating the emoticon based on the material image, the global position, and the periodic motion amplitude.
[0007] Secondly, embodiments of this disclosure provide an emoji generation device, comprising: an acquisition unit for acquiring a material image of a target component on a virtual avatar, wherein the target component is in motion within the emoji of the virtual avatar; a position determination unit for determining the global position of the target component based on the material image; an amplitude determination unit for determining the periodic motion amplitude of the target component within the emoji; and a generation unit for generating the emoji based on the material image, the global position, and the periodic motion amplitude.
[0008] Thirdly, embodiments of this disclosure provide an electronic device, including: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to perform the emoji generation method as described in the first aspect or various possible designs of the first aspect.
[0009] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the emoji generation method described in the first aspect or various possible designs of the first aspect.
[0010] Fifthly, according to one or more embodiments of this disclosure, a computer program product is provided, the computer program product comprising computer execution instructions, which, when executed by a processor, implement the emoji generation method as described in the first aspect or various possible designs of the first aspect.
[0011] The emoticon generation method and device provided in this embodiment acquire a material image of a target component on a virtual avatar. In an emoticon containing the virtual avatar, the target component is in motion. Based on the material image, the global position of the target component is determined. The periodic motion amplitude of the target component in the emoticon is determined. The emoticon is generated based on the material image, the global position, and the periodic motion amplitude. Therefore, the above process achieves dynamic effects for components in emoticons without requiring users to master specific software or use complex techniques for vertex layout and movement, nor does it involve specific model files. This reduces the difficulty of emoticon creation, improves emoticon creation efficiency, and provides users with a better emoticon creation experience. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 An example diagram illustrating an application scenario provided by an embodiment of this disclosure;
[0014] Figure 2 Flowchart of the emoji generation method provided in this embodiment of the disclosure Figure 1 ;
[0015] Figure 3a Example image showing source material for multiple components;
[0016] Figure 3b Example diagrams for classifying and naming parts;
[0017] Figure 4 A flowchart illustrating the emoji generation method provided in this embodiment. Figure 2 ;
[0018] Figure 5 The structural block diagram of the model determination device provided in the embodiments of this disclosure;
[0019] Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0021] First, the terms used in the disclosed embodiments will be explained:
[0022] (1) Virtual character: A virtual character depicted in a computing device through images, such as an anime character.
[0023] (2) Components of a virtual character: The components of a virtual character; for example, the eyes, nose, mouth, etc. of an anime character are all components of the anime character.
[0024] (3) Material images of components: The layer containing the component; different components can correspond to different material images, that is, different components can correspond to different layers, so as to improve the flexibility of component combination.
[0025] (4) Global position of the component: The image position of the component within the emoticon in the emoticon pack, where the emoticon includes a virtual image composed of multiple components.
[0026] Secondly, the concept of embodiments of this disclosure is provided:
[0027] Emoticons typically require skilled artists to create and composite them frame-by-frame. The most challenging aspect is rendering the dynamic effects of the virtual avatar's components, such as flowing hair or breathing. One approach is to use Live2D-based methods, but this is technically demanding, requiring complex techniques for vertex placement and movement. Alternatively, physics engines can be used to create component animations, but this necessitates designing specific model files and a complex production process.
[0028] To address the aforementioned problems, embodiments of this disclosure propose a method and apparatus for generating emojis. In these embodiments, by acquiring source images of target components on a virtual avatar (the target component is a moving part in the emoji), the global position and periodic movement amplitude of the target component within the emoji are determined. Based on the source images, global position, and periodic movement amplitude, the emoji is generated. This achieves a dynamic effect of periodic movement of components within the emoji. Throughout the process, the user only needs to prepare source images of multiple components on the virtual avatar, reducing the difficulty of emoji creation, improving production efficiency, and enhancing the user's emoji creation experience.
[0029] refer to Figure 1 , Figure 1 This is an example diagram illustrating an application scenario provided by an embodiment of this disclosure.
[0030] like Figure 1 As shown, the application scenario is the creation of dynamic emoticons. In this scenario, the user can prepare material images of multiple parts of the virtual avatar on the terminal 101. The terminal 101 can then create dynamic emoticons based on these material images. Alternatively, the terminal 101 can send the material images of these multiple parts to the server 102, which will then create dynamic emoticons based on these material images.
[0031] For example, in a chat scenario, if a user wants to create unique and interesting animated emoticons, they can click to enter the emoticon creation page provided by the chat application on the terminal. On this emoticon creation page, they can input material images of multiple parts of some cartoon animals, anime characters, or other virtual characters that they have designed themselves, or they can input material images of multiple parts of some publicly licensed cartoon animals, anime characters, or other virtual characters, and obtain the finished emoticon through the emoticon creation program.
[0032] Below, in conjunction with Figure 1 The application scenarios shown illustrate the emoji generation method and device provided by the embodiments of this disclosure. It should be noted that the above application scenarios are merely shown to facilitate understanding of the spirit and principles of this disclosure, and the implementation methods of this disclosure are not limited in any way. On the contrary, the implementation methods of this disclosure can be applied to any applicable scenario.
[0033] It should be noted that the embodiments of this disclosure can be applied to electronic devices, which can be terminals or servers. Terminals can be personal digital assistant (PDA) devices, handheld devices with wireless communication capabilities (e.g., smartphones, tablets), computing devices (e.g., personal computers, PCs), in-vehicle devices, wearable devices (e.g., smartwatches, smart bracelets), smart home devices (e.g., smart display devices), etc. Servers can be monolithic servers or distributed servers spanning multiple computers or computer data centers. Servers can also be of various categories, such as, but not limited to, network servers, application servers, database servers, or proxy servers.
[0034] refer to Figure 2 , Figure 2 Flowchart of the emoji generation method provided in this embodiment of the disclosure Figure 1 .like Figure 2 As shown, the method for generating this emoji includes:
[0035] S201. Obtain the material image of the target part on the virtual image. The target part is in motion in the emoticon containing the virtual image.
[0036] In this embodiment, one or more target component images input by the user can be obtained. For example, the user can input the target component image through the input controls on the emoji creation page; or, multiple component images of virtual characters can be displayed on the emoji creation page, from which the user can select the target component image of the same virtual character. In addition to the target component, the user can also input image images of other components on the virtual character to improve the completeness of the virtual character.
[0037] To enhance the realism of the emoji, the virtual avatar's upper body rises and falls with its breathing, and its hair also appears to move. Therefore, both the body and hair components of the virtual avatar are in motion within the emoji. Optionally, the target components may include the virtual avatar's body and / or hair components. The number of hair components may be one or more.
[0038] S202. Determine the global position of the target component based on the material drawing of the target component.
[0039] In this embodiment, when there are multiple target components, the source images of different target components are of the same size. The position of the target component in the source image reflects its global position. Therefore, the global position of the target component can be obtained by determining its position in the source image. Thus, by using consistent source image size and determining the position of the target component in the source image to determine its global position in the emoticon, the accuracy of the global position of the target component is improved.
[0040] S203. Determine the periodic movement amplitude of the target component in the emoji.
[0041] Since animated emoticons are equivalent to videos, and multiple emoticons within an emoticon are equivalent to multiple video frames, and emoticons have a certain duration, the dynamic effect of the target component within the emoticon can be achieved through the periodic movement of the target component within that duration, making the dynamic effect of the target component in the emoticon more natural. For example, the upper body of a virtual character may periodically rise and fall with breathing, and the hair of a virtual character may periodically sway. Therefore, when the target component includes a body component and / or a hair component, the periodic movement amplitude of the body component and / or hair component in the emoticon can be determined, so as to control the periodic movement of the component based on the periodic movement amplitude of each component.
[0042] The periodic motion amplitude of the target component in the emoji includes the motion amplitude of the target component at multiple moments along the emoji's timeline, and the motion amplitude at these multiple moments changes periodically. For example, the periodic motion amplitude of the target component in chronological order is 0, 1, 2, 3, 2, 1, 0.
[0043] In this regard, considering that the global position of different target parts may be different and the pattern size of different target parts may be different, the periodic movement amplitude of different target parts in the emoji may be different, so as to generate a more accurate and reasonable movement effect of the target parts.
[0044] In this embodiment, based on the pattern of the periodic movement of the target component in the emoji, the movement amplitude of the target component at multiple moments is determined, that is, the periodic movement amplitude of the target component is obtained.
[0045] S204. Generate emoticons based on the source image, global position, and periodic motion amplitude.
[0046] In this embodiment, since the periodic motion amplitude of the target component includes the motion amplitude of the target component at multiple moments, the image position of the target component in the emoticon at each moment can be determined based on the global position of the target component and the periodic motion amplitude of the target component. The material image of the target component can be controlled to move to these image positions to achieve the dynamic effect of the target component in the emoticon.
[0047] Furthermore, for the remaining parts of the virtual avatar besides the target part, if the movement and posture of these remaining parts change with facial expressions, such as the corners of the mouth gradually curving upwards when smiling, then emoticons can be generated by combining the source images, global position, and posture of the remaining parts. For example, by determining the posture of the remaining parts at various times, and based on the global position and posture of the remaining parts at each time, the source images of the remaining parts can be combined to obtain emoticons at each time.
[0048] It should be noted that the embodiments of this disclosure only focus on generating the dynamic effects of the target component in the emoji (such as the dynamic effects of the upper body's up-and-down breathing, the dynamic effects of hair swaying left and right, the dynamic effects of a bow swaying left and right, etc.), and do not focus on the changes in the posture of the component (such as the shape changes of eyebrows and corners of the mouth under different expressions). Therefore, the embodiments of this disclosure do not specifically describe or limit how to determine the posture of the component under different expressions at different times.
[0049] In this embodiment, source images of target components on a virtual avatar are obtained. These target components are in motion within the emoji set. The global position and periodic motion amplitude of the target component within the emoji set are determined. Based on the source images, global position, and periodic motion amplitude, the emoji set is generated. This achieves a dynamic effect of periodic movement of components within the emoji set. Throughout the process, the user only needs to prepare source images of multiple components on the virtual avatar, reducing the difficulty of emoji set creation, especially reducing the difficulty of drawing dynamic effects for some components within the emoji set. This effectively improves the efficiency of emoji set creation and enhances the user's emoji set creation experience.
[0050] Below, in Figure 2 Based on the provided embodiments, several feasible extended embodiments are provided.
[0051] (1) Regarding virtual avatars
[0052] In some embodiments, virtual avatars include virtual character avatars, particularly anime character avatars. Compared to other types of emoticons, anime character emoticons are more difficult to create, typically requiring the rendering of 3D animation effects from 2D images. In this embodiment, users can obtain animated anime character emoticons by inputting source images of multiple parts of the anime character, improving the efficiency of creating animated anime character emoticons and reducing the difficulty of production.
[0053] Furthermore, when the virtual image is a virtual character, the target components include body parts and / or hair parts, with the number of hair parts being greater than or equal to 1.
[0054] (2) Regarding components
[0055] In some embodiments, necessary and unnecessary components are pre-configured.
[0056] Essential components are those required for creating a virtual avatar emoji pack, while non-essential components are optional. When users input images for multiple components, they must input images for all essential components to ensure the completeness of the virtual avatar in the emoji pack.
[0057] Therefore, by distinguishing between necessary and unnecessary components, the success rate and quality of emoji creation are improved. Of course, users can also input images of unnecessary components in addition to the images of necessary components to further refine and enrich the virtual avatar.
[0058] The target component may be a necessary component or a non-necessary component.
[0059] Optionally, when the virtual avatar is an anime character, necessary components may include eyebrow components, upper eyelash components, pupil components, mouth components, and face components. These components can accurately depict the appearance of the anime character and vividly express a variety of emotions, which helps ensure the integrity of the virtual avatar and improves its expressiveness.
[0060] Optionally, non-essential components may include at least one of the following: foreground component, hair component, head decoration component, lower eyelash component, white of the eye component, nose component, ear component, body component, and background component. These non-essential components thus enhance the detail of the virtual avatar.
[0061] Among them, foreground components refer to components located in front of the virtual image according to spatial relationships.
[0062] In some embodiments, multiple component categories are pre-defined. These categories can be displayed before acquiring the source image of the target component on the virtual avatar. This facilitates the user's input of component source images according to component categories. Component categories can be divided into multiple levels; when there are two levels, the component categories can be divided into a parent category and its subcategories.
[0063] Optionally, the parent class may include at least one of the following: foreground component, hair component, head component, body component, and background component. Subclasses under the hair component may include at least one of the following: head decoration component, front hair component, front ear hair component, back ear hair component, and back hair component; subclasses under the head component may include head decoration component, eyebrow component, eye component, nose component, mouth component, face component, and ear component.
[0064] Furthermore, subclasses can be further divided into different categories. Specifically, the subclasses under the eye component can include at least one of the following: upper eyelash component, lower eyelash component, pupil component, and sclera component.
[0065] As an example, such as Figure 3a As shown, Figure 3a Example images showing stock photos of multiple components. Figure 3a The document provides source images for each of the following parts of an anime character: eyebrows, upper eyelashes, pupils, mouth, face, and body. As you can see, these source images are all the same size. By combining and piecing together these source images, you can obtain the corresponding anime character.
[0066] (3) Regarding source images
[0067] In some embodiments, a component may correspond to one or more source images. For example, a virtual avatar may have multiple head decoration components, so a head decoration component may correspond to multiple source images.
[0068] In some embodiments, each source image corresponds to a unique image identifier, meaning different source images correspond to different image identifiers. Therefore, during the process of generating emoticons based on source images of components, the image identifiers can be used to distinguish between source images and the components they correspond to.
[0069] Optionally, the image identifier includes the image name.
[0070] For example, the image names of the multiple source images corresponding to the foreground component are Foreground 1, Foreground 2, ...; the image names of the multiple source images corresponding to the hair decoration component are Hair Decoration Component 1, Hair Decoration Component 2, ..., and so on.
[0071] As an example, such as Figure 3b As shown, Figure 3b Example images for classifying and naming components. The left area shows multiple components, and the right area shows the naming conventions for the source images under multiple component types. "Layer" refers to the source image, and "png" is the image format of the source image.
[0072] from Figure 3bIt can be seen that: 1) "Foreground" can correspond to multiple layers, and the image name can be Foreground_1, Foreground_2, etc.; 2) "Hair decoration" can correspond to multiple layers, and the image name can be Hair Decoration_1, Hair Decoration_2, etc.; 3) "Front hair" can correspond to multiple layers, and the image name can be Front Hair_1, Front Hair_2, etc.; 4) "Ear hair" can correspond to multiple layers, and the image name can be Ear Hair_1, Ear Hair_2, etc.; 5) "Back hair" can correspond to multiple layers, and the image name can be Back Hair_1, Back Hair_2, etc.; 6) "Head decoration" can correspond to multiple layers, and the image name can be Head Decoration_1, Head Decoration_2, etc.; 7) "Eyebrows" can correspond to multiple layers, and multiple layers can be merged into one PNG, that is, multiple material images can be merged into one material image, and the image name can be Eyebrow_1; ... and so on. In this way, different names can be provided for material images under different categories of parts, and different names can be provided for different material images under the same category of parts. These will not be described in detail here.
[0073] (4) Determining the global location
[0074] In some embodiments, a possible implementation of S202 includes: determining the bounding matrix of the target component in the source drawing of the target component; and determining the global position of the target component based on the bounding matrix of the target component. Thus, by solving for the bounding matrix of the target component in the source drawing of the target component, the accuracy of the global position of the target component is improved.
[0075] In this implementation, the bounding matrix of the target component can be identified in the source image of the target component, and the position of the bounding matrix in the source image can be obtained. The position of the bounding matrix in the source image includes the pixel coordinates of the four vertices of the bounding matrix in the source image. Furthermore, since all component source images are of the same size, the image position of the target component in the source image reflects the global position of the target component. Therefore, the global position of the target component can be determined as the position of its bounding matrix.
[0076] Optionally, the image channels of the target component's source image include a position channel.
[0077] In the source image, the channel value of a pixel in the position channel reflects whether the pixel is located within the pattern area of the target component. For example, if the channel value of a pixel in the position channel is 1, then the pixel is determined to be located within the pattern area; if the channel value of a pixel in the position channel is 0, then the pixel is determined not to be located within the pattern area. Therefore, by using the values of the position channels of multiple pixels in the source image, the outer circumscribing matrix of the target component in the source image can be determined, improving the accuracy of the outer circumscribing matrix.
[0078] Furthermore, the source image of the target component is an RGBA four-channel image, meaning the image channels of the source image of the target component include the R channel, G channel, B channel, and A channel. Among them, the R channel, G channel, and B channel are the red, green, and blue color channels of the image, respectively, and the A channel is the position channel of the image.
[0079] Therefore, the channel value of each pixel in the A channel can be obtained from the source image of the target component, and the outer matrix of the target component can be determined based on the channel value of each pixel in the A channel. For example, in the source image of the target component, all pixels with a channel value of 1 in the A channel can be identified, and the outer matrix containing these pixels can be determined as the outer matrix of the target component.
[0080] Furthermore, the bounding matrix of the target component can also be the minimum bounding rectangle (MBR) of the target component to improve the accuracy of the global position of the target component.
[0081] (5) Determination of the amplitude of periodic motion
[0082] refer to Figure 4 , Figure 4 A flowchart illustrating the emoji generation method provided in this embodiment. Figure 2 .like Figure 4 As shown, the methods for generating emojis include:
[0083] S401. Obtain the material image of the target part on the virtual image. The target part is in motion in the emoticon containing the virtual image.
[0084] S402. Determine the global position of the target component based on the source image.
[0085] The implementation principles and technical effects of S401 to S402 can be referred to in the aforementioned embodiments, and will not be repeated here.
[0086] S403. Determine the upper limit of the movement range of the target component.
[0087] In this implementation, the upper limit of the target component's motion amplitude can be determined randomly; alternatively, professionals can preset the upper limit of motion amplitude for different components based on experience, and obtain the upper limit of the target component's motion amplitude from these preset limits; or, the upper limit of the target component's motion amplitude can be determined based on the characteristics of the target component (such as the component's size and its global position). In emojis, different target components can have different upper limits of motion amplitude to improve the accuracy and reasonableness of the upper limit. For example, some hair components may have a larger swing amplitude, while others may only swing slightly.
[0088] In some embodiments, one possible implementation of S403 includes: determining the upper limit of the motion amplitude of the target component based on the global position of the target component.
[0089] The global position of the target component reflects the size of the image area it occupies, i.e., its component size. Therefore, determining the upper limit of the target component's motion range based on its global position is equivalent to determining the upper limit of its motion range based on its component size. The upper limit of motion range is directly proportional to the component size; that is, the larger the target component's size, the larger the upper limit of its motion range, thus improving the rationality of the target component's motion.
[0090] In this implementation, the size of the target component can be determined based on its global position, and then the upper limit of its motion amplitude can be determined based on that size. In determining the size of the target component: when the global position of the target component is determined based on its outer matrix, the size can be determined based on the pixel coordinates of the four vertices of the outer matrix. In determining the upper limit of the motion amplitude: the upper limit can be determined based on a preset correspondence between the component size and the upper limit of the motion amplitude; or, it can be determined based on a calculation formula for the component size and the upper limit of the motion amplitude. In this calculation formula, the component size and the upper limit of the motion amplitude are directly proportional.
[0091] Optionally, the upper limit of the motion range of the target component is determined based on the global position of the target component, including: determining the component size of the target component based on the global position of the target component; and determining the upper limit of the motion range of the target component based on the component size of the target component and the image size of the emoticon.
[0092] In this optional method, the process of determining the component size based on the global position of the target component will not be elaborated further; please refer to the aforementioned related content. The image size of the emoticon is the image size of the emoticon image within the emoticon pack, and the image size of the emoticon image can be the same as the image size of the target component's source image; these image sizes are all pre-set. Considering that determining the upper limit of the target component's motion range solely based on its component size may result in the upper limit being too large or too small, combining the target component's component size and the emoticon image size to determine the upper limit of the target component's motion range helps avoid this situation and improves the rationality of the upper limit of the target component's motion range.
[0093] In this example, the upper limit of the target component's motion amplitude is directly proportional to the component's size and inversely proportional to the emoji's image size. One example involves pre-setting a correspondence between the target component's size and the emoji's image size and the target component's upper limit of motion amplitude. In this correspondence, the upper limit of motion amplitude is directly proportional to the component size and inversely proportional to the image size; therefore, the upper limit of the target component's motion amplitude can be determined based on this correspondence. In another example, the upper limit of the target component's motion amplitude can be determined based on a formula for calculating the target component's size, the emoji's image size, and the upper limit of motion amplitude. In this formula, the target component's size is directly proportional to the upper limit of motion amplitude, and the emoji's image size is inversely proportional to the upper limit of motion amplitude. Furthermore, in this formula, the ratio of the target component's size to the emoji's image size is directly proportional to the target component's upper limit of motion amplitude.
[0094] Furthermore, considering that the upper limit of motion amplitude for target components in a left-right swaying state and a vertical up-and-down undulating state is affected by different factors, the upper limit of motion amplitude for left-right swaying target components is mainly affected by the length and width of the target component. For example, the longer and wider the hair component, the greater its upper limit of motion amplitude. The upper limit of motion amplitude for vertical up-and-down undulating target components is mainly affected by the height of the target component in the emoji image. For example, pixels at different heights of the upper body component move different distances up and down with breathing. Therefore, different methods are needed to determine the upper limit of motion amplitude for target components in different motion states to improve the realism of the movement of target components in emojis. Specifically, the methods for determining the upper limit of motion amplitude are as follows:
[0095] Method 1: When the target component's motion includes left-right swaying, the component's dimensions include its height and width. The upper limit of the target component's motion amplitude includes the maximum amplitude of its left-right sway. In this case, the ratio of the target component's height to the image height in the image dimensions can be determined. Based on this ratio, the target component's width, and the first scaling parameter, the maximum amplitude of the target component's left-right sway can be determined. Therefore, combining parameters such as the target component's height and width improves the rationality of the upper limit of the motion amplitude.
[0096] The ratio of the height of the target component to the image height in the image size reflects the relative height of the target component in the expression image, and also reflects the relative length of the target component. The first scaling parameter can be set based on experience, which helps to improve the flexibility and rationality of the upper limit of the motion amplitude.
[0097] In Method 1, the maximum amplitude of the left and right swing of the target component can be determined by the product of the ratio of the component height to the image height in the image size, the component width of the target component, and the first scaling parameter. This makes the upper limit of the motion amplitude of the target component larger when the component height is higher and the component width is larger, thus improving the rationality of the upper limit of the motion amplitude.
[0098] Optionally, the formula for calculating the maximum amplitude of the target component's left and right swing can be expressed as:
[0099]
[0100] Where amp1 represents the maximum amplitude of the left and right swing of the target part, ɑ represents the first scaling ratio, the coordinates of the upper left and upper right corners of the target part are represented as (x1, y1, x2, y2), (x2-x1) represents the width of the target part, (y2-y1) represents the height of the target part, and h represents the image height in the image size.
[0101] Optionally, in Method 1, the target component is the hair component. Therefore, different maximum left-right swing amplitudes can be determined for hair components of different heights (i.e., different lengths) and widths, achieving different flowing effects for different hair components. As can be seen from the above formula, the maximum left-right swing amplitude is positively correlated with the width and height of the hair component; the longer and wider the hair component, the greater its left-right swing amplitude, which helps to improve the realism of the hair's left-right flowing motion.
[0102] Method 2: When the target component's motion includes vertical movement, the component's size includes its height, and the upper limit of its motion amplitude includes the maximum vertical amplitude of multiple columns of vertices within the component. In this case, the ratio of the target component's height to the image height in the image size can be determined. Using a non-linear function, the floating weights corresponding to each column of vertices within the target component are determined. Then, based on this ratio, the target component's height, the floating weights corresponding to each column of vertices, and the second scaling parameter, the maximum vertical amplitude of the multiple columns of vertices is determined. Therefore, by refining the vertical movement of the target component into the vertical movement of multiple columns of vertices within the target component, and combining the target component's height, floating weights, and the second scaling parameter, the accuracy of the maximum vertical amplitude of the multiple columns of vertices is improved, thereby enhancing the realism of the vertical movement of the target component in the emoji.
[0103] The ratio of the height of the target component to the height of the image in the image size reflects the relative height of the target component in the expression image; the second scaling parameter can be set empirically, which helps to improve the flexibility and rationality of the upper limit of the motion amplitude; the multiple columns of vertices in the target component are the multiple columns of vertices on the source image of the target component, which are distributed in an m*n size vertex grid on the source image, so as to control the motion of the source image by controlling each vertex in the vertex network.
[0104] In Method Two, considering that the amplitude of vertical movement of a person's upper body varies at different positions during breathing in real-world scenarios, and that the amplitude of vertical movement at different vertices may differ, a nonlinear function is used to determine the floating weights corresponding to multiple columns of vertices. Then, the maximum amplitude of vertical movement at the multiple columns of vertices on the target component is determined by multiplying the ratio of the target component's height to the image height in the image size, the target component's height, the values corresponding to the multiple columns of vertices, and the second scaling parameter. This fully considers the different amplitudes of vertical movement at different vertices and takes into account the height of the target component, thus improving the realism of the target component's movement, and consequently, the realism of the emoji.
[0105] Optionally, considering that the up-and-down movement of the target component in the emoji is similar to the upward curvature of a sine function, a sine function can be used as the nonlinear function to further improve the realism of the up-and-down movement of the target component and enhance the realism of the emoji.
[0106] Optionally, the formula for calculating the maximum amplitude of vertical undulation of multiple columns of vertices on the target component is expressed as follows:
[0107]
[0108] Where amp2 represents the maximum vertical undulation of the j-th column vertex on the target component, and β represents the second scaling parameter. This represents the floating weight corresponding to the vertex in column j.
[0109] Optionally, the multiple columns of vertices in the target component are vertices located in the central region of the target component. Therefore, in the emoji, only a portion of the target component is controlled to float up and down; for example, only the chest area of a body component is controlled to rise and fall due to breathing, increasing the realism of the emoji. The multiple columns of vertices in the target component can be represented as follows: The values of m1, m2, n1, and n2 are used to determine which vertices are controlled to rise and fall, where i is the vertex row index and j is the vertex column index.
[0110] Optionally, in Method 2, the target component is the body component. Therefore, by determining the maximum amplitude of the vertical rise and fall of multiple rows of vertices within the body component, the amplitude of the body component's vertical rise and fall due to breathing can be controlled, thus improving the realism of the emoji.
[0111] S404. Determine the periodic motion amplitude of the target component by using a periodic function and the upper limit of the motion amplitude of the target component.
[0112] The periodic function in S404 is used to determine the motion amplitude of the target component at multiple moments based on the up-down motion amplitude of the target component, that is, the periodic motion amplitude of the target component. This is different from the nonlinear function used to determine the maximum amplitude of the up-down fluctuation of multiple vertices.
[0113] In this embodiment, after determining the upper limit of the target component's motion amplitude, it is necessary to determine the target component's motion amplitude at multiple moments in the emoji based on this upper limit. Considering that the movement of hair or the up-and-down motion of the body due to breathing can be viewed as periodic motion, a periodic function is used to determine the target component's motion amplitude at multiple moments in the emoji based on the target component's upper limit. For example, the periodic function can be multiplied by the target component's upper limit to obtain the target component's motion amplitude at multiple moments in the emoji.
[0114] In some embodiments, different target components may adopt the same periodic function, so that the motion law of different target components at the same time is consistent, thereby improving the motion harmony of different target components.
[0115] In some embodiments, a possible implementation of S404 includes: determining the motion weights of the target component at multiple times using a periodic function; and determining the periodic motion amplitude of the target component based on the motion weights of the target component at multiple times and the upper limit of the motion amplitude of the target component.
[0116] In this implementation, since the value of the periodic function changes periodically, the values of the periodic function at multiple moments can be determined as the motion weights of the target component at those multiple moments. Then, the motion weights of the target component at each of those multiple moments are multiplied by the upper limit of the target component's motion amplitude to determine the motion amplitude of the target component at those multiple moments, i.e., the periodic motion amplitude of the target component. Because the motion weights of the target component at multiple moments are periodic, and therefore the motion amplitude of the target component at multiple moments is also periodic, the realism of the emoji is effectively improved.
[0117] Optionally, in determining the motion weights of the target component at multiple moments using a periodic function, the motion weights of the target component at multiple moments are determined based on the number of image frames and the frame rate of the emoji. Thus, by combining the number of image frames and the frame rate of the emoji into the periodic function, the motion weights of the target component in the emoji at multiple moments can be determined more accurately.
[0118] In this optional method, the input data can be determined based on the number of image frames and the frame rate of the emoji, and the input data can be input into a periodic function to obtain the motion weights of the target component at multiple times.
[0119] Furthermore, for each moment, the frame order of the corresponding emoticon in the emoticon pack can be determined. The ratio of the frame order of the corresponding emoticon in the emoticon pack to the frame rate of the emoticon pack is determined as the input data for that moment. The input data for that moment is then input into a periodic function to obtain the motion weight of the target component at that moment.
[0120] Optionally, a periodic function can be determined based on the duration of the emoji to improve the rationality and accuracy of using the periodic function for emoji generation.
[0121] In this optional method, the duration of the emoji can be determined as the period of a periodic function, or twice the duration of the emoji can be determined as the period of a periodic function. The specific determination depends on the range of variation of the function value of the periodic function.
[0122] Optionally, the periodic function can be a sine function. Since the variation pattern of the sine function value is similar to the motion pattern of the target part on the virtual avatar, using a sine function to determine the motion weight of the target part at multiple times can improve the accuracy and smoothness of the motion amplitude of the target part at multiple times, thereby improving the accuracy, smoothness, and realism of the virtual avatar's expressions in the emoji pack.
[0123] Furthermore, when the periodic function is a sine function, the periodic function can be expressed as:
[0124] f(x) = sin(wx)
[0125] Where T = 2π / |w|, T is the period, x is the input of the sine function, and w is the parameter.
[0126] Based on the above formula, the motion weights of the target component at multiple moments can be determined by combining the number of image frames and the frame rate of the emoji. In this case, the periodic function can be expressed as:
[0127]
[0128] Where weight represents motion weight, fps is the frame rate of the emoji, and i represents the i-th frame. Assuming the i-th frame corresponds to time t, the motion weight of the target part at time t can be obtained using the above formula.
[0129] Assuming the duration of an emoji is 1 second, the duration of the emoji corresponds to half a period of a sine function, and the period of the sine function is 2 seconds. In this case, the periodic function can be expressed as:
[0130]
[0131] Furthermore, the formula for calculating the periodic motion amplitude of the target component can be expressed as follows:
[0132]
[0133] in, The formula represents the amplitude of periodic motion, where k = 1 or 2. When k = 1, the formula calculates the left-right sway amplitude of the target component at time t. When k = 2, the formula calculates the up-down fluctuation amplitude of the target component at time t.
[0134] S405. Generate an emoji based on the source image of the target component, the global position of the target component, and the periodic motion amplitude of the target component.
[0135] The implementation principle and technical effects of S405 can be referred to in the aforementioned embodiments, and will not be repeated here.
[0136] In this embodiment of the disclosure, by determining the upper limit of the motion amplitude of the target component in motion on the virtual image, and based on the upper limit of the motion amplitude, the periodic motion amplitude of the target component is determined by a periodic function, so that the target component moves in the emoticon according to a periodic pattern. For example, the hair component moves periodically left and right, and the body component moves periodically up and down breathing. This not only reduces the difficulty of making emoticons, but also improves the realism of the emoticons.
[0137] In some embodiments, during the process of generating an emoticon based on the source image of the target component, the global position of the target component, and the periodic motion amplitude of the target component, one possible implementation includes: determining the position and shape of the source image on each frame of the emoticon based on the global position of the target component and the periodic motion amplitude of the target component using a driving algorithm, thereby obtaining the emoticon.
[0138] In this embodiment, the driving algorithm is used to drive the source image. Specifically, it drives the source image of the component to the corresponding position and shape based on the component's global position and its motion posture. For a target component in motion, the driving algorithm also refers to the target component's global position and the target component's motion amplitude at multiple moments to drive the target component's source image to the corresponding position. The driven source image then forms the emoticon in the emoji set.
[0139] Since the processing of the target component and the remaining components in the driving process is only related to the target component having a corresponding motion amplitude, and this motion amplitude only needs to be added during position driving, the other processes are the same. Therefore, the driving process of the driving algorithm on the components will be described uniformly in the following sections.
[0140] Optionally, in the driving algorithm, for each component, the component image can be obtained from the component's source image, the component image can be divided into multiple rectangular image regions, the vertices of each image region can be obtained, and the depth value of each vertex can be determined, so that the component image visually presents a similar 3D effect, making the virtual image in the emoticon more three-dimensional and improving the emoticon generation effect.
[0141] In this method, different depth values can be preset for different components, or the front and back positions of the source image can be determined based on the image identifier (such as the image name) of the source image, and then the corresponding depth value can be determined.
[0142] Optionally, in the driving algorithm, facial feature information can be determined based on the global position of multiple components, rotation matrix of each source image can be determined based on the action posture of multiple components at multiple times, and translation and rotation of the source image can be performed based on the facial feature information and the rotation matrix of the source image.
[0143] This involves determining facial feature information related to multiple key points (such as eyebrows, eyes, pupils, and mouth) on the component's source image based on their global positions. This improves the stability of facial feature information and consequently enhances the stability of facial expressions. Examples of facial feature information include left / right eyebrow movement height, left / right eye opening height, mouth opening size, and mouth width.
[0144] In this optional approach, after obtaining the fixed facial feature information related to multiple key points, the maximum deformation value of the multiple key points can be determined based on the fixed facial feature information. The maximum deformation value of the facial key points may include the upper limit and lower limit values of the key point movement. For example, the upper limit value for the eyes is the feature value when the eyes are open, and the lower limit value is the feature value when the eyes are closed.
[0145] In this optional method, for each key point, the feature value corresponding to changes in the key point's facial feature information (such as blinking) can be determined. Based on the feature value corresponding to the key point's change and the maximum deformation value corresponding to the key point, the deformation value of the key point, i.e., the displacement value, is determined. The displacement value of the key point drives the position change of the key point and performs rendering, thus realizing the deformation of the key point. The source image is then rotated according to its rotation matrix. In this way, the source image of the component is driven, enabling the automatic generation of emojis.
[0146] Optionally, during the driving process, considering that gaps or voids may appear when components deform, morphology can be used for image filling to improve the emoji generation effect. For example, morphology can be used to automatically generate images of the upper and lower eyelids and the mouth.
[0147] Through the above embodiments, both emoji packs and individual frame emoji images of virtual avatars within emoji packs can be obtained. In particular, freeze-frame emoji images of virtual avatars—that is, emoji images where the virtual avatar's expression is the target expression—can be obtained. Since the virtual avatar's expression in an emoji pack changes from an initial expression to the target expression and then back to the initial expression, the freeze-frame emoji image represents the emoji image with the largest range of expression in the emoji pack. Therefore, the production efficiency of both dynamic emoji packs and static freeze-frame emoji images is improved, the production difficulty is reduced, and the user's emoji pack creation experience is enhanced.
[0148] Corresponding to the emoji generation method in the above embodiments, Figure 5 This is a structural block diagram of an emoji generation device provided in an embodiment of this disclosure. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 5 The emoji generation device includes: an acquisition unit 501, a position determination unit 502, an amplitude determination unit 503, and a generation unit 504.
[0149] The acquisition unit 501 is used to acquire material images of target parts on the virtual avatar, where the target parts are in motion in the virtual avatar's emoticons;
[0150] The position determination unit 502 is used to determine the global position of the target component based on the source image;
[0151] Amplitude determination unit 503 is used to determine the periodic motion amplitude of the target component in the emoji;
[0152] The generation unit 504 is used to generate emoticons based on the source image, global position, and periodic motion amplitude.
[0153] In some embodiments, in determining the periodic motion amplitude of the target component in the emoji, the amplitude determination unit 503 is specifically used to: determine the upper limit of the motion amplitude of the target component; and determine the periodic motion amplitude through a periodic function and the upper limit of the motion amplitude.
[0154] In some embodiments, in determining the periodic motion amplitude of the target component in the emoji, the amplitude determination unit 503 is specifically used to: determine the motion weight of the target component at multiple times using a periodic function; and determine the periodic motion amplitude based on the motion weight and upper limit of the motion amplitude of the target component at multiple times.
[0155] In some embodiments, during the process of determining the motion weights of the target component at multiple moments using a periodic function, the amplitude determination unit 503 is specifically used to: determine the motion weights of the target component at multiple moments using a periodic function based on the number of image frames and the frame rate of the emoji.
[0156] In some embodiments, the emoji generation device further includes a function determination unit (not shown in the figure), configured to determine a periodic function based on the duration of the emoji; wherein the periodic function is a sine function.
[0157] In some embodiments, in the process of determining the upper limit of the motion amplitude of the target component, the amplitude determination unit 503 is specifically used to: determine the upper limit of the motion amplitude based on the global position, wherein the global position reflects the component size of the target component, and the upper limit of the motion amplitude is proportional to the component size.
[0158] In some embodiments, during the process of determining the upper limit of the motion amplitude based on the global position, the amplitude determination unit 503 is specifically used to: determine the component size based on the global position; and determine the upper limit of the motion amplitude based on the component size and the image size of the emoticon.
[0159] In some embodiments, the motion state includes a left-right swinging state, the component size includes the component height and component width of the target component, and the upper limit of the motion amplitude includes the maximum amplitude of the left-right swing of the target component. In the process of determining the upper limit of the motion amplitude based on the component size and the image size of the emoticon, the amplitude determination unit 503 is specifically used to: determine the ratio of the component height to the image height in the image size; and determine the maximum amplitude of the left-right swing of the target component based on the ratio, the component width, and the first scaling parameter.
[0160] In some embodiments, the motion state includes an up-and-down undulating state, the component size includes the component height of the target component, and the upper limit of the motion amplitude includes the maximum amplitude of the up-and-down undulation of multiple columns of vertices in the target component. In the process of determining the upper limit of the motion amplitude based on the component size and the image size of the emoticon, the amplitude determination unit 503 is specifically used to: determine the ratio of the component height to the image height in the image size; determine the floating weights corresponding to the multiple columns of vertices respectively through a nonlinear function; and determine the maximum amplitude of the up-and-down undulation of the multiple columns of vertices based on the ratio, the component height, the floating weights corresponding to the multiple columns of vertices respectively, and the second scaling parameter.
[0161] In some embodiments, during the process of generating an emoticon based on the source image, global position, and periodic motion amplitude, the generation unit 504 is specifically used to: determine the position and shape of the source image on each frame of the emoticon based on the global position and periodic motion amplitude using a driving algorithm, thereby obtaining the emoticon.
[0162] In some embodiments, during the process of determining the global position of a target component based on a source drawing, the position determination unit 502 is specifically used to: determine the circumscribed matrix of the target component in the source drawing; and determine the global position based on the circumscribed matrix.
[0163] The emoji generation device provided in this embodiment can be used to execute the technical solution of the above-described emoji generation method embodiment. Its implementation principle and technical effect are similar, and will not be described again here.
[0164] refer to Figure 6 The diagram illustrates a structural schematic of an electronic device 600 suitable for implementing embodiments of the present disclosure. The electronic device 600 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0165] like Figure 6As shown, electronic device 600 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. The processing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0166] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0167] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0168] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0169] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0170] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0171] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0172] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0173] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0174] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0175] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0176] In a first aspect, according to one or more embodiments of this disclosure, an emoticon generation method is provided, comprising: acquiring a material image of a target component on a virtual avatar, wherein the target component is in motion in an emoticon containing the virtual avatar; determining the global position of the target component based on the material image; determining the periodic motion amplitude of the target component in the emoticon; and generating the emoticon based on the material image, the global position, and the periodic motion amplitude.
[0177] According to one or more embodiments of this disclosure, determining the periodic motion amplitude of the target component in the emoji includes: determining an upper limit of the motion amplitude of the target component; and determining the periodic motion amplitude using a periodic function and the upper limit of the motion amplitude.
[0178] According to one or more embodiments of this disclosure, determining the periodic motion amplitude of the target component in the emoji includes: determining the motion weight of the target component at multiple times using a periodic function; and determining the periodic motion amplitude based on the motion weight of the target component at multiple times and the upper limit of the motion amplitude.
[0179] According to one or more embodiments of this disclosure, determining the motion weights of the target component at multiple times using a periodic function includes: determining the motion weights of the target component at multiple times using the periodic function based on the number of image frames and the frame rate of the emoji.
[0180] According to one or more embodiments of this disclosure, before determining the motion weight of the target component at multiple times using a periodic function, the method further includes: determining the periodic function based on the duration of the emoji; wherein the periodic function is a sine function.
[0181] According to one or more embodiments of this disclosure, determining the upper limit of the motion range of the target component includes: determining the upper limit of the motion range based on the global position, wherein the global position reflects the component size of the target component, and the upper limit of the motion range is proportional to the component size.
[0182] According to one or more embodiments of this disclosure, determining the upper limit of the motion amplitude based on the global position includes: determining the component size based on the global position; and determining the upper limit of the motion amplitude based on the component size and the image size of the emoticon.
[0183] According to one or more embodiments of this disclosure, the motion state includes a left-right swinging state, the component size includes the component height and component width of the target component, the upper limit of the motion amplitude includes the maximum amplitude of the left-right swing of the target component, and determining the upper limit of the motion amplitude based on the component size and the image size of the emoticon includes: determining the ratio of the component height to the image height in the image size; and determining the maximum amplitude of the left-right swing of the target component based on the ratio, the component width, and a first scaling parameter.
[0184] According to one or more embodiments of this disclosure, the motion state includes an up-and-down undulating state, the component size includes the component height of the target component, and the upper limit of the motion amplitude includes the maximum amplitude of the up-and-down undulation of multiple columns of vertices in the target component. Determining the upper limit of the motion amplitude based on the component size and the image size of the emoticon includes: determining the ratio of the component height to the image height in the image size; determining the floating weights corresponding to the multiple columns of vertices respectively through a nonlinear function; and determining the maximum amplitude of the up-and-down undulation of the multiple columns of vertices based on the ratio, the component height, the floating weights corresponding to the multiple columns of vertices respectively, and a second scaling parameter.
[0185] According to one or more embodiments of this disclosure, generating the emoticon based on the source image, the global position, and the periodic motion amplitude includes: determining the position and shape of the source image on each frame of the emoticon using a driving algorithm based on the global position and the periodic motion amplitude, thereby obtaining the emoticon.
[0186] According to one or more embodiments of this disclosure, determining the global position of the target component based on the source drawing includes: determining the circumscribed matrix of the target component in the source drawing; and determining the global position based on the circumscribed matrix.
[0187] Secondly, according to one or more embodiments of this disclosure, an emoticon generation device is provided, comprising: an acquisition unit, configured to acquire a material image of a target component on a virtual avatar, wherein the target component is in motion within the emoticon of the virtual avatar; a position determination unit, configured to determine the global position of the target component based on the material image; an amplitude determination unit, configured to determine the periodic motion amplitude of the target component within the emoticon; and a generation unit, configured to generate the emoticon based on the material image, the global position, and the periodic motion amplitude.
[0188] According to one or more embodiments of this disclosure, determining the periodic motion amplitude of the target component in the emoji includes: determining an upper limit of the motion amplitude of the target component; and determining the periodic motion amplitude using a periodic function and the upper limit of the motion amplitude.
[0189] According to one or more embodiments of this disclosure, determining the periodic motion amplitude of the target component in the emoji includes: determining the motion weight of the target component at multiple times using a periodic function; and determining the periodic motion amplitude based on the motion weight of the target component at multiple times and the upper limit of the motion amplitude.
[0190] According to one or more embodiments of this disclosure, determining the motion weights of the target component at multiple times using a periodic function includes: determining the motion weights of the target component at multiple times using the periodic function based on the number of image frames and the frame rate of the emoji.
[0191] According to one or more embodiments of this disclosure, before determining the motion weight of the target component at multiple times using a periodic function, the method further includes: determining the periodic function based on the duration of the emoji; wherein the periodic function is a sine function.
[0192] According to one or more embodiments of this disclosure, determining the upper limit of the motion range of the target component includes: determining the upper limit of the motion range based on the global position, wherein the global position reflects the component size of the target component, and the upper limit of the motion range is proportional to the component size.
[0193] According to one or more embodiments of this disclosure, determining the upper limit of the motion amplitude based on the global position includes: determining the component size based on the global position; and determining the upper limit of the motion amplitude based on the component size and the image size of the emoticon.
[0194] According to one or more embodiments of this disclosure, the motion state includes a left-right swinging state, the component size includes the component height and component width of the target component, the upper limit of the motion amplitude includes the maximum amplitude of the left-right swing of the target component, and determining the upper limit of the motion amplitude based on the component size and the image size of the emoticon includes: determining the ratio of the component height to the image height in the image size; and determining the maximum amplitude of the left-right swing of the target component based on the ratio, the component width, and a first scaling parameter.
[0195] According to one or more embodiments of this disclosure, the motion state includes an up-and-down undulating state, the component size includes the component height of the target component, and the upper limit of the motion amplitude includes the maximum amplitude of the up-and-down undulation of multiple columns of vertices in the target component. Determining the upper limit of the motion amplitude based on the component size and the image size of the emoticon includes: determining the ratio of the component height to the image height in the image size; determining the floating weights corresponding to the multiple columns of vertices respectively through a nonlinear function; and determining the maximum amplitude of the up-and-down undulation of the multiple columns of vertices based on the ratio, the component height, the floating weights corresponding to the multiple columns of vertices respectively, and a second scaling parameter.
[0196] According to one or more embodiments of this disclosure, generating the emoticon based on the source image, the global position, and the periodic motion amplitude includes: determining the position and shape of the source image on each frame of the emoticon using a driving algorithm based on the global position and the periodic motion amplitude, thereby obtaining the emoticon.
[0197] According to one or more embodiments of this disclosure, determining the global position of the target component based on the source drawing includes: determining the circumscribed matrix of the target component in the source drawing; and determining the global position based on the circumscribed matrix.
[0198] Thirdly, according to one or more embodiments of this disclosure, an electronic device is provided, comprising: at least one processor and a memory; the memory storing computer-executable instructions; the at least one processor executing the computer-executable instructions stored in the memory, causing the at least one processor to perform the emoji generation method as described in the first aspect or various possible designs of the first aspect.
[0199] Fourthly, according to one or more embodiments of this disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, and when a processor executes the computer-executable instructions, the emoji generation method described in the first aspect and various possible designs of the first aspect is implemented.
[0200] Fifthly, according to one or more embodiments of the present disclosure, a computer program product is provided, the computer program product comprising computer execution instructions, which, when executed by a processor, implement the emoji generation method as described in the first aspect and various possible designs of the first aspect.
[0201] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0202] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0203] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for generating emojis, comprising: Obtain material images of target components on a virtual avatar, where the target components are in motion within an emoticon containing the virtual avatar; Based on the source image, determine the global position of the target component; Determine the upper limit of the movement range of the target component; The periodic motion amplitude of the target component in the emoji is determined by using a periodic function and the upper limit of the motion amplitude. The emoticon is generated based on the source image, the global position, and the periodic motion amplitude.
2. The emoji generation method according to claim 1, wherein determining the periodic motion amplitude using a periodic function and the upper limit of the motion amplitude includes: The motion weights of the target component at multiple moments are determined using a periodic function; The periodic motion amplitude is determined based on the motion weights of the target component at multiple times and the upper limit of the motion amplitude.
3. The emoji generation method according to claim 2, wherein determining the motion weights of the target component at multiple moments using a periodic function includes: Based on the number of image frames and the frame rate of the emoticon, the motion weights of the target component at multiple moments are determined using the periodic function.
4. The emoji generation method according to claim 2, before determining the motion weights of the target component at multiple times using a periodic function, further includes: The periodic function is determined based on the duration of the emoji. The periodic function is a sine function.
5. The emoji generation method according to any one of claims 1 to 4, wherein determining the upper limit of the movement amplitude of the target component includes: The upper limit of the motion amplitude is determined based on the global position, where the global position reflects the component size of the target component, and the upper limit of the motion amplitude is proportional to the component size.
6. The emoji generation method according to claim 5, wherein determining the upper limit of the movement amplitude based on the global position includes: The component dimensions are determined based on the global location; The upper limit of the range of motion is determined based on the size of the component and the image size of the emoticon.
7. The emoticon generation method according to claim 6, wherein the motion state includes a left-right swinging state, the component size includes the component height and component width of the target component, the upper limit of the motion amplitude includes the maximum amplitude of the left-right swing of the target component, and determining the upper limit of the motion amplitude based on the component size and the image size of the emoticon includes: Determine the ratio of the component height to the image height in the image size; The maximum amplitude of the left and right swing of the target component is determined based on the ratio, the component width, and the first scaling parameter.
8. The emoticon generation method according to claim 6, wherein the motion state includes an up-and-down undulating state, the component size includes the component height of the target component, the upper limit of the motion amplitude includes the maximum amplitude of the up-and-down undulation of multiple columns of vertices in the target component, and determining the upper limit of the motion amplitude based on the component size and the image size of the emoticon includes: Determine the ratio of the component height to the image height in the image size; The floating weights corresponding to the multiple columns of vertices are determined by using a nonlinear function. The maximum amplitude of the vertical fluctuation of the multiple columns of vertices is determined based on the ratio, the component height, the floating weights corresponding to the multiple columns of vertices, and the second scaling parameter.
9. The emoji generation method according to any one of claims 1 to 4, wherein generating the emoji based on the source image, the global position, and the periodic motion amplitude comprises: Based on the global position and the periodic motion amplitude, the position and shape of the source image on each frame of the emoticon are determined by a driving algorithm, thereby obtaining the emoticon.
10. The emoji generation method according to any one of claims 1 to 4, wherein determining the global position of the target component based on the source image includes: In the source image, determine the outer circumscribing matrix of the target component; The global position is determined based on the circumscribed matrix.
11. An emoji generation device, comprising: The acquisition unit is used to acquire material images of target parts on a virtual avatar, wherein the target parts are in motion in the emoticons of the virtual avatar; A position determination unit is used to determine the global position of the target component based on the source image; An amplitude determination unit is used to determine the upper limit of the motion amplitude of the target component; The periodic motion amplitude of the target component in the emoji is determined by using a periodic function and the upper limit of the motion amplitude. The generation unit is used to generate the emoticon based on the source image, the global position, and the periodic motion amplitude.
12. An electronic device, comprising: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the emoji generation method as described in any one of claims 1 to 10.
13. A computer-readable storage medium storing computer-executable instructions, wherein when a processor executes the computer-executable instructions, the emoji generation method as described in any one of claims 1 to 10 is implemented.
14. A computer program product comprising computer execution instructions, wherein when a processor executes the computer execution instructions, it implements the emoji generation method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Virtual object wind animation generation method and device, storage medium and terminal
CN112562050A
Picture processor
JP2001216525A