Animation generation method, electronic device, and computer program product
By detecting user actions and generating target animations, and utilizing skeletal points and depth information, the problem of monotonous animation effects and insufficient interactivity on electronic devices is solved, thereby improving user experience and interface appeal.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2025-08-29
- Publication Date
- 2026-07-23
AI Technical Summary
When converting static content into dynamic content, existing electronic devices often feature monotonous animation effects, lack interactivity, and result in a poor user experience.
By detecting user actions, target animations are generated to make objects perform target actions. Animations are generated using changes in skeletal point positions and depth information, supporting object stylization and blending, and combining depth information to simulate 3D images.
It improves the diversity and interactivity of dynamic presentation, enhancing the user experience and the fun of the interface.
Smart Images

Figure CN2025118090_23072026_PF_FP_ABST
Abstract
Description
Animation generation methods, electronic devices and computer program products
[0001] This application claims priority to Chinese patent application filed on January 20, 2025, with application number 202510101852.8 and entitled "Animation Generation Method, Electronic Device and Computer Program Product", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application belongs to the field of terminal technology, and in particular relates to animation generation methods, electronic devices and computer program products. Background Technology
[0003] With the continuous development of terminal technology, electronic devices are becoming increasingly feature-rich. For example, electronic devices can transform static content into dynamic content for dynamic presentation. However, electronic devices generally rely on preset animations (such as preset videos) to convert static content into dynamic content. This involves directly mapping the actions in the preset animation to objects in the static content, allowing the objects to move according to the actions in the preset animation, thus achieving dynamic presentation of the objects. This method of directly mapping the actions in the preset animation to objects results in the object being dynamically presented according to the actions in the preset animation in different scenarios. In other words, the animation effect corresponding to the object is the same in different scenarios, resulting in monotonous animation effects, a lack of interactivity, and a poor user experience. Summary of the Invention
[0004] This application provides an animation generation method, electronic device, and computer program product that can generate target animations corresponding to objects based on user interaction operations, thereby achieving dynamic presentation of objects based on target animations. This can improve the diversity of dynamic presentations, increase the interactivity and interactivity of dynamic presentations, and enhance the user experience.
[0005] In a first aspect, embodiments of this application provide an animation generation method applied to an electronic device, the method comprising:
[0006] Display a first interface, the first interface including a first object, the first object including multiple skeletal points;
[0007] The first step is detection;
[0008] Based on the first operation, target action data is determined, and the target action data is used to indicate the target action to be performed by the first object;
[0009] Based on the target motion data and each skeletal point of the first object, a target animation corresponding to the first object is generated; in the target animation, the first object performs the target motion indicated by the target motion data.
[0010] In the animation generation method described above, when the electronic device displays a first interface including a first object, the electronic device can detect a first operation and determine target action data based on the first operation. Then, based on the target action data and the skeletal points of the first object, a target animation corresponding to the first object is generated. In the target animation, the first object can perform the target action indicated by the target action data. That is, the electronic device can determine the target action data corresponding to the target action to be performed by the first object based on the user's first operation, and can generate a target animation corresponding to the first object based on the target action data. This allows the dynamic presentation of the first object to respond to the user's first operation, increasing the interactivity and interactivity of the dynamic presentation of the first object, increasing the diversity of the dynamic presentation of the first object, improving the animation effect of the first object, enhancing the fun of the interface display, and improving the user's interactive experience.
[0011] For example, the target motion data is used to determine the positional changes of the plurality of skeletal points when the first object performs the target motion.
[0012] In some embodiments, determining the target action data according to the first operation includes:
[0013] Based on the first operation, the target action data is determined from the action database;
[0014] The action database includes preset action data corresponding to multiple actions, and the target action data includes preset action data corresponding to the target action.
[0015] In the animation generation method provided in this embodiment, the electronic device or other devices communicatively connected to the electronic device may store a preset correspondence between operations and actions (i.e., preset correspondence B). After acquiring the first operation, the electronic device can determine the target action to be performed by the first object based on the first operation and the preset correspondence B, and can determine the target action data from the action database based on the target action. By directly determining the target action data from the action database based on the target action, the accuracy and speed of determining the target action data can be improved, thereby enhancing the accuracy and speed of target animation generation and improving the user experience.
[0016] In other embodiments, determining the target action data based on the first operation includes:
[0017] Based on the first operation, the target action is determined, and based on the target action, the target action data is determined.
[0018] In the animation generation method provided in this embodiment, after determining the target action to be performed by the first object according to the first operation and the preset correspondence relationship B, the electronic device can directly determine the target action data according to the target action. For example, it can directly determine the position changes of each bone point of the first object according to the target action and the constraint relationship between the bone points, so as to determine the target action data, without the need to build an action database in advance.
[0019] In some embodiments, generating the target animation corresponding to the first object based on the target motion data and each skeletal point of the first object includes:
[0020] Obtain the initial position corresponding to each skeletal point of the first object;
[0021] Based on the target motion data, determine the target position corresponding to each skeletal point of the first object;
[0022] Based on the initial and target positions of each skeletal point of the first object, generate the target animation corresponding to the first object.
[0023] In the animation generation method provided in this embodiment, the target motion data may include the position changes corresponding to each bone point when the target motion is performed; that is, it may include one or more positions corresponding to each bone point when the target motion is performed. After determining the target motion data, the electronic device can map the positions corresponding to each bone point in the target motion data to each bone point of the first object to determine the target positions corresponding to each bone point of the first object. A single bone point may correspond to one or more target positions. When a single bone point corresponds to multiple target positions, these multiple target positions can constitute a time series of target positions. After determining the target positions corresponding to each bone point of the first object, the electronic device can generate the target animation corresponding to the first object based on the initial position and target position corresponding to each bone point.
[0024] For example, an electronic device can adjust the positions of the bones of a first object based on the initial positions of each bone point and the target positions of each bone point in the first frame of the target motion indicated by the target motion data, to generate the first frame of motion animation corresponding to the first object. Subsequently, the electronic device can adjust the positions of the bones of the first object based on the target positions of each bone point in the second frame of the target motion indicated by the target motion data and the target positions of each bone point in the first frame of the target motion, to generate the second frame of motion animation corresponding to the first object. Then, the electronic device can adjust the positions of the bones of the first object based on the target positions of each bone point in the third frame of the target motion indicated by the target motion data and the target positions of each bone point in the second frame of the target motion, to generate the third frame of motion animation corresponding to the first object, and so on, until the electronic device determines the last frame of motion animation corresponding to the first object based on the target positions of each bone point in the last frame of the target motion indicated by the target motion data and the target positions of each bone point in the frame preceding the last frame of the target motion. The first frame of motion animation to the last frame of motion animation corresponding to the first object can be considered as the target animation corresponding to the first object.
[0025] In some embodiments, prior to displaying the first interface, the method further includes:
[0026] A second interface is displayed, which includes the first object;
[0027] In response to the second operation, the first object is merged into the first interface.
[0028] In the animation generation method provided in this embodiment, users can merge one or more objects displayed in a second interface (such as interface A or interface B) into a first interface according to actual needs, thereby enhancing the interest of the first interface and improving the user experience. For example, one or more objects from images displayed in a gallery interface can be merged into the first interface. Similarly, one or more objects displayed in the interface corresponding to a theme application can be merged into the first interface.
[0029] In one embodiment, the first interface and the second interface are displayed in a split-screen format; or, the second interface floats above the first interface; or, the first interface floats above the second interface.
[0030] In the animation generation method provided in this embodiment, when merging the first object in the second interface into the first interface, the electronic device can simultaneously display the first interface and the second interface to facilitate the user in merging the first object in the second interface into the first interface. The electronic device can simultaneously display the first interface and the second interface in a split-screen manner or in a floating window manner.
[0031] For example, the second operation includes dragging the first object onto the first interface.
[0032] In the animation generation method provided in this embodiment, when the electronic device displays the first interface and the second interface at the same time, the user can directly merge the first object into the first interface by dragging the first object. The operation is simple and convenient, making it easy for users to merge objects and improving the user experience.
[0033] In some embodiments, the step of merging the first object into the first interface in response to the second operation includes:
[0034] In response to the second operation, the position of the first object in the first interface is determined;
[0035] Based on the position of the first object in the first interface, the first object is merged into the first interface.
[0036] In the animation generation method provided in this embodiment, when the first object is merged into the first interface based on the second operation, the electronic device can determine the position of the first object in the first interface, and can accurately merge the first object into the first interface according to the position of the first object in the first interface, thereby enhancing the fun of the first interface.
[0037] In one embodiment, determining the position of the first object in the first interface includes:
[0038] Determine the position of the second operation in the first interface, and determine the position of the first object in the first interface based on the position of the second operation in the first interface.
[0039] In the animation generation method provided in this embodiment, when the second operation is applied to the first interface, the electronic device can determine the position of the second operation on the first interface, and determine the position of the first object on the first interface based on the position of the second operation on the first interface. This allows the display of the first object on the first interface to respond to the user's operation, facilitating viewing of the first object and improving the user experience. For example, the electronic device can determine the ending position of the second operation on the first interface as the position of the first object on the first interface.
[0040] In some embodiments, the step of merging the first object into the first interface in response to the second operation includes:
[0041] In response to the second operation, the first object is stylized to obtain a stylized first object, and the stylized first object is then integrated into the first interface.
[0042] For example, the stylized first object includes a cartoon-style first object or a painterly first object.
[0043] In the animation generation method provided in this embodiment, since the uncanny valley effect is easily caused when the action is driven by real people or real animals, resulting in poor animation effect, in order to improve the animation effect corresponding to the first object and enhance the user experience, when the first object is integrated into the first interface based on the second operation, the electronic device can perform stylization processing on the first object to convert the first object into a painting style object or a cartoon style object, so that the generated target animation can be cartoonized and reduce the problem of poor visual experience caused by imperfections.
[0044] In some embodiments, the method further includes:
[0045] Obtain the depth information corresponding to the first object;
[0046] The step of generating a target animation corresponding to the first object based on the target motion data and each skeletal point of the first object includes:
[0047] Based on the target motion data, the depth information, and each skeletal point of the first object, a target animation corresponding to the first object is generated.
[0048] In the animation generation method provided in this embodiment, the electronic device can also obtain the depth information corresponding to the first object, and combine the depth information to generate the target animation corresponding to the first object. For example, the first object can be transformed based on the depth information to simulate a 3D image, so that the generated target animation has a three-dimensional feel and improves the user experience.
[0049] In one embodiment, generating the target animation corresponding to the first object based on the target motion data, the depth information, and each skeletal point of the first object includes:
[0050] When it is determined that the first object needs to perform a rotation action based on the target motion data, the target animation corresponding to the first object is generated based on the target motion data, the depth information, and each bone point of the first object.
[0051] In the animation generation method provided in this embodiment, when it is determined that the first object needs to rotate based on the target action data, that is, when the target action to be performed by the first object includes a rotation action, the electronic device can generate the target animation corresponding to the first object based on the depth information, the target action data, and each bone point of the first object. By combining the depth information to generate the target animation corresponding to the first object, the first object can present a three-dimensional effect when performing rotation actions such as turning around, giving the user a better three-dimensional effect.
[0052] In one embodiment, generating the target animation corresponding to the first object based on the target motion data, the depth information, and each skeletal point of the first object includes:
[0053] Based on the target motion data, determine the rotation angle corresponding to the first object;
[0054] Based on the rotation angle and the depth information, determine the rotation matrix corresponding to the first object;
[0055] Based on the rotation matrix, the target motion data, and each skeletal point of the first object, a target animation corresponding to the first object is generated.
[0056] In some embodiments, after displaying the first interface, the method further includes:
[0057] In response to a third operation, the first object is merged into a first target display element or a third interface corresponding to the first target display element; the third operation is the operation of dragging the first object to the first target display element.
[0058] In one embodiment, before merging the first object into the first target display element or the third interface corresponding to the first target display element in response to the third operation, the method further includes:
[0059] The fourth operation is detected, which is an operation performed on the first object;
[0060] In response to the fourth operation, at least one target display element in the first interface is highlighted, the at least one target display element including the first target display element.
[0061] For example, the first target display element is an icon, card, or window corresponding to the application.
[0062] In the animation generation method provided in this embodiment, when the electronic device displays a first interface containing a first object, the electronic device can control one or more target display elements on the first interface to perform related actions based on the user's operation on the first object, facilitating user operation on the first object and improving user experience. For example, when the user drags the first object, the electronic device can highlight one or more target display elements on the first interface. The highlighting can be used to prompt the user to drag the first object onto any of the highlighted target display elements. When it detects that the first object has been dragged onto any of the highlighted target display elements (e.g., target display element A), the electronic device can merge the first object into target display element A, or merge the first object into the interface corresponding to target display element A, so that the first object is displayed in target display element A or the interface corresponding to target display element A.
[0063] In one embodiment, when the first target display element is an icon corresponding to the first application, the step of merging the first object into the first target display element or the third interface corresponding to the first target display element in response to the third operation includes:
[0064] In response to the third operation, the first application is launched, and the first object is integrated into the third interface corresponding to the first application.
[0065] In the animation generation method provided in this embodiment, when the user drags the icon corresponding to the first application of the first object, the electronic device can determine that the user wants to merge the first object into the interface corresponding to the first application. At this time, the electronic device can launch the first application, display the interface corresponding to the first application, and merge the first object into the interface corresponding to the first application to meet the user's actual needs and improve the user experience.
[0066] In some embodiments, the first interface is a desktop, a negative one screen, a lock screen, or an application interface.
[0067] Secondly, embodiments of this application provide an animation generation apparatus applied to an electronic device, the apparatus comprising:
[0068] A first display module is used to display a first interface, the first interface including a first object, the first object including multiple skeletal points;
[0069] The detection module is used to detect the first operation;
[0070] The data determination module is used to determine target action data based on the first operation, wherein the target action data is used to indicate the target action to be performed by the first object;
[0071] An animation generation module is used to generate a target animation corresponding to the first object based on the target motion data and each skeletal point of the first object; in the target animation, the first object performs the target motion indicated by the target motion data.
[0072] For example, the target motion data is used to determine the positional changes of the plurality of skeletal points when the first object performs the target motion.
[0073] In some embodiments, the data determination module is specifically used to determine the target action data from the action database according to the first operation; the action database includes preset action data corresponding to multiple actions respectively, and the target action data includes preset action data corresponding to the target action.
[0074] In other embodiments, the data determination module is further configured to determine the target action based on the first operation, and to determine the target action data based on the target action.
[0075] In some embodiments, the animation generation module is specifically used to obtain the initial position corresponding to each skeletal point of the first object; determine the target position corresponding to each skeletal point of the first object according to the target motion data; and generate the target animation corresponding to the first object according to the initial position and target position corresponding to each skeletal point of the first object.
[0076] In some embodiments, the apparatus further includes:
[0077] The second display module is used to display a second interface, the second interface including the first object;
[0078] The first fusion module is used to fuse the first object into the first interface in response to the second operation.
[0079] In one embodiment, the first interface and the second interface are displayed in a split-screen format; or, the second interface floats above the first interface; or, the first interface floats above the second interface.
[0080] For example, the second operation includes dragging the first object onto the first interface.
[0081] In some embodiments, the first fusion module is specifically configured to, in response to the second operation, determine the position of the first object in the first interface; and, based on the position of the first object in the first interface, fuse the first object into the first interface.
[0082] In one embodiment, the first fusion module is further configured to determine the position of the second operation in the first interface, and determine the position of the first object in the first interface based on the position of the second operation in the first interface.
[0083] In some embodiments, the first fusion module is further configured to, in response to the second operation, perform stylization processing on the first object to obtain a stylized first object, and fuse the stylized first object into the first interface.
[0084] For example, the stylized first object includes a cartoon-style first object or a painterly first object.
[0085] In some embodiments, the apparatus further includes:
[0086] The acquisition module is used to acquire the depth information corresponding to the first object;
[0087] The animation generation module is further configured to generate a target animation corresponding to the first object based on the target motion data, the depth information, and each skeletal point of the first object.
[0088] In one embodiment, the animation generation module is further configured to generate a target animation corresponding to the first object based on the target motion data, the depth information, and each skeletal point of the first object when it is determined that the first object needs to perform a rotation action based on the target motion data.
[0089] In one embodiment, the animation generation module is further configured to: determine the rotation angle corresponding to the first object based on the target motion data; determine the rotation matrix corresponding to the first object based on the rotation angle and the depth information; and generate a target animation corresponding to the first object based on the rotation matrix, the target motion data, and each skeletal point of the first object.
[0090] In some embodiments, the apparatus further includes:
[0091] The second fusion module is used to respond to a third operation by fusioning the first object into a first target display element or a third interface corresponding to the first target display element; the third operation is to drag the first object to the first target display element.
[0092] In one embodiment, the detection module is further configured to detect a fourth operation, wherein the fourth operation is an operation performed on the first object;
[0093] The device further includes a third display module; the third display module is configured to, in response to the fourth operation, highlight at least one target display element in the first interface, the at least one target display element including the first target display element.
[0094] For example, the first target display element is an icon, card, or window corresponding to the application.
[0095] In one embodiment, when the first target display element is an icon corresponding to the first application, the second fusion module is further configured to respond to the third operation, launch the first application, and fuse the first object into the third interface corresponding to the first application.
[0096] In some embodiments, the first interface is a desktop, a negative one screen, a lock screen, or an application interface.
[0097] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the animation generation method described in any one of the first aspects above.
[0098] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by an electronic device, causes the electronic device to implement the animation generation method described in any one of the first aspects above.
[0099] Fifthly, embodiments of this application provide a computer program product, which includes a computer program. When the computer program is executed by an electronic device, it causes the electronic device to implement the animation generation method described in any one of the first aspects above.
[0100] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0101] Figure 1 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application;
[0102] Figure 2 is a schematic diagram of the software architecture of the electronic device provided in an embodiment of this application;
[0103] Figure 3 is a flowchart illustrating the animation generation method provided in an embodiment of this application;
[0104] Figure 4 is an example diagram of a stable diffusion model provided in an embodiment of this application;
[0105] Figures 5 and 6 are schematic diagrams of application scenarios provided in the embodiments of this application;
[0106] Figure 7 is a schematic diagram of the second application scenario provided in the embodiments of this application;
[0107] Figure 8 is a schematic diagram of the third application scenario provided in the embodiments of this application;
[0108] Figure 9 is a schematic diagram of the application scenario provided in the embodiments of this application;
[0109] Figure 10 is an example diagram of the construction action database provided in an embodiment of this application. Detailed Implementation
[0110] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0111] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0112] In the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0113] References to "one embodiment" or "some embodiments" as described in this application specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0114] Furthermore, the term "multiple" mentioned in the embodiments of this application should be interpreted as two or more.
[0115] The steps involved in the animation generation method provided in this application are merely examples, and not all steps are mandatory, nor are all information or message contents required. They can be added or removed as needed during use. Furthermore, the same step, or a step or message with the same function in this application's embodiments can be referenced and adapted between different embodiments.
[0116] The business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions provided in the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0117] With the continuous development of terminal technology, electronic devices are becoming increasingly feature-rich. For example, electronic devices can transform static content into dynamic content (i.e., animation) for dynamic presentation. However, electronic devices generally rely on preset animations (such as preset videos) to convert static content into dynamic content. This involves directly mapping the actions in the preset animation to objects in the static content, allowing the object to move according to the actions in the preset animation, thus achieving dynamic presentation of the object. This method of directly mapping the actions in the preset animation to the object results in the object dynamically presenting itself according to the actions in the preset animation in different scenarios. In other words, the animation effect corresponding to the object is the same in different scenarios, resulting in monotonous animation effects, a lack of interactivity, and a poor user experience.
[0118] To address the aforementioned problems, embodiments of this application provide an animation generation method, an electronic device, and a computer program product. In this method, when displaying a first interface including a first object, the first object may include multiple skeletal points. The electronic device can detect a first operation and determine target action data based on the first operation. Then, based on the target action data and the skeletal points of the first object, a target animation corresponding to the first object is generated. In the target animation, the first object can perform the target action indicated by the target action data. That is, embodiments of this application can determine the target action data corresponding to the target action to be performed by the first object based on the user's first operation, and generate a target animation corresponding to the first object based on the target action data. This allows the first object to respond to the user's first operation based on the target animation, increasing the interactivity and responsiveness of the dynamic presentation of the first object, increasing the diversity of the dynamic presentation of the first object, improving the animation effect of the first object, enhancing the fun of the interface display, and improving the user experience. It has strong usability and practicality.
[0119] In this application embodiment, the electronic device can be a mobile phone, tablet computer, wearable device, in-vehicle device, smart screen, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), desktop computer, or other electronic device with a display screen. This application embodiment does not impose any restrictions on the specific type of electronic device.
[0120] The following first introduces the electronic device involved in the embodiments of this application. Please refer to FIG1, which shows a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application.
[0121] Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a camera 191, and a display screen 192, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a proximity sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0122] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0123] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0124] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0125] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0126] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0127] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0128] The charging management module 140 is used to receive charging input from the charger.
[0129] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, display screen 192, camera 191, and wireless communication module 160, etc.
[0130] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0131] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can cover one or more communication frequency bands. Mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G on electronic device 100. Mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. Mobile communication module 150 can receive electromagnetic waves through antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. Mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through antenna 1. In some embodiments, at least some functional modules of mobile communication module 150 may be disposed in processor 110. In some embodiments, at least some functional modules of mobile communication module 150 and at least some modules of processor 110 may be disposed in the same device.
[0132] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 192. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0133] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0134] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0135] Electronic device 100 implements display functions through a GPU, a display screen 192, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 192 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0136] The display screen 192 is used to display images, videos, etc. The display screen 192 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 192, where N is a positive integer greater than 1.
[0137] Electronic device 100 can perform shooting functions through ISP, camera 191, video codec, GPU, display 192 and application processor.
[0138] The ISP is used to process the data fed back by the camera 191.
[0139] Camera 191 is used to capture still images or videos. In some embodiments, electronic device 100 may include one or N cameras 191, where N is a positive integer greater than 1.
[0140] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0141] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0142] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0143] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0144] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.
[0145] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0146] Audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. Audio module 170 can also be used for encoding and decoding audio signals.
[0147] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0148] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. For example, the software system of electronic device 100 can adopt a layered architecture such as Android operating system (OS), Harmony OS, or iOS. This application embodiment uses a layered architecture as an example to illustrate the software structure of electronic device 100.
[0149] Figure 2 is a software structure block diagram of an electronic device 100 according to an embodiment of this application.
[0150] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into four layers, from top to bottom: the application layer, the application framework layer, the runtime and system libraries, and the kernel layer.
[0151] The application layer can include a series of application packages.
[0152] As shown in Figure 2, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0153] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0154] As shown in Figure 2, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0155] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0156] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0157] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0158] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0159] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0160] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0161] Runtime consists of core libraries and a virtual machine. Runtime is responsible for the scheduling and management of the operating system.
[0162] The core library consists of two parts: one part is the functionalities that the Java language needs to call, and the other part is the core library of the operating system.
[0163] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0164] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGLES), 2D graphics engines (e.g., SGL), etc.
[0165] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0166] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0167] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0168] A 2D graphics engine is a graphics engine for 2D drawing.
[0169] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0170] The animation generation method provided in this application embodiment will be described in detail below with reference to the accompanying drawings and specific application scenarios.
[0171] Please refer to Figure 3, which shows a schematic flowchart of the animation generation method provided in this application embodiment. This method can be applied to electronic devices with displays, such as mobile phones, tablets, laptops, wearable devices, in-vehicle devices, or smart screens. As shown in Figure 3, the method may include:
[0172] S301. An electronic device displays a first interface, the first interface including a first object, the first object including multiple skeletal points.
[0173] S302, First operation for testing electronic equipment.
[0174] S303. The electronic device determines target action data according to the first operation; the target action data is used to indicate the target action to be performed by the first object.
[0175] S304. The electronic device generates a target animation corresponding to the first object based on the target motion data and each skeletal point of the first object; in the target animation, the first object performs the target motion indicated by the target motion data.
[0176] In this embodiment, when displaying a first interface including a first object, the electronic device can detect a first operation and determine target action data based on the first operation. Then, based on the target action data and the skeletal points of the first object, a target animation corresponding to the first object is generated. In the target animation, the first object can perform the target action indicated by the target action data. That is, this embodiment can determine the target action data corresponding to the target action to be performed by the first object based on the user's first operation, and generate a target animation corresponding to the first object based on the target action data. This allows the dynamic presentation of the first object to respond to the user's first operation, increasing the interactivity and interactivity of the dynamic presentation of the first object, increasing the diversity of the dynamic presentation of the first object, improving the animation effect of the first object, increasing the fun of the interface display, and enhancing the user's interactive experience.
[0177] It should be noted that the first object can be a person or animal, or any object capable of performing relevant actions. The first interface can be the main interface (or desktop) of an electronic device, the negative one screen, the lock screen, or the interface of any application (such as a camera application or an application based on VR or AR technology). The first operation can be any operation such as a click, a double-click, or a drag operation.
[0178] In this embodiment of the application, for different first operations, the electronic device can determine different target action data to generate different target animations, so that the first object can perform different actions to respond to different user operations, which can improve the diversity and fun of the dynamic presentation of the first object and enhance the user's interactive experience.
[0179] For example, when the first operation is clicking a location on the first interface, the first object can perform a jumping action in the target animation generated by the electronic device. For example, when the first operation is clicking an icon on the first interface (such as the icon for a music application), i.e., when the first operation is launching a music application, the first object can perform a dancing action in the target animation generated by the electronic device. For example, when the first operation is dragging a target display element on the first interface (such as the icon for an application), and the target display element obscures the first object during the dragging process, the first object can perform an evasive action or a movement action (such as walking or running) in the target animation generated by the electronic device, and so on.
[0180] It should be understood that the target display element in the first interface can be any element such as an icon, card or window displayed in the first interface. The specific content of the target display element is not limited in the embodiments of this application, and can be determined according to the actual scenario.
[0181] In some embodiments, the first object displayed on the first interface may be derived from an image (referred to as image A for ease of understanding). Image A may include one or more objects, and one or more objects in image A may be integrated into the first interface as the first object. The electronic device may display image A, for example, through an interface (referred to as interface A for ease of understanding). When image A is displayed on interface A, the electronic device may, based on relevant user operations (referred to as second operations for ease of understanding), obtain one or more objects from image A as the first object, and integrate the obtained first object into the first interface, so that the electronic device can display the first object when displaying the first interface. That is, the user can select one or more objects from the image and integrate them into the first interface according to actual needs, thereby enhancing the visual appeal of the first interface and improving the user experience. The first object may include one or more objects. The following will illustrate this by assuming the first object includes only one object.
[0182] It should be understood that image A can be an image from the image gallery application of the electronic device, an image obtained by the electronic device from the network, an image from the media library of the electronic device, and so on. Interface A can be the interface corresponding to the image gallery application, the interface corresponding to the media library, the interface corresponding to the theme application, and so on.
[0183] It should be noted that the second operation can be determined according to the actual scenario, and the embodiments of this application do not impose any restrictions on it.
[0184] For example, the second operation may include one or more operations. For instance, the second operation may include an operation to select a first object from image A (for ease of understanding, this can be called a selection operation) and an operation to merge the selected first object into the first interface (for ease of understanding, this can be called a fusion operation). Merging the first object into the first interface may refer to adding the first object to the first interface. The selection operation and the fusion operation can be specifically determined according to the actual scenario, and this application embodiment does not impose any limitations on them.
[0185] For example, the selection operation can be a long press, and the merging operation can be a drag operation; that is, the second operation can include both long press and drag operations. When a user wants to merge an object in image A into the first interface, the user can long press the object in image A and then drag it. After detecting the long press and drag operations on the object, the electronic device can identify that object as the first object and merge it into the first interface.
[0186] The long press operation can refer to an operation where the duration of touching an object is greater than or equal to a preset duration. The preset duration can be determined according to the actual scenario, and this application embodiment does not impose any limitation on it. For example, the preset duration can be determined to be any value such as 2 seconds, 3 seconds, or 4 seconds, depending on the actual scenario.
[0187] For example, the selection operation can be a double-click operation, and the merging operation can be a drag operation. That is, the second operation can include double-click operations (such as single-finger double-click, two-finger double-click, single-knuckle double-click, or two-knuckle double-click, etc.) and drag operations. When a user wants to merge an object in image A into the first interface, the user can double-click the object in image A and then drag it. After detecting the double-click and drag operations on the object, the electronic device can identify that object as the first object and merge it into the first interface.
[0188] For example, a selection operation can be a box selection operation, and a blending operation can be a drag operation; that is, the second operation can include both box selection and dragging operations. When a user wants to blend a certain object in image A into the first interface, the user can select the object in image A by box selection, and then drag the object. After detecting the box selection and dragging operations on the object, the electronic device can identify the object as the first object and blend the first object into the first interface. Here, the box selection operation can refer to the operation of drawing a preset area to select an object.
[0189] For example, a selection operation can be a double-click operation, and a merging operation can also be a double-click operation; that is, the second operation can include both a first double-click operation and a second double-click operation. When a user wants to merge a certain object in image A into the first interface, the user can double-click the object in image A, and after double-clicking the object, double-click the first interface. After detecting the double-click operation on the object and the double-click operation on the first interface, the electronic device can identify the object as the first object and merge the first object into the first interface.
[0190] The first double-click operation described above, used to select a first object (i.e., the first double-click operation is an operation of double-clicking the first object), and the second double-click operation used to merge the first object into the first interface (i.e., the second double-click operation is an operation of double-clicking the first interface), are merely illustrative explanations and should not be construed as limiting the embodiments of this application. In the embodiments of this application, the first double-click operation can be used to instruct the first object to be merged into the first interface (i.e., the first double-click operation can be an operation of double-clicking the first interface), and the second double-click operation can be used to select the first object (i.e., the second double-click operation can be an operation of double-clicking the first object).
[0191] The first and second double-click operations can be the same or different. This application does not impose specific limitations on this, and the specific method can be determined based on the actual scenario. For example, both the first and second double-click operations can be single-knuckle double-click operations, or both can be single-finger double-click operations. For example, the first double-click operation can be a single-knuckle double-click operation, and the second double-click operation can be a single-finger double-click operation. For example, the first double-click operation can be a two-knuckle double-click operation, and the second double-click operation can be a single-knuckle double-click operation, and so on.
[0192] It should be understood that the embodiments of this application do not limit the specific method by which the electronic device obtains the first object from image A based on the second operation, and can be determined according to the actual scenario. For example, the electronic device can obtain the first object from image A using image segmentation technology (such as image matting technology). That is, when the electronic device displays image A, if a user wants to merge a certain object in image A into the first interface, the user can perform a second operation on that object in image A. After detecting the second operation applied to the object, the electronic device can determine the first object based on the second operation and obtain the first object from image A using image matting technology. After obtaining the first object, the electronic device can merge the first object into the first interface.
[0193] Similarly, this application embodiment does not limit the specific time for the electronic device to acquire the first object from image A based on the second operation, and it can be determined according to the actual scenario. For example, when the second operation includes multiple operations, such as a selection operation and a fusion operation, the electronic device can acquire the first object from image A when the selection operation is detected, so that when the fusion operation is detected, the electronic device can quickly fuse the acquired first object into the first interface, which can improve the speed and efficiency of fusion of the first object into the first interface and enhance the user experience.
[0194] For example, when the selection operation is a long press operation and the fusion operation is a drag operation, that is, when the second operation includes a long press operation to select the first object and a drag operation to fuse the first object to the first interface, after the electronic device detects the operation of long pressing the first object in image A, it can obtain the first object from image A through image matting technology, and after detecting the drag operation on the first object, it can fuse the obtained first object to the first interface.
[0195] For example, when the selection operation is a double-click operation and the fusion operation is also a double-click operation, that is, when the second operation includes the first double-click operation of selecting the first object and the second double-click operation of fusion of the first object to the first interface, after detecting the double-click operation of the first object in image A, the electronic device can obtain the first object from image A through image matting technology, and after detecting the double-click operation of the first interface, it can fuse the obtained first object to the first interface.
[0196] It should be noted that the above-described method of obtaining the first object from image A when the electronic device detects a selection operation is merely illustrative and should not be construed as a limitation on the embodiments of this application. In the embodiments of this application, the electronic device may also obtain the first object from image A at other times.
[0197] For example, to reduce the false triggering of the acquisition of the first object and thus reduce its impact on the performance of the electronic device, the electronic device may acquire the first object from image A only after detecting a merging operation. That is, when a selection operation is detected, the electronic device cannot determine whether the user needs to merge the first object into the first interface; in this case, the electronic device may not acquire the first object from image A. However, after detecting a merging operation, the electronic device can determine that the user wants to merge the first object into the first interface. At this point, the electronic device can acquire the first object from image A and merge it into the first interface. By acquiring the first object only when it is determined that the user actually wants to merge it into the first interface, the false acquisition of the first object by the electronic device can be reduced, thereby improving the performance of the electronic device.
[0198] For example, when the selection operation is a long press and the merging operation is a drag operation—that is, when the second operation includes a long press to select the first object and a drag operation to merge the first object into the first interface—the electronic device may not acquire the first object when a long press operation is detected in image A, to avoid accidentally triggering the acquisition of the first object and affecting the performance of the electronic device. When an operation to drag the first object to the first interface is detected, the electronic device can determine that the user wants to merge the first object into the first interface. At this time, the electronic device can acquire the first object from image A using image matting technology and merge the acquired first object into the first interface.
[0199] For example, when both the selection and merging operations are double-click operations—meaning the second operation includes a first double-click to select the first object and a second double-click to merge the first object into the first interface—the electronic device can avoid acquiring the first object upon detecting a double-click on it. This prevents accidental acquisition of the first object and avoids impacting the device's performance. Conversely, upon detecting a double-click on the first interface, the electronic device can determine that the user wants to merge the first object into the first interface. In this case, the electronic device can use image matting technology to acquire the first object from image A and merge it into the first interface.
[0200] In some embodiments, when the fusion operation requires movement, after acquiring the first object from image A based on the selection operation, the electronic device can control the first object to move along with the movement of the fusion operation when the user performs the fusion operation. This provides a real-time response to the user's fusion operation, allowing the user to easily understand the selected first object and improving the user experience. The operation requiring movement can refer to a swiping operation or a dragging operation, etc.
[0201] For example, when the selection operation is a long press and the merging operation is a drag operation—that is, when the second operation includes a long press to select the first object and a drag operation to merge the first object into the first interface—the electronic device, after detecting the long press operation on the first object in image A, can extract the first object from image A using image cutout technology. When the user performs the drag operation, the electronic device can control the first object to move along with the drag operation.
[0202] It should be noted that the description of the first object moving with the fusion operation is merely illustrative and should not be construed as a limitation on the embodiments of this application. In the embodiments of this application, the first object may not move with the fusion operation, or the image A containing the first object may move with the fusion operation.
[0203] For example, when the electronic device acquires the first object from image A after detecting a fusion operation, since the electronic device has not yet acquired the first object from image A when the fusion operation is detected, it cannot make the first object move with the movement of the fusion operation. Therefore, during the execution of the fusion operation, the first object may not move with the movement of the fusion operation. Alternatively, in order to respond to the user's fusion operation and improve the user's interactive experience, the electronic device may control image A containing the first object to move with the movement of the fusion operation during the execution of the fusion operation.
[0204] For example, when the selection operation is a long press and the merging operation is a drag operation, that is, when the second operation includes a long press to select the first object and a drag operation to merge the first object into the first interface, the electronic device may not retrieve the first object from image A after detecting the long press operation of the first object in image A. Instead, it may retrieve the first object from image A after detecting the drag operation of the first object to the first interface. During the process of the user dragging the first object to the first interface, the electronic device can control image A to move along with the drag operation.
[0205] It should be noted that when merging the first object into the first interface based on the second operation, the embodiments of this application do not limit the position of the first object in the first interface, and can be determined according to the actual scenario. The position of the first object in the first interface can refer to the position of the center point of the first object in the first interface. The center point of the first object can refer to the center point of the target bounding rectangle corresponding to the first object. The target bounding rectangle corresponding to the first object can refer to the smallest bounding rectangle corresponding to the first object when the first object is in its initial state (e.g., the state in image A or the state when the first object has not performed any action). Alternatively, the target bounding rectangle corresponding to the first object can refer to the smallest bounding rectangle corresponding to the first object when the first object performs the maximum amplitude action.
[0206] The position of the first object in the first interface described above refers to the position of the center point of the first object in the first interface, and is only an illustrative explanation and should not be construed as a limitation on the embodiments of this application. The embodiments of this application can also represent the position of the first object in the first interface in other ways, such as by using multiple points (e.g., three or four vertices) in the target bounding rectangle corresponding to the first object to represent the position of the first object in the first interface.
[0207] In some embodiments, the electronic device may determine the position of the first object in the first interface based on a second operation.
[0208] In one embodiment, the first object can be integrated into the first interface based on different second operations. An electronic device or other device communicatively connected to the electronic device may have a preset correspondence between the second operation and the position of the first object on the first interface (for ease of understanding, this can be referred to as preset correspondence A). When a second operation is detected, the electronic device can determine the position of the first object on the first interface based on the detected second operation and preset correspondence A.
[0209] For example, the preset correspondence A may include: when the second operation includes a long press and a drag operation, the position of the first object in the first interface can be the center of the first interface; when the second operation includes a selection box operation and a drag operation, the position of the first object in the first interface can be the lower left corner of the first interface; when the second operation includes a first double-click operation and a second double-click operation, the position of the first object in the first interface can be the upper right corner of the first interface, and so on. That is, when the second operation includes a long press and a drag operation, the electronic device can merge the first object into the center of the first interface. When the second operation includes a selection box operation and a drag operation, the electronic device can merge the first object into the lower left corner of the first interface. When the second operation includes two double-click operations, the electronic device can merge the first object into the upper right corner of the first interface.
[0210] In another embodiment, when the second operation needs to act on the first interface, the electronic device can determine the position of the second operation on the first interface, and can determine the position of the first object on the first interface based on the position of the second operation on the first interface. For example, the electronic device can determine the position of the fusion operation in the second operation on the first interface, and can determine the position of the first object on the first interface based on the position of the fusion operation on the first interface.
[0211] For example, when the second operation includes a fusion operation, and the fusion operation is a double-click operation on a certain position of the first interface, the electronic device can determine the position of the double-click operation in the first interface, and can determine the position of the double-click operation in the first interface as the position of the first object in the first interface.
[0212] For example, when the second operation includes a merging operation, and the merging operation is an operation of dragging a first object to the first interface, the electronic device can determine the termination position of the dragging operation in the first interface, and can determine the termination position of the dragging operation in the first interface as the position of the first object in the first interface. Here, the termination position of the dragging operation in the first interface can refer to the position of the dragging operation in the first interface when the dragging operation stops.
[0213] The above description of determining the position of the first object on the first interface as the ending position of the dragging operation on the first interface when the second operation includes a fusion operation (dragging the first object to the first interface) is merely illustrative and should not be construed as a limitation on the embodiments of this application. In the embodiments of this application, the electronic device may also determine the position of the first object on the first interface as other positions of the dragging operation on the first interface. For example, the electronic device may determine the position of the first object on the first interface as the middle position of the dragging operation on the first interface, or it may determine the position of the dragging operation on the first interface as the position of the first object as the position of the first object near the center point of the electronic device's display interface, and so on.
[0214] In other embodiments, the electronic device or other devices communicatively connected to the electronic device may be provided with a preset position for displaying the first object. When a second operation of merging the first object into the first interface is detected, the electronic device can determine the preset position as the location of the first object in the first interface.
[0215] The preset position can be determined according to the actual scenario, and this application embodiment does not limit this. For example, in order to facilitate the user to quickly see the action performed by the first object, the electronic device can determine the preset position based on the center point of the display interface. For example, the position in the first interface that is closest to the center point of the display interface can be determined as the preset position.
[0216] In other embodiments, after detecting a second operation that merges the first object into the first interface, the electronic device can determine a blank area (i.e., an area without any displayed content) in the first interface, and can determine the position of the first object in the first interface based on the blank area. The blank area can refer to an area in the first interface with an area greater than or equal to a preset threshold that does not display any content. The preset threshold can be specifically determined according to the actual scenario, and this application embodiment does not impose any limitations on it.
[0217] For example, when the blank area includes one, the electronic device can determine the location of the center point of the blank area as the location of the first object in the first interface.
[0218] For example, when there are multiple blank areas, the electronic device can determine the area corresponding to each blank area, and determine the position of the first object in the first interface based on the blank area with the largest area (which can be called blank area A for ease of understanding). For example, the position of the center point of blank area A can be determined as the position of the first object in the first interface.
[0219] For example, when there are multiple blank areas, the electronic device can determine the length and width of each blank area, as well as the target length and target width of the first object. It can also determine a blank area (which can be referred to as blank area B for ease of understanding) whose length is greater than or equal to the target length of the first object and / or whose width is greater than or equal to the target width of the first object. Based on blank area B, the position of the first object in the first interface can be determined. For instance, the position of the center point of blank area B can be used to determine the position of the first object in the first interface.
[0220] The target length corresponding to the first object can be the length of the target bounding rectangle corresponding to the first object. The width corresponding to the first object can be the width of the target bounding rectangle corresponding to the first object.
[0221] It should be noted that after determining the position of the first object in the first interface (for ease of understanding, we can call it position A), the electronic device can determine whether the first object can be fully displayed at position A. When it is determined that the first object can be fully displayed at position A, the electronic device can directly merge the first object into position A. When it is determined that the first object cannot be fully displayed at position A, the electronic device can move the content in the first interface so that the first object can be fully displayed at position A, and then merge the first object into position A. For example, when it is determined that there is content at position A, or when it is determined that position A is a blank area, but the length of the blank area is less than the target length of the first object or the width of the blank area is less than the target width of the first object, the electronic device can determine that the first object cannot be fully displayed at position A.
[0222] It should be understood that the embodiments of this application do not limit the specific method by which the electronic device moves the content displayed on the first interface, and can be determined according to the actual scenario. For example, the electronic device can move the content displayed on the first interface by referring to the method in the prior art of moving other icons on the desktop when dragging one icon.
[0223] In some embodiments, when driving actions on real people or animals, the uncanny valley effect can easily occur, resulting in poor animation quality. To improve the animation quality of the first object and enhance the user experience, the first object integrated into the first interface based on the second operation can be a drawing-style object or a cartoon-style object, etc., so that the generated target animation can be cartoonized, reducing the problem of poor visual experience caused by imperfections. The drawing style can include a hand-drawn style.
[0224] In one embodiment, when the first object that the user wants to integrate into the first interface is not a painting-style object or a cartoon-style object, the electronic device can first stylize the first object to convert it into a painting-style object or a cartoon-style object before integrating it into the first interface. After converting the first object into a painting-style object or a cartoon-style object, the electronic device can integrate the converted first object into the first interface.
[0225] It should be understood that stylizing the first object can be done by stylizing the entire image A containing the first object, or it can be done by stylizing only the first object. That is, when it is determined that the first object in image A needs to be merged into the first interface, the electronic device can stylize image A and can obtain the stylized first object from the stylized image A based on the second operation. Alternatively, after obtaining the first object from image A based on the second operation, the electronic device can stylize the first object to obtain the stylized first object.
[0226] It should be noted that the specific time for the electronic device to perform stylization processing on the first object is not limited in the embodiments of this application, and can be determined according to the actual scenario.
[0227] For example, after detecting a selection operation (i.e., selecting a first object from image A), the electronic device can stylize the first object. Specifically, after detecting the selection operation from image A, the electronic device can determine whether the first object is a painting-style object or a cartoon-style image, etc. When it is determined that the first object is a painting-style object or a cartoon-style object, the electronic device can directly integrate the first object into the first interface. When it is determined that the first object is not a painting-style object or a cartoon-style object, the electronic device can stylize image A or the first object to convert image A or the first object into either a painting-style or cartoon-style image, etc. Specifically, after stylizing image A, the electronic device can obtain the stylized first object from the stylized image A and integrate the stylized first object into the first interface. Alternatively, after stylizing the first object, the electronic device can integrate the stylized first object into the first interface.
[0228] For example, after detecting a fusion operation (i.e., fusion of image A to a first interface), the electronic device can perform stylization processing on the first object. That is, after detecting the operation to fuse the first object to the first interface, the electronic device can determine whether the first object is a painting-style object or a cartoon-style image, etc. When it is determined that the first object is a painting-style object or a cartoon-style object, the electronic device can directly fuse the first object to the first interface. When it is determined that the first object is not a painting-style object or a cartoon-style object, the electronic device can perform stylization processing on image A or the first object to convert image A or the first object into either a painting-style or cartoon-style object, etc. Specifically, after stylizing image A, the electronic device can obtain the stylized first object from the stylized image A and fuse the stylized first object to the first interface. Alternatively, after stylizing the first object, the electronic device can fuse the stylized first object to the first interface.
[0229] It should be noted that the embodiments of this application do not limit the specific method by which the electronic device determines whether the first object is a painting-style object or a cartoon-style object, and can be determined according to the actual scenario. Similarly, the embodiments of this application do not limit the specific method by which the electronic device performs stylization processing on image A or the first object to convert image A or the first object into one of the painting style or cartoon style, and can be determined according to the actual scenario.
[0230] For example, an electronic device may be equipped with a pre-trained stable diffusion model. This stable diffusion model can be used to stylize an input image, transforming it into a painting-style image or a cartoon-style image, among other things.
[0231] For example, when an electronic device determines that image A is not a painterly or cartoonish image, it can input image A into a stable diffusion model. The stable diffusion model can then stylize image A to obtain a stylized image A.
[0232] For example, when an electronic device determines that the first object is neither a painterly nor a cartoonish object, it can input the first object (i.e., the local image corresponding to the first object) into a stable diffusion model. The stable diffusion model can then stylize the first object to obtain a stylized first object.
[0233] For example, please refer to Figure 4, which shows an example diagram of a stable diffusion model provided in an embodiment of this application. This example illustrates the use of a stable diffusion model to convert an input image into a painterly image.
[0234] As shown in Figure 4, when the electronic device determines that image A (i.e., image 410 in Figure 4) is neither a painterly nor a cartoonish image, the electronic device can input image 410 into the stable diffusion model 400. Here, image 410 in Figure 4 is neither a painterly nor a cartoonish image; for example, image 410 could be a realistic image. The stable diffusion model 400 can stylize image 410 to obtain a painterly image 420. For example, guided by the image features corresponding to a painterly image, the stable diffusion model 400 can redraw image 410 to obtain a painterly image 420.
[0235] In some embodiments, when it is necessary to merge a first object in image A into a first interface, the electronic device can display interface A including image A, and can also display the first interface, that is, simultaneously display the first interface and interface A, to facilitate the user to merge the first object in image A into the first interface. Specifically, when merging the first object in image A into the first interface, the electronic device can simultaneously display the first interface and interface A. When the electronic device simultaneously displays the first interface and interface A, the user can merge the first object in image A displayed on interface A into the first interface through a second operation.
[0236] For example, when an electronic device simultaneously displays a first interface and interface A, if a user wants to merge an object from image A displayed on interface A into the first interface, the user can long-press the object in image A and drag it to any position on the first interface. Upon detecting the long-press operation and the dragging operation, the electronic device can retrieve the object from image A and merge it into the first interface.
[0237] For example, when an electronic device simultaneously displays a first interface and interface A, if a user wants to merge an object from image A displayed on interface A into the first interface, the user can double-click the object in image A, and can also double-click any location on the first interface. Upon detecting both the double-click operation and the double-click operation on a location on the first interface, the electronic device can retrieve the object from image A and merge it into the first interface for display.
[0238] It should be noted that the embodiments of this application do not limit the specific method by which the electronic device simultaneously displays the first interface and interface A, and can be determined according to the actual scenario. For example, the electronic device can display the first interface and interface A in a split-screen manner. For example, the electronic device can display the first interface in full screen and display interface A through a floating window. For example, the electronic device can display interface A in full screen and display the first interface through a floating window, and so on.
[0239] Please refer to Figures 5 and 6, which illustrate an application scenario provided by an embodiment of this application. This application scenario is illustrated by taking as an example where the first object includes one instance, the second operation includes a long press operation and a drag operation, the first object displayed on the first interface is a cartoon-style object, and the electronic device simultaneously displays the first interface and interface A containing image A.
[0240] As shown in Figure 5(a), an electronic device can simultaneously display a first interface (e.g., the desktop) and interface A (e.g., the gallery interface). For example, the electronic device can display the desktop 510 in full screen and can display the gallery interface 520 through a floating window. The gallery interface 520 may include image A, and image A may include an object 521. The gallery interface 520 may also include a close button, a zoom-out button, and a zoom-in button, as well as related function buttons (e.g., save button, share button, favorite button, edit button, delete button, and a button to view more functions). The close button can be used to close the gallery interface 520. The zoom-out button can be used to zoom out of the gallery interface 520. The zoom-in button can be used to zoom in on the gallery interface 520.
[0241] The desktop 510 can display icons for one or more applications, such as the clock, calendar, gallery, notes, file manager, email, music, calculator, Huawei Video, health, weather, browser, smart living, settings, voice recorder, app store, camera, contacts, phone, and messages.
[0242] As shown in Figure 5(a), when a user wants to merge object 521 in image A into desktop 510, the user can long-press object 521 in image A. As shown in Figure 5(b), after long-pressing object 521, the user can drag object 521 to any position on desktop 510, such as dragging object 521 to the lower right corner of desktop 510.
[0243] In this process, after detecting a long press operation on object 521, the electronic device can extract object 521 from image A using image cutout technology. After extracting object 521, the electronic device can determine whether object 521 is a cartoon-style object. If it is determined that object 521 is not a cartoon-style object, the electronic device can stylize object 521 to convert it into a cartoon-style object 521'. As shown in Figure 5(b), when the user drags object 521, the electronic device can control the cartoon-style object 521' to move with the user's dragging operation.
[0244] When a drag operation is detected to have stopped, the electronic device can blend the cartoon-style object 521' into the desktop 510. For example, as shown in Figure 5(c), the electronic device can blend the cartoon-style object 521' into the position where the drag operation ends on the desktop 510, that is, into the lower right corner of the desktop 510. After blending the cartoon-style object 521' into the desktop 510, the electronic device can automatically close the gallery interface 520 to display the desktop 510 containing the object 521', that is, display the desktop 510 shown in Figure 5(d). Alternatively, the electronic device can close the gallery interface 520 based on the user's click operation on the close button in the gallery interface 520 to display the desktop 510 containing the object 521', that is, display the desktop 510 shown in Figure 5(d).
[0245] Alternatively, as shown in Figure 6(a), when a user wants to merge object 521 in image A into desktop 510, the user can long-press object 521 in image A. As shown in Figure 6(b), after long-pressing object 521, the user can drag object 521 to any position on desktop 510, such as dragging object 521 to the upper right corner of desktop 510.
[0246] In this scenario, after detecting a long press operation on object 521, the electronic device may not retrieve object 521 from image A. At this time, as shown in Figure 6(b), when the user performs a drag operation, the electronic device can control image A containing object 521 to move along with the user's drag operation.
[0247] Upon detecting a stopped drag operation, the electronic device can determine whether object 521 is a cartoon-style object. If it is determined that object 521 is not a cartoon-style object, the electronic device can stylize image A to obtain a cartoon-style image A, and then extract the cartoon-style object 521' from the cartoon-style image A using a matting technique. Alternatively, if it is determined that object 521 is not a cartoon-style object, the electronic device can extract object 521 from image A using a matting technique, and then stylize object 521 to obtain the cartoon-style object 521'.
[0248] After acquiring the cartoon-style object 521', the electronic device can merge the cartoon-style object 521' into the desktop 510. For example, the cartoon-style object 521' can be merged into the end position of the drag operation on the desktop 510, that is, the cartoon-style object 521' can be merged into the upper right corner of the desktop 510.
[0249] As shown in Figure 6(b), the drag operation cannot fully display object 521' at the end position of desktop 510. In this case, the electronic device can move the icons on desktop 510 so that object 521' can be fully displayed at the end position of desktop 510. For example, desktop 510 after moving the icons and merging object 521' can be shown in Figure 6(c). It should be understood that after merging the cartoon-style object 521' into desktop 510, the electronic device can automatically close the gallery interface 520 to display desktop 510 containing object 521', i.e., desktop 510 as shown in Figure 6(d). Alternatively, the electronic device can close the gallery interface 520 based on the user's click of the close button in the gallery interface 520 to display desktop 510 containing object 521', i.e., desktop 510 as shown in Figure 6(d).
[0250] In other embodiments, when it is necessary to merge the first object in image A into the first interface, the electronic device may not display the first interface, but may display the first interface based on a second operation, and may merge the first object into the first interface based on the second operation. That is, the electronic device may display interface A containing image A, or may not display the first interface. When displaying interface A, the user can merge the first object in image A displayed on interface A into the first interface through the second operation. The electronic device may display the first interface based on the second operation, and may merge the first object into the first interface based on the second operation.
[0251] In one embodiment, when the electronic device displays interface A, it can also display the icon corresponding to the application to which the first interface belongs (hereinafter referred to as application A). When the electronic device detects a second operation on the first object in image A, and the second operation also acts on the icon corresponding to application A, the electronic device can launch application A and display the interface corresponding to application A, such as displaying the home screen of application A, which can be the first interface. Furthermore, when the second operation is detected, the electronic device can also integrate the first object into the first interface corresponding to application A, so that when the electronic device displays the first interface corresponding to application A, it can display the first object within the first interface.
[0252] For example, when the selection operation is a long press and the merging operation is a drag operation, that is, when the second operation includes a long press to select the first object and a drag operation to merge the first object into the first interface, the electronic device can also display the icon corresponding to application A when displaying interface A containing image A. For example, the electronic device can display the desktop in full screen and display interface A (such as the gallery interface) through a floating window. The desktop can display the icon corresponding to application A, and the gallery interface can display image A. After detecting the operation of long-pressing the first object in image A, the electronic device can extract the first object from image A using image cutout technology. After detecting the operation of dragging the first object to the icon corresponding to application A on the desktop, the electronic device can launch application A and display the home screen corresponding to application A. In addition, after detecting the operation of dragging the first object to the icon corresponding to application A on the desktop, the electronic device can also merge the extracted first object into the home screen corresponding to application A, so that when the electronic device displays the home screen corresponding to application A, it can display the first object in the home screen corresponding to application A.
[0253] In another embodiment, when the electronic device displays interface A, it can detect a second operation on a first object in image A. Upon detecting the second operation on the first object in image A, the electronic device can display an icon corresponding to application A. After displaying the icon corresponding to application A, if it detects that the second operation is still applied to the icon, the electronic device can launch application A and display the home screen corresponding to application A, which can be the first interface. Furthermore, upon detecting the second operation, the electronic device can also integrate the first object into the home screen corresponding to application A, so that when the electronic device displays the home screen corresponding to application A, it can display the first object within the home screen corresponding to application A.
[0254] It should be noted that the embodiments of this application do not limit the way the electronic device displays the icon corresponding to application A based on the second operation, and can be determined according to the actual scenario. For example, when a second operation on the first object in image A is detected, the electronic device can display the icon corresponding to application A through a pop-up window or pop-up box.
[0255] For example, when both the selection and merging operations are double-click operations—that is, when the second operation includes a first double-click to select the first object and a second double-click to merge the first object into the first interface—the electronic device may not display the icon corresponding to application A when displaying interface A containing image A. Specifically, after detecting a double-click operation on the first object in image A, the electronic device can display the icon corresponding to application A through a pop-up window or dialog box. After detecting a double-click operation on the icon corresponding to application A, the electronic device can launch application A and display its corresponding home screen. Alternatively, after detecting a double-click operation on the first object in image A or a double-click operation on the icon corresponding to application A, the electronic device can use image matting technology to extract the first object from image A and merge the extracted first object into the home screen corresponding to application A, so that the electronic device can display the first object within the home screen corresponding to application A.
[0256] For example, when an electronic device launches application A based on a user's second operation and displays the home screen corresponding to application A, the electronic device can automatically close the first screen displaying image A to facilitate the display of the home screen corresponding to application A, thereby facilitating the display of the first object in the home screen corresponding to application A and enhancing the interest of the home screen corresponding to application A.
[0257] It should be noted that when the electronic device displays the first interface based on the second operation, the position of the first object on the first interface can be a preset position, or it can be determined based on the blank area of the first interface. The specific details of the preset position can refer to the aforementioned content regarding the preset position when the electronic device simultaneously displays the first interface and interface A; for the sake of simplicity, it will not be repeated here. Similarly, the specific details of determining the position of the first object on the first interface based on the blank area of the first interface can refer to the aforementioned content regarding determining the position of the first object on the first interface based on the blank area of the first interface when the electronic device simultaneously displays the first interface and interface A; for the sake of simplicity, it will not be repeated here.
[0258] Please refer to Figure 7, which illustrates a second application scenario provided by an embodiment of this application. This application scenario is illustrated by taking an example where the first object includes one object, the second operation includes a long press operation and a drag operation, and the first object displayed on the first interface is a cartoon-style object.
[0259] As shown in Figure 7(a), the electronic device can display the desktop 710 in full screen and can display a gallery interface 720 via a floating window. The gallery interface 720 can display image A, which may include an object 721. The gallery interface 720 may also include a close button, a zoom-out button, and a zoom-in button, as well as related function buttons (such as a save button, share button, favorite button, edit button, delete button, and a button to view more functions). The close button can be used to close the gallery interface 720. The zoom-out button can be used to zoom out of the gallery interface 720. The zoom-in button can be used to zoom in on the gallery interface 720.
[0260] The desktop 710 can display icons for one or more applications. For example, it can display icons for the camera (711), as well as icons for the clock, calendar, gallery, memo, file manager, calculator, Huawei Video, browser, Smart Life, settings, voice recorder, app store, contacts, phone, and messages, etc.
[0261] As shown in Figure 7(a), when a user wants to merge object 721 in image A into the camera's preview interface, the user can long-press object 721 in image A. As shown in Figure 7(b), after long-pressing object 721 in image A, the user can drag object 721 to the camera's corresponding icon 711.
[0262] Upon detecting a long press on object 721, the electronic device can extract object 721 from image A using image cutout technology. After extracting object 721, the electronic device can determine whether object 721 is a cartoon-style object. If it is determined that object 721 is not a cartoon-style object, the electronic device can stylize object 721 to convert it into a cartoon-style object 721'. As shown in Figure 7(b), when the user drags object 721 to the camera icon 711, the electronic device can control the cartoon-style object 721' to move with the user's dragging action.
[0263] As shown in Figure 7(c), after detecting that the cartoon-style object 721' has been dragged to the camera icon 711, the electronic device can activate the camera and display the camera's preview interface 730 in full screen. When displaying the camera's preview interface 730, the electronic device can integrate the cartoon-style object 721' into the preview interface 730. For example, the electronic device can integrate the cartoon-style object 721' into the center of the preview interface 730. After activating the camera, the electronic device can automatically close the gallery interface 720 to display the preview interface 730 containing the object 721'.
[0264] It should be understood that the center position of the preview interface 730 can refer to the center position on the horizontal axis of the preview interface 730. The preview interface 730 may display buttons corresponding to the relevant shooting modes. For example, it may display buttons for aperture mode, night scene mode, portrait mode, photo mode, video mode, professional mode, and buttons for viewing more shooting modes, etc.
[0265] Please refer to Figure 8, which illustrates a third application scenario provided by an embodiment of this application. This application scenario is illustrated by taking an example where the first object includes one object, the second operation includes a long press operation and a drag operation, and the first object displayed on the first interface is a cartoon-style object.
[0266] As shown in Figure 8(a), the electronic device can display a full-screen gallery interface 820. The gallery interface 820 can display image A, which may include an object 821. The gallery interface 820 may also include related function buttons (such as save, share, favorite, edit, delete, and view more functions buttons). When the user wants to merge object 821 from image A into the camera's corresponding preview interface 810, the user can long-press on object 821 in image A. As shown in Figure 8(b), after long-pressing object 821 in image A, the user can drag object 821.
[0267] In this scenario, after detecting a long press operation on object 821, the electronic device may not retrieve object 821 from image A. At this time, as shown in Figure 8(b), when the user performs a drag operation on object 821, the electronic device can control image A containing object 821 to move along with the user's drag operation.
[0268] As shown in Figure 8(b), when dragging object 821, the electronic device can display one or more application icons via a side pop-up 830. For example, the electronic device can display the camera icon 831, as well as icons for memos, email, file management, browser, and messages via the side pop-up 830.
[0269] As shown in Figure 8(c), after displaying the camera icon 831, the user can continue to drag the object 821 to the camera icon 831. While the user continues to drag the object 821 to the camera icon 831, the electronic device can control the image A containing the object 821 to move accordingly. That is, the electronic device can control the image A containing the object 821 to move to the camera icon 831 as the user drags it.
[0270] As shown in Figure 8(d), after detecting that the dragged object 821 is moved to the icon 831 corresponding to the camera, the electronic device can start the camera and display the preview interface 810 corresponding to the camera in full screen.
[0271] Additionally, after detecting that object 821 has been dragged to the camera's corresponding icon 831, the electronic device can extract object 821 from image A using a keying technique. After extracting object 821, the electronic device can determine whether object 821 is a cartoon-style object. If it is determined that object 821 is not a cartoon-style object, the electronic device can stylize object 821 to convert it into a cartoon-style object 821'.
[0272] When displaying the camera-related preview interface 810, the electronic device can integrate the cartoon-style object 821' into the camera-related preview interface 810 to display the object 821' on the camera-related preview interface 810. For example, the electronic device can integrate the cartoon-style object 821' into the center of the preview interface 810. After activating the camera, the electronic device can close the gallery interface 820 to display the preview interface 810 containing the object 821', i.e., the electronic device can display the preview interface 810 shown in Figure 8(d).
[0273] It should be understood that the center position of the preview interface 810 can refer to the center position on the horizontal axis of the preview interface 810. The preview interface 810 may display buttons corresponding to the relevant shooting modes. For example, it may display buttons for aperture mode, night scene mode, portrait mode, photo mode, video mode, professional mode, and buttons for viewing more shooting modes, etc.
[0274] In another embodiment, when the electronic device displays an image A containing the first object, the electronic device may also display a button that can process image A. For example, a button (hereinafter referred to as button A) that generates a stylized first object based on image A may be displayed. When the second operation includes a click operation on button A, that is, when the electronic device displays an image A containing the first object, upon detecting a click operation on button A, the electronic device can obtain the first object from image A and can stylize the first object to obtain a stylized first object.
[0275] For example, before or after detecting a click on button A, the electronic device can extract a first object from image A based on the user's selection action (i.e., a long press, selection box operation, or double-click operation on an object in image A), and can then stylize the first object to obtain a stylized first object. It should be understood that when image A contains only one object, the electronic device can also directly extract the first object from image A based on the click on button A, and then stylize the first object to obtain a stylized first object.
[0276] After obtaining the stylized first object, the electronic device can display the stylized first object. For example, the electronic device can display the stylized first object on interface A or on a new interface (hereinafter referred to as interface B for ease of understanding). Interface B can be displayed in full screen, or interface B and interface A can be displayed in a split-screen manner, or interface B can be displayed on top of interface A as a floating window, and so on.
[0277] When displaying a stylized first object, the electronic device may also display a button (hereinafter referred to as Button B) that integrates the stylized first object into a certain interface. When the second operation also includes a click operation on Button B, that is, when a click operation on Button B is detected while displaying the stylized first object, the electronic device may display one or more selection buttons. Alternatively, after displaying the stylized first object, when the second operation also includes a selection operation on the stylized first object, that is, when a selection operation on the stylized first object is detected (e.g., long press, selection box, or double-click), the electronic device may display one or more selection buttons. Each selection button can be used to indicate that the stylized first object is integrated into a corresponding interface (hereinafter referred to as Interface C). Interface C can be an interface that integrates the first object. For example, Interface C may include the desktop, lock screen, or an interface corresponding to a specific application, etc.
[0278] When the second operation also includes clicking a selection button, that is, when a click on a selection button is detected, the electronic device can determine the interface C corresponding to that selection button as the first interface and can integrate the stylized first object into the first interface. For example, when the selected interface C is the desktop, the electronic device can integrate the stylized first object into the desktop. For example, when the selected interface C is the lock screen, the electronic device can integrate the stylized first object into the lock screen. For example, when the selected interface C is the camera preview interface, the electronic device can integrate the stylized first object into the camera preview interface, and so on.
[0279] For example, after the stylized first object is integrated into the first interface, the electronic device can display the first interface. That is, after the stylized first object is integrated into the first interface, the electronic device can exit the display of interface A or interface B and automatically display the first interface containing the first object.
[0280] For example, interface A and interface B can be the interfaces corresponding to the theme application.
[0281] It should be noted that, in this embodiment, the position of the first object in the first interface can be a preset position, or it can be determined based on the blank area in the first interface. The specific details of the preset position can refer to the relevant content regarding preset positions when the aforementioned electronic device simultaneously displays the first interface and interface A. Similarly, the specific details of determining the position of the first object in the first interface based on the blank area in the first interface can refer to the relevant content regarding determining the position of the first object in the first interface based on the blank area in the first interface when the aforementioned electronic device simultaneously displays the first interface and interface A; for the sake of simplicity, these details will not be repeated here.
[0282] Please refer to Figure 9, which illustrates the fourth application scenario provided in this application embodiment. This application scenario is illustrated by taking as an example an object whose first object comprises a single object, interface A as the theme application's corresponding interface, and the first object displayed on the first interface being a cartoon-style object.
[0283] As shown in Figure 9(a), the electronic device can display the home screen 910 corresponding to the theme application. The home screen 910 can display a button 920 corresponding to the custom theme. It should be understood that the home screen 910 can also display other theme content. For example, the home screen 910 can also display a function menu, which may include one or more menu items, such as menu items corresponding to "Theme," "Service Card," "Wallpaper," and "Font." For example, the home screen 910 can also display theme-related activities, theme recommendations (e.g., SS, RR, and WW), and a theme-related search box.
[0284] As shown in Figure 9(a), when a user wants to customize a theme, the user can click the button 920 corresponding to the theme customization. After detecting the click operation on the button 920, the electronic device can display the image selection button 930. For example, as shown in Figure 9(b), the electronic device can display the image selection button 930 through a pop-up window 940. The user can select an image based on the image selection button 930 in the pop-up window 940 to customize the theme based on the selected image. That is, the user can click the image selection button 930 in the pop-up window 940 to select an image.
[0285] As shown in Figure 9(c), after the user selects an image (e.g., image A), the electronic device can display image A. While displaying image A, the electronic device can also display buttons for processing image A. For example, the electronic device can display a button 951 for "Generate My Pet" and an application button 952. The "Generate My Pet" button 951 can instruct the electronic device to generate a stylized pet based on objects in image A. The application button 952 can instruct the electronic device to set image A as its theme. The user can click the "Generate My Pet" button 951 to generate a pet based on image A, that is, to generate a stylized first object based on objects in image A.
[0286] When the electronic device detects a click on the "Generate My Pet" button 951, it can obtain a first object from image A and stylize the first object to obtain a cartoon-style first object 960. This cartoon-style first object 960 can then be the generated pet.
[0287] As shown in Figure 9(d), after obtaining the cartoon-style first object 960, the electronic device can display the cartoon-style first object 960. Figure 9(d) illustrates this by showing the cartoon-style first object 960 on a new interface B, with the electronic device displaying interface B in full screen. While displaying the cartoon-style first object 960, the electronic device can also display a merge button 970 to integrate the cartoon-style first object 960 into a certain interface. When the user wants to integrate the cartoon-style first object 960 into a certain interface, the user can click the merge button 970.
[0288] As shown in Figure 9(e), when a click on the merge button 970 is detected, the electronic device can display one or more selection buttons. For example, the electronic device can display selection button 981 corresponding to the desktop, selection button 982 corresponding to the lock screen, and selection button 983 corresponding to the camera interface via a pop-up window 980. The user can select the selection button corresponding to the interface to which the cartoon-style first object 960 needs to be merged, according to actual needs. For example, as shown in Figure 9(e), when the user wants to merge the cartoon-style first object 960 to the desktop, the user can click the selection button 981 corresponding to the desktop. When the electronic device detects a click on the selection button 981 corresponding to the desktop, it can merge the cartoon-style first object 960 to the desktop. For example, as shown in Figure 9(f), the electronic device can merge the cartoon-style first object 960 to the upper right corner of the desktop.
[0289] In this embodiment, after the first object is integrated into the first interface, when the electronic device displays the first interface, the first object in the first interface can respond to the user's operation and perform relevant actions to improve the user's interactive experience. That is, after the first object is integrated into the first interface, when the electronic device displays the first interface containing the first object, upon detecting the user's first operation, the electronic device can determine target action data based on the first operation and generate a target animation corresponding to the first object based on the target action data, so that the first object can respond to the user's first operation.
[0290] The process by which S303 and electronic devices determine target motion data based on the first operation will be described in detail below.
[0291] In some embodiments, an electronic device or other device communicatively connected to the electronic device may store a preset correspondence between operations and actions (for ease of understanding, this can be referred to as preset correspondence B; the following will use the storage of preset correspondence B in the electronic device as an example for illustrative purposes). After acquiring a first operation, the electronic device can determine the action to be performed by the first object (for ease of understanding, this can be referred to as the target action) based on the first operation and preset correspondence B, and determine the target action data based on the target action. That is, the target action data can be used to instruct the first object to perform the target action. The target action data can be used to determine the positional changes of multiple skeletal points when the first object performs the target action; that is, the target action data can be used to determine the target positions corresponding to each skeletal point of the first object when the first object performs the target action, so as to control the first object to perform the target action based on the target positions corresponding to each skeletal point of the first object. A single skeletal point can correspond to one or more target positions. When a single skeletal point corresponds to multiple target positions, these multiple target positions can constitute a time series of target positions. A skeletal point can refer to a key connection point in the skeletal system of an object such as a human or animal.
[0292] It should be noted that the preset correspondence B can be determined according to the actual scenario, and this application embodiment does not impose any restrictions on it. The preset correspondence B can be a one-to-one correspondence, a one-to-many correspondence, a many-to-one correspondence, or a many-to-many correspondence. This application embodiment does not impose any specific restrictions on it and can determine it according to the actual scenario. A one-to-one correspondence can be one operation corresponding to one type of action. A one-to-many correspondence can be one operation corresponding to multiple types of actions. A many-to-one correspondence can be multiple operations corresponding to one type of action, and a many-to-many correspondence can be multiple operations corresponding to multiple types of actions.
[0293] For example, the preset correspondence B may include the operation of clicking the first interface corresponding to walking and jumping actions, the operation of clicking the icon corresponding to the music application corresponding to dancing actions, the operation of dragging the target display element on the first interface corresponding to dodging actions, the operation of operating the cat toy corresponding to the head turning action of the first object (e.g., the cat), and the operation of clicking the hand of the first object and dragging the hand of the first object corresponding to waving actions, and so on.
[0294] Specifically, when the first operation is clicking on the first interface, the electronic device, based on the first operation and the preset correspondence B, can determine that the target action to be performed by the first object includes walking and jumping. When the first operation is clicking on the icon corresponding to a music application, the electronic device, based on the first operation and the preset correspondence B, can determine that the target action to be performed by the first object includes dancing. When the first operation is dragging a target display element on the first interface, the electronic device, based on the first operation and the preset correspondence B, can determine that the target action to be performed by the first object includes dodging. In a scenario where the first object is a cat, when the first operation is based on a cat toy, the electronic device, based on the first operation and the preset correspondence B, can determine that the target action to be performed by the first object includes head turning. In a scenario where the first object includes a hand, when the first operation includes clicking on the first object's hand and then dragging the hand after clicking, the electronic device, based on the first operation and the preset correspondence B, can determine that the target action to be performed by the first object includes waving, and so on.
[0295] In one embodiment, after determining the target action to be performed by the first object based on the first operation and the preset correspondence relationship B, the electronic device can directly determine the position changes corresponding to each skeletal point of the first object based on the target action and the constraint relationship between the skeletal points.
[0296] For example, after determining the first object, the electronic device can mark the first object with skeletal points and determine the constraint relationships between the skeletal points. After determining the target action, the electronic device can determine the target skeletal point corresponding to the first object based on the skeletal points corresponding to the first object, the constraint relationships between the skeletal points, and the target action, and determine the positional changes corresponding to the target skeletal point. Based on the positional changes of the target skeletal point and the positions of other skeletal points, the electronic device can control the first object to perform the target action. The target skeletal point corresponding to the first object may include one or more of the skeletal points of the first object. The target skeletal point corresponding to the first object may refer to a skeletal point in the first object whose position changes when the first object performs the target action.
[0297] It should be understood that the specific method by which the electronic device marks the skeletal points of the first object is not limited in the embodiments of this application, and can be determined according to the actual scenario. Furthermore, the constraint relationships between skeletal points can also be determined based on existing technology, and the embodiments of this application do not limit this. For example, changes in the lower leg can generally lead to changes in the thigh, changes in the forearm can generally lead to changes in the upper arm, changes in the head can generally lead to changes in the neck, and so on. That is, there can be a constraint relationship between the skeletal points corresponding to the lower leg and the skeletal points corresponding to the thigh, a constraint relationship can exist between the skeletal points corresponding to the forearm and the upper arm, a constraint relationship can exist between the skeletal points corresponding to the head and the skeletal points corresponding to the neck, and so on.
[0298] It should be noted that the embodiments of this application do not limit the specific method by which the electronic device determines the target skeletal points corresponding to the first object and the positional changes of the target skeletal points based on the constraint relationship between the target action and the skeletal points. The method can be determined according to the actual scenario. For example, when the target action is determined to be a head rotation action, the electronic device can determine, based on the constraint relationship between the target action and the skeletal points, that the target skeletal points include the skeletal points of the head and the neck, and can determine that the positional changes of each target skeletal point are the positional changes of each target skeletal point when the head rotates at a preset angle. For example, when the target action is determined to be a waving action, the electronic device can determine, based on the constraint relationship between the target action and the skeletal points, that the target skeletal points include the skeletal points of the hand, the forearm, and the upper arm, and can determine that the positional changes of each target skeletal point are the positional changes of each target skeletal point when the hand is raised to a preset height and swung with a preset amplitude. It should be understood that the preset angle, preset height, and preset amplitude can be specifically determined according to the actual scenario, and the embodiments of this application do not limit this.
[0299] For example, when the first object is a cat, and the operation of a cat toy causes the cat's head to turn towards the toy, when the electronic device detects that the first operation is operating the cat toy, it can determine that the target action to be performed by the first object is a head turn. At this point, the electronic device can acquire information about the cat toy (e.g., its position) and determine the angle of the cat's head, i.e., the angle at which the cat's head looks towards the toy, based on this information. After determining the angle of the cat's head, the electronic device can determine the target skeletal points affected by the cat's head turning at that angle, and determine the positional changes of each target skeletal point. Based on these positional changes, the electronic device can control the cat's head rotation, causing the cat's head to change angle accordingly, thus looking towards the cat toy.
[0300] For example, when the first object is an object including a hand, and clicking the hand of the first object, and then dragging the hand after clicking, can cause the first object to perform a waving motion, when the electronic device detects that the first operation includes clicking the hand of the first object and then dragging the hand, the electronic device can determine that the target action to be performed by the first object is a waving motion. At this time, the electronic device can obtain information corresponding to the dragging operation of the hand (e.g., the dragging distance), and can determine the lifting height and swing amplitude of the hand based on the information corresponding to the dragging operation. After determining the lifting height and swing amplitude of the hand, the electronic device can determine the target skeletal points affected when the hand performs the lifting at that height and the swing at that amplitude, and can determine the positional changes of each target skeletal point. Based on the positional changes of each target skeletal point, the electronic device can control the lifting and swinging of the hand to achieve the waving motion.
[0301] It should be understood that the hand-raising height can be a default setting, and / or the hand-swinging amplitude can be a default setting. Alternatively, the hand-raising height and / or hand-swinging amplitude can be determined based on the distance corresponding to the hand-dragging operation. For example, the longer the distance corresponding to the hand-dragging operation, the longer the hand-raising height can be; the shorter the distance corresponding to the hand-dragging operation, the shorter the hand-raising height can be. Similarly, the longer the distance corresponding to the hand-dragging operation, the larger the hand-swinging amplitude can be; the shorter the distance corresponding to the hand-dragging operation, the smaller the hand-swinging amplitude can be.
[0302] In another embodiment, an action database may be provided in the electronic device or other devices communicatively connected to the electronic device. Upon detecting a first operation, the electronic device can determine target action data from the action database based on the first operation. Directly determining the target action data from the action database can improve the accuracy and speed of target action data determination, enhance the accuracy and speed of target animation generation, and improve the user experience. The action database may include preset action data corresponding to multiple actions. That is, each preset action data can be used to indicate an action of a preset duration. The preset duration corresponding to each preset action data may be the same or different, depending on the actual scenario; this embodiment does not impose such limitations. Target action data may include preset action data corresponding to one or more actions (i.e., target actions). The number of preset action data corresponding to the target action included in the target action data can be determined based on the actual scenario; this embodiment does not impose such limitations.
[0303] It should be noted that each preset motion data may include the positional changes of each skeletal point when the action indicated by the preset motion data is performed. For example, each preset motion data may include one or more positions corresponding to each skeletal point when the action indicated by the preset motion data is performed. Specifically, for a skeletal point whose position changes when the action indicated by the preset motion data is performed, the preset motion data may include multiple positions corresponding to that skeletal point. For a skeletal point whose position does not change when the action indicated by the preset motion data is performed, the preset motion data may include one position corresponding to that skeletal point. When the preset motion data includes multiple positions corresponding to a single skeletal point, these multiple positions can constitute a temporal sequence of positions.
[0304] It should be understood that the embodiments of this application do not impose specific restrictions on the construction process of the action database, which can be determined according to the actual scenario.
[0305] For example, please refer to Figure 10, which shows an example diagram of the construction action database provided in an embodiment of this application.
[0306] As shown in Figure 10, electronic devices can determine preset motion data based on motion animations designed by designers, and then construct a motion database based on this preset motion data. For example, the motion generation module in the electronic device can determine preset motion data based on motion animations designed by designers. The electronic device can also learn from videos to determine preset motion data based on motion animations within the videos, thereby expanding the motion database. For example, the electronic device can learn from AI models in its artificial intelligence (AI) module to determine preset motion data based on motion animations within the videos. Furthermore, the electronic device can collect existing motion capture data and standardize it to determine preset motion data based on the standardized motion capture data, further expanding the motion database.
[0307] In the motion animation designed by the designer, each action can be labeled with its constituent motion variations, as well as the amplitude and magnitude of these variations. After acquiring the motion animation, the electronic device can determine the motion variations corresponding to each action and, based on these variations, determine the preset motion data for each action, i.e., obtain the positional changes of each skeletal point for each action.
[0308] When determining preset motion data based on motion capture data, electronic devices can standardize the motion capture data to obtain standardized preset motion data. Standardization can include two parts. The first part can be the standardization of components, such as the head, neck, wrist, forearm, upper arm, ankle, calf, thigh, waist, or abdomen. The second part is the standardization of the range of motion and / or direction of motion of each component. That is, after standardizing the components, the range of motion and / or direction of motion of all components can be standardized, making the range of motion of each component controllable, so that each component can change within its reach. In addition, when standardizing the range of motion and / or direction of motion of all components, constraints between components can be established. For example, changes in the calf can lead to changes in the thigh, changes in the forearm can lead to changes in the upper arm, and changes in the head can lead to changes in the neck. That is, constraints can be established between the calf and thigh, between the forearm and upper arm, and between the head and neck, and so on.
[0309] For example, after obtaining the first operation, the electronic device can obtain target action data from the action database according to the first operation and the preset correspondence B.
[0310] For example, when the first operation is clicking on the first interface, the electronic device can determine the target action to be performed by the first object, including walking and jumping, based on the first operation and the preset correspondence B. At this time, the electronic device can obtain the target action data corresponding to the walking action and the target action data corresponding to the jumping action from the preset action data.
[0311] For example, when the first operation is to click the icon corresponding to the music application in the first interface, the electronic device can determine that the target action to be performed by the first object includes a dancing action based on the first operation and the preset correspondence B. At this time, the electronic device can obtain the target action data corresponding to the dancing action from the preset action data.
[0312] For example, when the first operation is to drag a target display element on the first interface, the electronic device can determine the target action that the first object needs to perform, including an evasion action, based on the first operation and the preset correspondence B. At this time, the electronic device can obtain the target action data corresponding to the evasion action from the preset action data.
[0313] In one possible implementation, after acquiring the first operation, the electronic device can determine the duration of the action to be performed by the first object, and can retrieve target action data from the action database based on the first operation, a preset correspondence, and the action duration. That is, the electronic device can determine the target action to be performed by the first object based on the first operation and the preset correspondence B, and can retrieve the target action data corresponding to the target action from the action database based on the action duration and the target action. The duration of the target action indicated by the target action data can be greater than or equal to the duration of the action to be performed by the first object, enabling the first object to perform the target action, and ensuring that the duration of the first object performing the target action reaches that duration.
[0314] For example, when the target action is determined to be a dance action, and the duration of the action to be performed by the first object is determined to be 5 seconds, the electronic device can retrieve target action data corresponding to at least 5 seconds of dance actions from the action database based on the action duration and the target action, so that the first object can perform a dance action for at least 5 seconds based on the target action data. For example, the electronic device can retrieve 2 seconds of preset action data A1 and 3 seconds of preset action data A2 from the action database. The actions indicated by preset action data A1 and preset action data A2 are both dance actions, thus obtaining the target action data corresponding to a 5-second dance action (i.e., preset action data A1 and preset action data A2). For example, the electronic device can retrieve 3 seconds of preset action data A2 and 3 seconds of preset action data A3 from the action database. The actions indicated by preset action data A2 and preset action data A3 are both dance actions, thus obtaining the target action data corresponding to a 6-second dance action (i.e., preset action data A2 and preset action data A3).
[0315] For example, the duration of the action to be performed by the first object can be set by the electronic device by default or by the user. The duration of the action to be performed by the first object can be the same or different for different target actions. For example, the electronic device can uniformly set the action duration to 3 seconds. For example, for a dancing action, the user can customize the action duration to 5 seconds. For example, for a walking action, the user can customize the action duration to 2 seconds. For example, for a jumping action, the user can customize the action duration to 3 seconds, and so on.
[0316] For example, the duration of the action to be performed by the first object can be determined based on the first operation. For instance, an electronic device can determine the duration of the action to be performed by the first object based on the duration of the first operation and / or the distance traveled. Specifically, the longer the duration of the first operation, the longer the duration of the action to be performed by the first object; conversely, the shorter the duration of the first operation, the shorter the duration of the action to be performed by the first object. Similarly, the longer the distance traveled by the first operation, the longer the duration of the action to be performed by the first object; and the shorter the distance traveled by the first operation, the shorter the duration of the action to be performed by the first object.
[0317] For example, when the first operation includes a drag operation, the electronic device can determine the duration of the drag operation and, based on that duration, determine the duration of the action to be performed by the first object. Specifically, the longer the duration of the drag operation, the longer the duration of the action the electronic device determines the first object can perform; conversely, the shorter the duration of the drag operation, the shorter the duration of the action the electronic device determines the first object can perform. Alternatively, the electronic device can determine the distance traveled during the drag operation and, based on that distance, determine the duration of the action to be performed by the first object. Again, the longer the distance traveled during the drag operation, the longer the duration of the action the electronic device determines the first object can perform; and the shorter the distance traveled during the drag operation, the shorter the duration of the action the electronic device determines the first object can perform.
[0318] The process by which S304 and the electronic device generate the target animation corresponding to the first object based on the target motion data and the skeletal points of the first object will be explained in detail below.
[0319] In this embodiment, the target motion data may include the position changes of each skeletal point during the execution of the target motion, that is, one or more positions corresponding to each skeletal point during the execution of the target motion. After determining the target motion data, the electronic device can map the positions corresponding to each skeletal point in the target motion data to each skeletal point of the first object to determine the target positions corresponding to each skeletal point of the first object. After determining the target positions corresponding to each skeletal point of the first object, the electronic device can generate a target animation corresponding to the first object based on the target positions corresponding to each skeletal point.
[0320] For example, the electronic device can obtain the initial positions of each skeletal point of the first object, that is, the positions of each skeletal point of the first object when the first object is not performing the target action indicated by the target action data. After determining the target action data, that is, after determining the target positions of each skeletal point of the first object, the electronic device can generate the target animation corresponding to the first object based on the initial and target positions of each skeletal point. In other words, the electronic device can determine the position changes of each skeletal point of the first object based on the target action data, and can adjust the positions of each skeletal point based on the position changes to generate the target animation corresponding to the first object.
[0321] For example, an electronic device can adjust the positions of the bones of a first object based on the initial positions of each bone point and the target positions of each bone point in the first frame of the target motion indicated by the target motion data, to generate the first frame of motion animation corresponding to the first object. Subsequently, the electronic device can adjust the positions of the bones of the first object based on the target positions of each bone point in the second frame of the target motion indicated by the target motion data and the target positions of each bone point in the first frame of the target motion, to generate the second frame of motion animation corresponding to the first object. Then, the electronic device can adjust the positions of the bones of the first object based on the target positions of each bone point in the third frame of the target motion indicated by the target motion data and the target positions of each bone point in the second frame of the target motion, to generate the third frame of motion animation corresponding to the first object, and so on, until the electronic device determines the last frame of motion animation corresponding to the first object based on the target positions of each bone point in the last frame of the target motion indicated by the target motion data and the target positions of each bone point in the frame preceding the last frame of the target motion. The first frame of motion animation to the last frame of motion animation corresponding to the first object can be considered as the target animation corresponding to the first object.
[0322] For example, the electronic device can determine the target bone points whose positions will change among the bone points of the first object based on the target motion data, and adjust the position of the target bone points according to the position changes of the target bone points. For bone points whose positions do not change in the first object, the electronic device may not adjust the position of the bone points, thereby generating the target animation corresponding to the first object.
[0323] It should be noted that the embodiments of this application do not limit the specific process by which the electronic device generates each frame of motion animation corresponding to the first object based on the initial and target positions corresponding to the skeletal points, and can be determined according to the actual scenario. For example, the electronic device can generate each frame of motion animation corresponding to the first object based on the initial and target positions corresponding to each skeletal point using skeletal animation technology.
[0324] For example, an electronic device can use a component-based decomposition method to break down a first object into bones and skin (e.g., texture), and can bind the bones and textures. After determining the initial and target positions corresponding to each bone point, the electronic device can convert the changes from the initial to the target position of each bone point into changes such as rotation, translation, and / or scaling of the texture according to the binding relationship between the bones and the texture. The electronic device can then render the rotated, translated, and / or scaled texture to obtain the motion animation for each frame corresponding to the first object.
[0325] For example, an electronic device can use an ARAP (As Rigid as Possible) algorithm to generate animation for each frame of a first object. That is, the electronic device can mesh the first object, resulting in a meshed first object. For instance, the electronic device can mesh the first object into a triangular mesh. After meshing the first object, each skeletal point of the first object can be enclosed by a certain area of mesh. When the position of a skeletal point changes, it causes the corresponding vertex position of the mesh to change, and this change in the vertex position of the mesh enables the first object to achieve dynamic effects. Therefore, the electronic device can determine the change in the vertex position of the mesh based on the initial and target positions of each skeletal point of the first object, and thus generate animation for each frame of the first object based on the change in the vertex position of the mesh.
[0326] In some embodiments, the electronic device may also acquire depth information corresponding to the first object and generate target animation corresponding to the first object based on target motion data, depth information and each skeletal point of the first object.
[0327] For example, when displaying a first image containing a first object, the electronic device can also determine the depth information corresponding to the first object based on the first image, and generate a target animation corresponding to the first object based on the target motion data, the depth information and each skeletal point of the first object.
[0328] It should be noted that the depth information corresponding to the first object can include the Z-axis information of each skeletal point of the first object. Additionally, the electronic device can determine the X-axis and Y-axis information of each skeletal point of the first object based on the first image. After determining the depth information corresponding to the first object, the electronic device can construct a three-dimensional (3D) model of the first object based on this depth information. That is, it can construct the 3D information of the first object based on its X-axis and Y-axis information, as well as its depth information (i.e., its Z-axis information). For example, it can construct the 3D coordinates (XYZ coordinates) of each skeletal point of the first object. This allows for transformation of the first object based on the depth information, simulating a 3D image and giving the generated target animation a sense of depth, thus improving the user experience.
[0329] It should be understood that the embodiments of this application do not limit the specific method by which the electronic device determines the depth information corresponding to the first object based on the first image, and can be determined according to the actual scenario. For example, the electronic device can determine the depth information corresponding to the first object using AI algorithms or traditional vision algorithms. In addition, the above-described method of the electronic device determining the depth information corresponding to the first object based on the first image is only an exemplary explanation and should not be construed as a limitation on the embodiments of this application. In the embodiments of this application, the depth information corresponding to the first object can also be determined by other methods.
[0330] In one embodiment, the electronic device can determine whether the first object needs to rotate based on the target motion data, such as whether the first object needs to turn around. When it is determined that the first object needs to rotate, that is, when the target action to be performed by the first object includes a rotation action, the electronic device can generate a target animation corresponding to the first object based on the depth information, the target motion data, and each skeletal point of the first object. By combining the depth information to generate the target animation corresponding to the first object, the first object can present a three-dimensional effect when performing rotation actions such as turning around, providing the user with a better three-dimensional effect.
[0331] For example, when it is determined that a first object needs to rotate based on target motion data, the electronic device can determine the corresponding rotation angle of the first object, i.e., the angle at which the first object needs to rotate, based on the target motion data. For instance, the electronic device can determine the corresponding rotation angle of the first object based on the initial position and target position (i.e., the target position indicated by the target motion data) of each bone point of the first object. After determining the rotation angle of the first object, the electronic device can determine the rotation matrix of the first object based on the rotation angle, and can generate the target animation corresponding to the first object based on the target motion data, the rotation matrix, and the 3D information corresponding to the first object.
[0332] It should be noted that the embodiments of this application do not impose specific limitations on the process by which the electronic device generates the target animation corresponding to the first object based on the target motion data, the rotation matrix, and the 3D information corresponding to the first object. This process can be determined according to the actual scenario. For example, when generating the target animation corresponding to the first object based on the target motion data, the electronic device can determine the 3D coordinates of each bone point of the first object after rotation based on the rotation matrix and the initial 3D coordinates of each bone point. Furthermore, it can determine the positional changes of each bone point based on the 3D coordinates after rotation, thereby generating the target animation corresponding to the first object based on the positional changes of each bone point. The initial 3D coordinates of the bone points can refer to the 3D coordinates of the bone points when the first object has not performed the target motion indicated by the target motion data (e.g., a rotation motion).
[0333] For example, the first object can typically be a rotation around the X-axis. That is, the electronic device can determine the rotation angle corresponding to the rotation of the first object around the X-axis (i.e., the angle that the first object needs to rotate around the X-axis) based on the target motion data, and determine the rotation matrix corresponding to the first object based on the rotation angle corresponding to the rotation of the first object around the X-axis. Thus, based on the target motion data, the rotation matrix, and the 3D information corresponding to the first object, the target animation corresponding to the first object can be generated.
[0334] For example, the rotation matrix corresponding to the rotation of the first object around the X-axis can be: θ is the rotation angle corresponding to the rotation of the first object around the X-axis.
[0335] For example, the 3D coordinates of any bone point (e.g., bone point A) of the first object after rotation can be:
[0336] Where (x',y',z') are the 3D coordinates of bone point A after rotation, and (x,y,z) are the initial 3D coordinates of bone point A.
[0337] In some embodiments, when an electronic device displays a first interface containing a first object, the electronic device can control one or more target display elements on the first interface to perform related actions based on the user's operation on the first object. The target display elements can be any element displayed on the first interface, such as an icon, card, or window. For example, when a user drags the first object, the electronic device can highlight one or more target display elements on the first interface to prompt the user to drag the first object onto any of the highlighted target display elements. Upon detecting that the first object has been dragged onto any of the highlighted target display elements (e.g., target display element A), the electronic device can merge the first object into target display element A, or into the interface corresponding to target display element A, to display the first object in target display element A or the interface corresponding to target display element A.
[0338] In one embodiment, when the first object is detected to be dragged to the target display element A, if the target display element A does not display a related interface, for example, when the target display element A is an icon corresponding to an application, the electronic device can launch the application corresponding to the target display element A, display the interface corresponding to the application, and merge the first object into the interface corresponding to the application so that the first object is displayed in the interface corresponding to the target display element A.
[0339] It should be noted that the embodiments of this application do not limit the specific method by which the electronic device highlights the target display element, and can be determined according to the actual scenario. For example, the target display element can be highlighted by flashing, or by adding a halo effect around the target display element, etc.
[0340] Furthermore, when dragging the first object, the target display element highlighted by the electronic device can be a display element that can integrate the first object into the target display element or the interface corresponding to the target display element. The display element that can integrate the first object into the target display element or the interface corresponding to the target display element can be specifically determined according to the actual scenario, and this application embodiment does not impose any limitations on it.
[0341] For example, when the first interface is the desktop, it can display the first object, and it can also display icons for multiple applications, such as the clock, camera, notes, gallery, music, calculator, health, weather, browser, smart living, Huawei video, voice recorder, and app store. Assume the first object can be integrated into the camera's interface or the music's interface.
[0342] When the electronic device detects an action of dragging the first object, it can highlight the icons corresponding to the camera and the music. When it detects that the first object has been dragged to the camera's icon, the electronic device can activate the camera, display the camera's preview interface, and merge the first object into the camera's preview interface so that the first object is displayed in the camera's preview interface.
[0343] Similarly, when the electronic device detects that the first object has been dragged to the icon corresponding to the music, it can start the music, display the home screen corresponding to the music, and merge the first object into the home screen corresponding to the music so that the first object is displayed in the home screen corresponding to the music.
[0344] It should be noted that when merging the first object into target display element A (or the interface corresponding to target display element A), the position of the first object in target display element A (or the position in the interface corresponding to target display element A) can be a preset position, or it can be determined based on the blank area in target display element A (or the blank area in the interface corresponding to target display element A). The specific details of the preset position can refer to the relevant content regarding preset positions when the electronic device simultaneously displays the first interface and interface A. Similarly, the specific details of determining the position of the first object in target display element A based on the blank area in target display element A, and determining the position of the first object in the interface corresponding to target display element A based on the blank area in the interface corresponding to target display element A, can refer to the relevant content regarding determining the position of the first object in the first interface based on the blank area in the first interface when the electronic device simultaneously displays the first interface and interface A. For the sake of simplicity, these details will not be elaborated upon here.
[0345] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0346] Corresponding to the animation generation method described in the above embodiments, this application also provides an animation generation apparatus, the various modules of which can correspondingly implement the various steps of the animation generation method.
[0347] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0348] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0349] This application also provides an electronic device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor. When the processor executes the computer program, it causes the electronic device to perform the steps in any of the above-described method embodiments. For example, the structure of the electronic device may be as shown in FIG1.
[0350] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a computer, causes the computer to perform the steps in any of the above method embodiments.
[0351] This application provides a computer program product that, when run on an electronic device, causes the electronic device to perform the steps in any of the above method embodiments.
[0352] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include at least: any entity or device capable of carrying computer program code to a device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0353] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0354] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0355] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0356] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0357] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An animation generation method, characterized in that, Applied to electronic devices, the method includes: Display a first interface, the first interface including a first object, the first object including multiple skeletal points; The first step is detection; Based on the first operation, target action data is determined, and the target action data is used to indicate the target action to be performed by the first object; Based on the target motion data and each skeletal point of the first object, a target animation corresponding to the first object is generated; in the target animation, the first object performs the target motion indicated by the target motion data.
2. The method according to claim 1, characterized in that, The target motion data is used to determine the positional changes of the plurality of skeletal points when the first object performs the target motion.
3. The method according to claim 1 or 2, characterized in that, The step of determining the target action data based on the first operation includes: Based on the first operation, the target action data is determined from the action database; The action database includes preset action data corresponding to multiple actions, and the target action data includes preset action data corresponding to the target action.
4. The method according to claim 1 or 2, characterized in that, The step of determining the target action data based on the first operation includes: Based on the first operation, the target action is determined, and based on the target action, the target action data is determined.
5. The method according to any one of claims 1 to 4, characterized in that, The step of generating a target animation corresponding to the first object based on the target motion data and each skeletal point of the first object includes: Obtain the initial position corresponding to each skeletal point of the first object; Based on the target motion data, determine the target position corresponding to each skeletal point of the first object; Based on the initial and target positions of each skeletal point of the first object, generate the target animation corresponding to the first object.
6. The method according to any one of claims 1 to 5, characterized in that, Before displaying the first interface, the method further includes: A second interface is displayed, which includes the first object; In response to the second operation, the first object is merged into the first interface.
7. The method according to claim 6, characterized in that, The first interface and the second interface are displayed in a split-screen format; or, the second interface floats on top of the first interface; or, the first interface floats on top of the second interface.
8. The method according to claim 6 or 7, characterized in that, The second operation includes dragging the first object onto the first interface.
9. The method according to any one of claims 6 to 8, characterized in that, The response to the second operation, merging the first object into the first interface, includes: In response to the second operation, the position of the first object in the first interface is determined; Based on the position of the first object in the first interface, the first object is merged into the first interface.
10. The method according to claim 9, characterized in that, Determining the position of the first object in the first interface includes: Determine the position of the second operation in the first interface, and determine the position of the first object in the first interface based on the position of the second operation in the first interface.
11. The method according to any one of claims 6 to 10, characterized in that, The response to the second operation, merging the first object into the first interface, includes: In response to the second operation, the first object is stylized to obtain a stylized first object, and the stylized first object is then integrated into the first interface.
12. The method according to claim 11, characterized in that, The stylized first object includes either a cartoon-style first object or a painterly first object.
13. The method according to any one of claims 1 to 12, characterized in that, The method further includes: Obtain the depth information corresponding to the first object; The step of generating a target animation corresponding to the first object based on the target motion data and each skeletal point of the first object includes: Based on the target motion data, the depth information, and each skeletal point of the first object, a target animation corresponding to the first object is generated.
14. The method according to claim 13, characterized in that, The step of generating the target animation corresponding to the first object based on the target motion data, the depth information, and each skeletal point of the first object includes: When it is determined that the first object needs to perform a rotation action based on the target motion data, the target animation corresponding to the first object is generated based on the target motion data, the depth information, and each bone point of the first object.
15. The method according to claim 14, characterized in that, The step of generating the target animation corresponding to the first object based on the target motion data, the depth information, and each skeletal point of the first object includes: Based on the target motion data, determine the rotation angle corresponding to the first object; Based on the rotation angle and the depth information, determine the rotation matrix corresponding to the first object; Based on the rotation matrix, the target motion data, and each skeletal point of the first object, a target animation corresponding to the first object is generated.
16. The method according to any one of claims 1 to 15, characterized in that, After displaying the first interface, the method further includes: In response to a third operation, the first object is merged into a first target display element or a third interface corresponding to the first target display element; the third operation is the operation of dragging the first object to the first target display element.
17. The method according to claim 16, characterized in that, Before the third operation of merging the first object into the first target display element or the third interface corresponding to the first target display element, the method further includes: The fourth operation is detected, which is an operation performed on the first object; In response to the fourth operation, at least one target display element in the first interface is highlighted, the at least one target display element including the first target display element.
18. The method according to claim 16 or 17, characterized in that, The first target display element is the icon, card, or window corresponding to the application.
19. The method according to claim 18, characterized in that, When the first target display element is an icon corresponding to the first application, the step of responding to the third operation by merging the first object into the first target display element or the third interface corresponding to the first target display element includes: In response to the third operation, the first application is launched, and the first object is integrated into the third interface corresponding to the first application.
20. The method according to any one of claims 1 to 19, characterized in that, The first interface is the desktop, the negative one screen, the lock screen, or the application interface.
21. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it causes the electronic device to implement the animation generation method as described in any one of claims 1 to 20.
22. A computer program product, the computer program product comprising a computer program, characterized in that, When the computer program is executed by an electronic device, the electronic device enables the electronic device to implement the animation generation method as described in any one of claims 1 to 20.
23. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by an electronic device, the electronic device enables the electronic device to implement the animation generation method as described in any one of claims 1 to 20.