Image generation method and device and electronic equipment
By generating pose models and supporting user-defined pose adjustments, the problems of insufficient pose database limitations and cross-industry adaptability in traditional 3D model display are solved, and fast and intuitive pose adjustments are achieved, improving the efficiency and practicality of image generation.
Patent Information
- Application Number
- CN202510541886.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-09-05
AI Technical Summary
In the prior art, traditional 3D model display relies on predefined pose libraries, which are difficult to cover the needs of complex scenarios, and lack of cross-industry adaptability, and there is a contradiction between rendering efficiency and interaction fluency, and complex operation requires professional skills.
By acquiring the reference image, a pose model corresponding to the reference subject is generated, including multiple editable joint nodes, which supports user-defined pose adjustments, and uses stickman editor and multi-forktree structure to achieve flexible pose adjustments. Combining forward kinematics and two-way data binding technology, the target image is generated.
It realizes the simple and intuitive posture adjustment operation without professional 3D skills, shortens the operation time, from several hours to several minutes, improves the quality and efficiency of image generation, and meets the diverse needs of users.
Smart Images

Figure CN120599059A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image technology, and in particular to an image generation method, device and electronic device. Background Art
[0002] As industries like home furnishings, automotive, tourism, outdoor, children's, and pets accelerate their online presence, consumers are increasingly demanding immersive product displays. Product displays must be paired with dynamic character poses to enhance the realism of the scene. The organic interaction between diverse character poses and the scene is key to enhancing the user experience. For example, sofas need to display comfortable curves for different sitting positions, car interiors need to reflect realistic driving postures, and tourism projects are looking to inject warmth into virtual scenes through character movements.
[0003] Currently, traditional 3D model displays rely on predefined pose libraries. However, due to the limited number of predefined pose libraries, it is difficult to cover the needs of complex scenarios. For example, when merchants want to display special scenes (such as children curled up on a lazy sofa to read, or the elderly standing up to hold on to aging-friendly furniture), they often find that the existing pose library cannot be accurately matched. Summary of the Invention
[0004] The embodiments of the present application provide an image generation method, device, and electronic device that can flexibly perform posture adjustment operations, breaking through the limitations of the posture library, and thus meeting the posture application needs of different users.
[0005] An embodiment of the present invention provides an image generation method, including:
[0006] Acquire a reference image, wherein the reference image includes a reference subject in an original posture;
[0007] generating a posture model corresponding to the reference subject, wherein the posture model includes a plurality of editable joint nodes corresponding to the reference subject, and the joint nodes are associated with position data corresponding to the original posture;
[0008] In response to a posture adjustment operation input by a user, obtaining an adjusted posture model;
[0009] A target image including the reference subject is generated based on the adjusted posture model, wherein the posture of the reference subject in the target image matches the posture of the adjusted posture model.
[0010] An embodiment of the present invention provides an image generating device, including:
[0011] A first acquisition module is configured to acquire a reference image, wherein the reference image includes a reference subject in an original posture;
[0012] a first generating module, configured to generate a posture model corresponding to the reference subject, wherein the posture model includes a plurality of editable joint nodes corresponding to the reference subject, and the joint nodes are associated with position data corresponding to the original posture;
[0013] A first processing module, configured to obtain an adjusted posture model in response to a posture adjustment operation input by a user;
[0014] The first processing module is further configured to generate a target image including the reference subject based on the adjusted posture model, wherein the posture of the reference subject in the target image matches the posture of the adjusted posture model.
[0015] An embodiment of the present invention provides an electronic device, comprising: a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method described in the first aspect above.
[0016] An embodiment of the present invention provides a computer storage medium for storing a computer program, wherein the computer program enables a computer to implement the method described in the first aspect when executed.
[0017] An embodiment of the present invention provides a computer program product, comprising: a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, causes the one or more processors to execute the steps of the method described in the first aspect above.
[0018] The image generation method, apparatus, and electronic device provided in this embodiment acquire a reference image. To enable flexible adjustment of the posture of a reference subject in the reference image, a posture model corresponding to the reference subject can be generated. The generated posture model can include multiple editable joint nodes corresponding to the reference subject. A user can then input a posture adjustment operation on the posture model or the reference image to obtain an adjusted posture model, wherein the adjusted posture corresponding to the adjusted posture model is different from the original posture of the reference subject. After acquiring the adjusted posture model, a target image can be generated based on the adjusted posture model. The target image includes the reference subject after the posture adjustment operation. At this time, the posture of the reference subject meets the user's requirements, allowing the user to perform an application based on the target image. Because this solution supports users to perform arbitrary customized posture adjustment operations according to their needs, it effectively overcomes the posture limitations of posture selection operations based on a preset posture library. The posture adjustment operation is simple and intuitive, and can be quickly mastered without professional 3D skills. In addition, the structure corresponding to the posture model is simple, which reduces the time corresponding to the posture adjustment operation from several hours in traditional solutions to a few minutes, thereby effectively improving the quality and efficiency of the image generation method and further enhancing the practicality of the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 A schematic diagram of a scene of an image generation method provided by an exemplary embodiment of the present application;
[0021] Figure 2 A flowchart of an image generation method provided by an exemplary embodiment of the present application;
[0022] Figure 2a A schematic diagram of generating a stick figure model corresponding to a reference subject provided by an exemplary embodiment of the present application;
[0023] Figure 2b A schematic structural diagram of an image processing device provided by an exemplary embodiment of the present application;
[0024] Figure 3 A schematic diagram of a process for generating a stick figure model corresponding to the reference subject provided by an exemplary embodiment of the present application;
[0025] Figure 3a A schematic diagram of a multi-branch tree structure provided by an exemplary embodiment of the present application;
[0026] Figure 3b A schematic diagram of a stick figure model provided as an exemplary embodiment of the present application;
[0027] Figure 3c A schematic diagram of generating a model image based on a stick figure model provided by an exemplary embodiment of the present application;
[0028] Figure 4 A schematic diagram of a flow chart of obtaining an adjusted stick figure model in response to a posture adjustment operation input by a user according to an exemplary embodiment of the present application;
[0029] Figure 4a A schematic diagram of switching display pages provided by an exemplary embodiment of the present application;
[0030] Figure 4b A schematic diagram of performing local adjustments on a stick figure model provided by an exemplary embodiment of the present application;
[0031] Figure 4c A schematic diagram of an exemplary embodiment of the present application providing an overall rotation operation on a stick figure model;
[0032] Figure 4d A schematic diagram of performing an overall scaling operation on a stick figure model provided by an exemplary embodiment of the present application;
[0033] Figure 5 A flowchart of another image generation method provided by an exemplary embodiment of the present application;
[0034] Figure 5a A schematic diagram of determining the display position of a bounding box provided by an exemplary embodiment of the present application Figure 1 ;
[0035] Figure 5b A schematic diagram of determining the display position of a bounding box provided by an exemplary embodiment of the present application Figure 2 ;
[0036] Figure 5c A schematic diagram of determining the display position of a bounding box provided by an exemplary embodiment of the present application Figure 3 ;
[0037] Figure 6 A flowchart of another image generation method provided by an exemplary embodiment of the present application;
[0038] Figure 7 A schematic diagram of a flow chart of obtaining an adjusted stick figure model in response to a posture adjustment operation input by a user according to an exemplary embodiment of the present application;
[0039] Figure 8A schematic structural diagram of an image generating device provided by an exemplary embodiment of the present application;
[0040] Figure 9 A schematic structural diagram of an electronic device provided as an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0041] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0042] It should be noted that, in the case of user information involved in the embodiments of the present application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) are in compliance with relevant laws and standards.
[0043] In addition, it should be noted that when the embodiments of the present application involve user interaction operations or triggering operations, the user interaction operations or triggering operations involved in the embodiments of the present application include but are not limited to: touch operations, gesture operations, voice operations, head movement operations, eye movement operations and other interactive operations in various ways; among which, touch operations include but are not limited to: click operations, double-click operations, long press operations, sliding operations, pinch operations or mouse hover operations, etc. Sliding operations include but are not limited to: straight sliding, curved sliding, etc.
[0044] Definition of terms:
[0045] The Stickman Editor is an interactive tool that allows users to adjust the pose of a stickman (a simplified human figure) by dragging, rotating, scaling, mirroring, and scaling and moving the background canvas. The editor creates stickman figures from key point data in JSON format and supports dynamic updates and rendering. This tool addresses the need for customized model poses for merchants across multiple industries, improving the compatibility and flexibility of furniture displays.
[0046] A polytree structure is a nonlinear data structure used to describe hierarchical relationships between nodes. In this solution, the stick figure's joints are modeled as polytree nodes. The root node in the polytree identifies the preset limb center. In some cases, the root node can be a node that identifies the neck position. Child nodes identify limb joints, supporting parent-child node linkage. Each node records its movement, rotation, scaling, and mirroring properties, as well as child node information. Changes to the parent node drive updates to the child nodes, supporting both local control and global updates, making it easier to handle complex pose changes.
[0047] Two-way data binding: used to implement a real-time synchronization mechanism between logical points (for example, position data corresponding to joint nodes in the data layer) and visualization points (for example, joint nodes that can be rendered and displayed in the rendering layer), ensuring that user interaction operations are consistent with the dynamic updates of the underlying data, ensuring the consistency between user operations and data updates, and improving the interactive experience.
[0048] Forward kinematics: An algorithm that derives the position of child nodes from the position and rotation parameters of their parent nodes, used to simulate the linkage of human joints. In stick figure models, the movement of a joint will link its child joints, achieving natural posture adjustments and ensuring the logic of limb movement.
[0049] Bounding Box: Used to identify the rectangular area that encloses the stickman model, and is used for dynamic calculation of model size, position and collision detection.
[0050] To facilitate understanding of the image generation method, device, and electronic device provided in the embodiments of the present application, the following briefly describes the relevant technologies:
[0051] As industries like home furnishings, automotive, tourism, outdoor, children's, and pets accelerate their online presence, consumers are increasingly demanding immersive product displays. Product displays must be paired with dynamic character poses to enhance the realism of the scene. The organic interaction between diverse character poses and the scene is key to enhancing the user experience. For example, sofas need to display comfortable curves for different sitting positions, car interiors need to reflect realistic driving postures, and tourism projects are looking to inject warmth into virtual scenes through character movements.
[0052] In order to meet users' different needs for the posture of characters in images, related technology 1 provides a posture editing solution based on a 3D editor, which supports high-freedom posture adjustment. Specifically, the posture editing solution can implement character posture editing operations based on an online 3D character posture editing website, professional 3D modeling software or game engine through a bone binding system, thereby providing advanced functions such as character skeleton control and skin weight adjustment.
[0053] However, the above-mentioned related technology 1 has the following defects:
[0054] (a) The technical threshold is too high: Although a high degree of freedom in pose adjustment can be achieved through a 3D editor, professional modeling knowledge is required, the learning cost is high, and complex three-dimensional coordinate system operations (such as Euler angle and quaternion conversion) must be mastered. Skeletal binding requires manual adjustment of skin weights, and the binding operation of a single character can take more than 3 hours. The typical operation process is: create a skeleton chain → bind the skin → adjust the weight → set the inverse kinematics (IK) constraint.
[0055] (b) Performance bottleneck on the web: The traditional 3D rendering pipeline performs poorly in browsers; when the number of triangles of a single character is greater than 50,000, the frame rate of the terminal mobile phone is less than 15FPS; skeletal animation calculations rely on soft solving of the processor (e.g., CPU), resulting in operation delays greater than 200ms.
[0056] (c) Difficulty in cross-industry adaptation: The human skeleton template cannot be directly used in the scene background image provided by the merchant; a single bone structure cannot adapt to different model requirements.
[0057] In addition, related technology 2 provides a posture editing solution based on a 2D layer tool, which simulates the model's posture through layer processing, specifically simulating the human body's posture changes through cutouts, layer overlays and deformation tools (for example: manipulated deformation); relying on transparency blending and masking to achieve a pseudo-three-dimensional effect; and using the pictures provided by the merchant as the scene background.
[0058] However, the above-mentioned related technology 2 has the following defects:
[0059] (a) Dynamic effect distortion: When the limbs rotate more than 30°, pixel tearing (for example, jagged edges on the layer) is likely to occur. Multi-angle display requires manual drawing of different perspective materials. The production of multiple views for a single pose takes more than 2 hours. Dynamic linkage effects cannot be processed, and the rendering quality depends on manual retouching.
[0060] (b) Lack of spatial logic: The limb occlusion relationship cannot be automatically calculated (for example, the depth of field when the arm is bent). When the sitting angle is changed, the projection and lighting effects need to be redrawn.
[0061] (c) Single interaction dimension: users can only perform two-dimensional translation / rotation operations; they cannot observe the physical interaction between the restored posture and the product in real time (such as the impact of the human body's center of gravity shift on the deformation of the sofa).
[0062] In general, the technical solutions provided by relevant technologies generally face three practical challenges during implementation:
[0063] (1) Limitations of the preset posture library;
[0064] Traditional 3D models rely on predefined pose libraries, which have a limited number of poses and are difficult to cover complex scene requirements (for example, displaying furniture at special angles). When merchants want to display special scenes (for example, children curled up on lazy sofas to read, and the elderly stand up to hold on to aging-friendly furniture), they often find that the existing pose library cannot match accurately. Even if manual adjustment of bone joints is allowed, the complex 3D operation interface makes non-professionals discouraged. Merchants need to manually adjust the model joints, which is complicated and requires professional 3D skills and is costly. This technical threshold forces many small and medium-sized merchants to give up their personalized display needs.
[0065] (2) Lack of cross-industry adaptability;
[0066] If 3D model pose editing is used, industries like automotive and pets require customized character skeleton models and product-specific scenes. Existing tools have poor scalability, and customized character models cannot be adapted to different industries. If real-life offline photography is used, different display scenes and character models must be adapted for different industries and products, and even these factors depend on objective factors such as shooting weather. Shooting with real-life models is expensive and cannot meet the needs of multiple industries. If the shooting results are unsatisfactory, the cost of adjusting the product images is also very high.
[0067] (3) Rendering efficiency and interaction fluency conflict;
[0068] 3D model pose editing requires high computing power for real-time 3D rendering on the client side. Even if merchants have 3D knowledge, the lag in frame rates makes it difficult for merchants with standard device configurations to generate the desired interactive effect of the model pose and product. Using 2D solutions (such as layer replacement) for rendering operations is a single interactive method and lacks spatial dimensional information, resulting in a poor user experience. Merchants are unable to observe the interaction details between the person and the product from multiple angles, and it is even more difficult to perceive the hierarchical relationships in space. Creating a single image often requires a significant amount of time and effort, resulting in high labor costs.
[0069] In order to solve the above technical problems, the embodiments of the present application provide an image generation method, device and electronic device, with reference to the attached Figure 1As shown, the execution subject of the image generation method can be an image generation device 200, and the image generation device 200 can be implemented as a local server or a server in the cloud. Among them, when the image generation device 200 is implemented as a server in the cloud, the image generation method can be executed in the cloud, and several computing nodes (cloud servers) can be deployed in the cloud, and each computing node has computing, storage and other processing resources. In the cloud, multiple computing nodes can be organized to provide a certain service. Of course, a computing node can also provide one or more services. The way to provide the service in the cloud can be to provide a service interface to the outside world, and the user calls the service interface to use the corresponding service. The service interface includes a software development kit (SDK), an application programming interface (API), and the like.
[0070] The image generation device 200 is communicatively connected to a client 100, wherein the client 100 is used for users to execute applications that trigger image generation operations. The client 100 can be any computing device with certain information exchange capabilities. In specific implementations, the client 100 can be a mobile phone, a personal computer (PC), a tablet computer, a setting application, etc. Furthermore, the basic structure of the client 100 may include at least one processor. The number of processors depends on the configuration and type of the client. The client 100 may also include memory, which can be volatile, such as random access memory (RAM), non-volatile, such as read-only memory (ROM), flash memory, etc., or a combination of both. The memory typically stores an operating system (OS), one or more application programs, and may also store program data. In addition to the processing unit and memory, the client 100 also includes some basic configurations, such as a network card chip, an I / O bus, a display component, and some peripheral devices. Optionally, some peripheral devices may include, for example, a keyboard, a mouse, a stylus, a printer, etc. Other peripheral devices are well known in the art and will not be described in detail here.
[0071] Image generation device 200 refers to a device capable of performing image generation operations in a network virtual environment, typically a device that utilizes a network to perform information planning and image generation operations. Image generation device 200 can be implemented as an image generation model for performing image generation operations. Physically, image generation device 200 can be any device capable of providing computing services and performing corresponding image generation operations, such as a processor, server, etc. Product anomaly detection device 200 primarily comprises a processor, hard drive, memory, and system bus, similar to a general-purpose computer architecture.
[0072] In the above embodiment, a network connection is established between the image generating device 200 and the client 100, and the network connection can be a wireless or wired network connection. If the image generating device 200 and the client 100 are connected by communication, the network standard of the mobile network can be any one of 2G (Global System for Mobile Communications GSM), 2.5G (General Packet Radio Service GPRS), 3G (Wideband Code Division Multiple Access (WCDMA), Time Division Synchronous Code Division Multiple Access (TD-SCDMA), 4G (Long Term Evolution LTE), 4G+ (Enhanced Long Term Evolution LTE+), Worldwide Interoperability for Microwave Access (WiMax), 5G, 6G, etc.
[0073] In an embodiment of the present application, the client 100 is used for users to use a reference image that can trigger an image generation operation, wherein the reference image includes a reference subject in an original posture. In some instances, the reference image can be realized through human-computer interaction. Specifically, an interactive interface of multiple images can be displayed on the client 100. The user can input a selection operation for any image in the interactive interface, and then the image corresponding to the selection operation can be determined as the reference image, so that the reference image can be stably obtained; in order to flexibly adjust the posture of the reference subject in the reference image, the reference image can be sent to the image generation device 200, so that the image generation device 200 can adjust the posture of the reference subject in the reference image.
[0074] The image generating device 200 is used to obtain the reference image sent by the client 100, wherein the obtained reference image includes a reference subject in an original posture. Since the original posture of the reference subject in the reference image may not meet the needs of the merchant, in order to obtain a reference subject that meets the posture requirements of the merchant, after obtaining the reference image, a posture model corresponding to the reference subject can be generated, wherein the posture model includes multiple editable joint nodes corresponding to the reference subject, and the joint nodes are associated with position data corresponding to the original posture.
[0075] Because multiple joint nodes in the posture model support editable operations, and the posture model can also support editable operations, users can input posture adjustment operations on the posture model or the joint nodes in the posture model as needed. In response to the posture adjustment operation input by the user, an adjusted posture model can be obtained, wherein the adjusted posture model corresponds to an adjusted posture, and the adjusted posture can be different from the original posture of the reference subject. A target image including the reference subject can then be generated based on the adjusted posture model, and the posture of the reference subject in the target image matches the posture of the adjusted posture model. This effectively enables flexible posture adjustment operations on the reference subject in the reference image, thereby obtaining a reference subject image that meets the user's posture requirements.
[0076] In this embodiment, since the solution supports users to perform arbitrary customized posture adjustment operations according to their needs, it effectively breaks through the posture limitations of posture selection operations based on a preset posture library. The posture adjustment operation is simple and intuitive, and can be quickly mastered without professional 3D skills. In addition, the structure corresponding to the posture model is simple, so that the time corresponding to the posture adjustment operation can be shortened from several hours in traditional solutions to a few minutes, thereby effectively improving the quality and efficiency of the image generation method, and further improving the practicality of the method.
[0077] The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0078] Figure 2 A flowchart of an image generation method provided by an exemplary embodiment of the present application; Figure 2 As shown, this embodiment provides an image generation method, the execution subject of the method is an image generation device, and the image generation device can be implemented as software, or a combination of software and hardware. When the image generation device is implemented as hardware, it can specifically be various electronic devices that can perform image generation operations, including but not limited to personal computers, servers, etc. When the image generation device is implemented as software, it can be installed in the electronic devices listed above. In some instances, the image generation device can be implemented as a model pose editor, and the model pose editor can be implemented as a stick figure model pose editor based on a web terminal and a multi-branch tree structure. Specifically, the image generation method provided in this embodiment may include:
[0079] Step S201: Acquire a reference image, where the reference image includes a reference subject in an original posture.
[0080] Step S202: Generate a posture model corresponding to the reference subject, wherein the posture model includes a plurality of editable joint nodes corresponding to the reference subject, and the joint nodes are associated with position data corresponding to the original posture.
[0081] Step S203: In response to the posture adjustment operation input by the user, an adjusted posture model is obtained.
[0082] Step S204: Based on the adjusted posture model, a target image including the reference subject is generated, wherein the posture of the reference subject in the target image matches the posture of the adjusted posture model.
[0083] The following is a detailed description of the specific implementation methods and principles of each of the above steps:
[0084] Step S201: Acquire a reference image, where the reference image includes a reference subject in an original posture.
[0085] When there is a need for image generation, the image generation device can obtain a reference image, wherein the reference image can include a reference subject, and the reference subject can be implemented as at least one of the following: a human subject, a cartoon character subject, a virtual subject, etc. For the reference subject, it can correspond to an original posture, and the above-mentioned reference subject and the original posture of the reference subject can be determined by analyzing and identifying the reference image. Specifically, after obtaining the reference image, the method in this embodiment can also include: obtaining a pre-trained object recognition model and a posture recognition model; then using the object recognition model to analyze and identify the reference image to obtain the reference subject included in the reference image; and using the posture recognition model to perform posture recognition on the reference subject identified in the reference image to obtain the original posture of the reference subject, and then facilitating the image generation operation based on the reference image including the reference subject in the original posture.
[0086] In some instances, a reference image can be obtained by selecting alternative images provided by the platform through human-computer interaction. In this case, obtaining the reference image may include: displaying at least one alternative image provided by the platform, where different alternative images may include different subjects, and the alternative images may support overall posture adjustment operations for the subject; obtaining a selection operation input by the user for any alternative image; and determining the alternative image corresponding to the selection operation as the reference image, thereby effectively ensuring the accuracy and reliability of obtaining the reference image.
[0087] In other instances, the reference image can be obtained not only by selecting alternative images provided by the platform through human-computer interaction operations, but also by image uploading operations. In this case, obtaining the reference image may include: displaying a human-computer interaction interface for implementing image generation operations, including an image upload interface in the human-computer interaction interface; obtaining an execution operation input by the user for the image upload interface; obtaining a preset storage path for the uploaded image based on the execution operation; and then storing the reference image obtained by the user through the image upload operation through the preset path. This also ensures the accuracy and reliability of obtaining the reference image.
[0088] Step S202: Generate a posture model corresponding to the reference subject, wherein the posture model includes a plurality of editable joint nodes corresponding to the reference subject, and the joint nodes are associated with position data corresponding to the original posture.
[0089] After obtaining the reference image, since the original posture of the reference subject in the reference image may not meet the user's needs, in order to achieve flexible posture adjustment operations on the reference subject in the reference image, a posture model corresponding to the reference subject can be generated. In some instances, the posture model can be implemented as: a stick figure model, a human skeleton model, etc. For ease of understanding and explanation, the following detailed description is given using the stick figure model as an example of the posture model. Figure 2a As shown, the stick figure model may include multiple editable joint nodes corresponding to the reference body, that is, the joint nodes may support at least one of the following operations: dragging, moving, rotating, mirroring, etc. The joint nodes may be associated with position data corresponding to the original posture, and the position data may include at least one of the following: coordinate information, rotation data, scaling data, translation data, mirroring data, etc.
[0090] It should be noted that for the stickman model, it has the same posture information as the reference subject in the reference image. When the user rotates, scales, translates, mirrors, and other operations on the reference subject in the reference image, the generated stickman model will also perform corresponding rotation, scaling, translation, mirroring, and other operations synchronously. For example: the user rotates the reference subject 30 degrees counterclockwise, mirrors, scales 0.7 times, and translates 10px on the X axis, then the generated stickman model corresponding to the reference subject will also apply corresponding changes; when the user enters the editing state of the stickman model, the stickman model will also be consistent with the posture of the reference subject.
[0091] Among them, this embodiment does not limit the specific generation method of the stickman model. In some instances, the stickman model can be generated by a pre-trained image processing model. At this time, generating a stickman model corresponding to the reference subject may include: obtaining a pre-trained image processing model; using the image processing model to analyze and process the reference image to obtain a stickman model corresponding to the reference subject in the original posture, which effectively ensures the accuracy and reliability of the generation of the stickman model.
[0092] After generating a stick figure model corresponding to the reference subject, in order to realize flexible posture adjustment operations for the stick figure model, the relevant logical data corresponding to the stick figure model (including position data, posture adjustment data, bounding box data, etc.) can be stored in a preset data stack. The relevant data corresponding to the stick figure model may include at least one of the following: position data corresponding to the stick figure model, posture adjustment data corresponding to the stick figure model (including at least one of the following: rotation data, movement data, mirror data, etc.), wherein the relevant data stored in the preset data stack can be updated and changed in real time as the posture adjustment operation of the stick figure model changes, thereby realizing a two-way data binding operation between "any joint node in the stick figure model" and "the relevant logical data corresponding to the joint node" in the display interface.
[0093] Step S203: In response to the posture adjustment operation input by the user, an adjusted posture model is obtained.
[0094] When a stickman model is used as a posture model, after generating a stickman model corresponding to a reference subject, the user can input a posture adjustment operation through the reference image and the stickman model. The posture adjustment operation may include at least one of the following: rotation operation, movement operation, mirror operation and scaling operation. Then, based on the input posture adjustment operation, an adjusted stickman model (i.e., an adjusted posture model) can be obtained. The posture corresponding to the adjusted stickman model is different from the original posture of the reference subject.
[0095] Among them, the number of posture adjustment operations input by the user can be 1 time or multiple times. When the posture adjustment operation input by the user is 1 time, the stickman model can be updated in real time based on the posture adjustment operation to obtain the adjusted stickman model; when the posture adjustment operation input by the user is multiple times, the stickman model can be updated in real time based on each posture adjustment operation. Multiple posture adjustment operations can correspond to multiple stickman model update operations, so it is necessary to obtain multiple adjusted stickman models.
[0096] After obtaining the adjusted stick figure model, the posture-related data corresponding to the adjusted stick figure model can be obtained and stored in the data stack, so that the posture-related data stored in the data stack can be updated in real time as the posture adjustment operation of the stick figure model changes, thereby ensuring real-time consistency between the posture-related data and the stick figure model.
[0097] Furthermore, after obtaining the adjusted stick figure model, the method in this embodiment may further include: determining a display position of the adjusted stick figure model, and then displaying the adjusted stick figure model at the display position.
[0098] Among them, determining the display position of the adjusted stickman model can include: determining the posture information of the adjusted stickman model based on the parameters corresponding to the posture adjustment operation and the original posture of the stickman model; determining the position information of the bounding box (for example: the upper left corner position coordinates and the lower right corner position coordinates) based on the posture information of the adjusted stickman model and the parameters corresponding to the posture adjustment operation; then determining the first relative position relationship between the adjusted stickman model and the bounding box based on the posture information of the adjusted stickman model and the position information of the packaging box, and determining the second relative position relationship between the bounding box and the canvas based on the position information of the bounding box and the canvas position (for example: the relative coordinates of the upper left corner of the bounding box relative to the upper left corner of the canvas, the relative coordinates of the lower right corner of the bounding box relative to the upper left corner of the canvas, etc.); then the display position of the adjusted stickman model can be determined based on the above-mentioned first relative position relationship and second relative position relationship, which effectively ensures that the adjusted stickman can be displayed at an accurate position.
[0099] Step S204: Based on the adjusted posture model, a target image including the reference subject is generated, wherein the posture of the reference subject in the target image matches the posture of the adjusted posture model.
[0100] Since the posture corresponding to the adjusted stickman model is different from the original posture of the reference subject, and the posture corresponding to the adjusted stickman model is often the target posture that meets the user's posture requirements, in order to obtain the target image, and the reference subject in the target image matches the posture of the adjusted stickman model, that is, the posture of the reference subject is the same or approximately the same as the posture of the adjusted stickman model, after obtaining the adjusted stickman model, the adjusted stickman model can be analyzed and processed to generate a target image including the reference subject.
[0101] Specifically, the target image can be generated by a pre-trained image generation model. In this case, generating a target image including a reference subject based on the adjusted stick figure model may include: obtaining a pre-trained image generation model; inputting the adjusted stick figure model and posture-related data corresponding to the adjusted stick figure model into the image generation model for processing, and obtaining a target image including a reference subject output by the image generation model, thereby effectively ensuring the accuracy and reliability of the target image generation. Among them, the image generation model involved in the embodiments of the present application can be an artificial intelligence-based language model (Language Mode, abbreviated LM) or a multimodal model (Multimodal Model, abbreviated MM), etc. The embodiments of the present application do not limit the number of model parameters supported by the model, and the goal is to meet actual needs.
[0102] It should be noted that, for the target image, the posture of the reference subject in the target image can match the posture of the adjusted stickman model, so that the original posture of the reference subject in the reference image can be flexibly adjusted, and the target image including the reference subject can be obtained, and the posture of the reference subject in the target image meets the needs of the user, and then application operations can be directly performed on the target image, such as: product promotion operations based on the target image, product release operations based on the target image, product effect display operations based on the target product, etc., which effectively improves the practicality of the method.
[0103] In some instances, such as Figure 2bAs shown, the image generation device in this application embodiment may include: a computing engine, an interactive event processing component, a physical constraint verification component, a renderer, and a data storage component. The interactive event processing component is responsible for processing user input operations, such as dragging, rotating, scaling, mirroring, etc., and then passing the relevant data of these operation events to the computing engine. The computing engine is an important component of the image generation device. It is used to perform calculations or processing operations based on the data of the reference subject (such as skeletal data, joint nodes, etc.) to generate a corresponding stick figure model. It can also exchange data with the data storage component to update the data stored in the data storage component (such as the position data and posture data corresponding to each joint node in the stick figure model). At the same time, it generates rendering instructions to the renderer so that the renderer can perform rendering operations based on the rendering instructions, thereby obtaining a target image after the rendering operation. In addition, the computing engine can also perform some linkage operations on the joint nodes in the stick figure model according to the rules of forward kinematics. For example, when the current joint node moves / rotates, the position of the child joint node can be synchronously updated. In this way, the movement of multiple joint nodes can be achieved through a single posture adjustment operation, which helps to simplify the user's operation steps.
[0104] The image generation method provided in this embodiment obtains a reference image. To enable flexible adjustment of the posture of a reference subject in the reference image, a posture model corresponding to the reference subject can be generated. The generated posture model can include multiple editable joint nodes corresponding to the reference subject. The user can then input posture adjustment operations on the posture model or the reference image to obtain an adjusted posture model. The adjusted posture corresponding to the adjusted posture model is different from the original posture of the reference subject. After obtaining the adjusted posture model, a target image can be generated based on the adjusted posture model. The target image includes the reference subject after the posture adjustment operation. At this time, the posture of the reference subject meets the user's requirements, allowing the user to perform an application based on the target image. Because this solution supports users to perform arbitrary customized posture adjustment operations according to their needs, it effectively overcomes the posture limitations of posture selection operations based on a preset posture library. The posture adjustment operation is simple and intuitive, and can be quickly mastered without professional 3D skills. In addition, the structure corresponding to the posture model is simple, which reduces the time corresponding to the posture adjustment operation from several hours in traditional solutions to a few minutes, thereby effectively improving the quality and efficiency of the image generation method and further enhancing the practicality of the method.
[0105] Figure 3 A flowchart of generating a stick figure model corresponding to a reference subject is provided for an exemplary embodiment of the present application; based on the above embodiment, refer to the attached Figure 3 As shown, the stick figure model can be generated not only by analyzing and processing the reference image through the image processing model, but also by a multi-branch tree structure corresponding to the reference subject. In this case, generating the stick figure model corresponding to the reference subject may include:
[0106] Step S301: Acquire multiple joint nodes corresponding to a reference subject, wherein the joint nodes are associated with position data corresponding to an original posture.
[0107] In order to accurately and flexibly adjust the posture of the reference subject, after obtaining the reference image, the joint node recognition operation can be performed on the reference subject in the reference image, so that multiple joint nodes corresponding to the reference subject can be obtained. In some examples, when the reference subject is implemented as a human subject, the multiple joint nodes may include 20 joint nodes or 18 joint nodes. Specifically, Figure 3a As shown, the multiple joint nodes may include: a head joint node corresponding to the head, a neck joint node corresponding to the neck, limb joint nodes corresponding to the limbs, and so on.
[0108] Specifically, multiple joint nodes can be determined using a pre-trained joint recognition model. In this case, obtaining multiple joint nodes corresponding to a reference subject may include: obtaining the pre-trained joint recognition model; inputting a reference image into the joint recognition model to perform joint node processing operations, and obtaining multiple joint nodes corresponding to the reference subject as output by the joint recognition model. This ensures, to a certain extent, the accuracy and reliability of obtaining multiple joint nodes. The joint nodes may be associated with position data corresponding to the original pose, and the position data may include coordinate information corresponding to each joint node corresponding to the reference subject.
[0109] After a plurality of joint nodes corresponding to the reference body are acquired, the acquired plurality of joint nodes may be displayed, so that the user can flexibly perform posture adjustment operations on the joint nodes based on the displayed plurality of joint nodes.
[0110] Furthermore, since different reference images may correspond to reference subjects of different sizes or reference subjects of different postures, in order to be able to accurately identify or acquire joint nodes of various types of reference images, the reference image may be initialized before acquiring multiple joint nodes corresponding to the reference subject. At this time, the method in this embodiment may further include: acquiring the reference canvas area corresponding to the reference image; determining the subject bounding box corresponding to the reference subject; aligning the upper left corner of the subject bounding box with the upper left corner of the reference canvas area; and then setting the reference subject and the subject bounding box at the center position of the reference canvas area. This effectively achieves the ability to stably identify joint nodes for reference subjects of various sizes and in various postures, thereby ensuring the accuracy of acquiring joint nodes.
[0111] It should be noted that the initialization operation of the reference image not only includes setting the subject bounding box at the center position of the reference canvas area, but also includes identifying the coordinate data of the reference subject and the coordinate data of the stickman model. Then, based on the coordinate data of the stickman model and the coordinate data of the reference subject, it can be identified whether the size of the stickman model is consistent with that of the reference subject. If not, the stickman model can be scaled to obtain a stickman model that is consistent with the size of the reference subject; if consistent, there is no need to perform any modification operations on the stickman model, so as to ensure that the posture adjustment effect of the stickman model is consistent with the posture adjustment effect of the reference subject.
[0112] Step S302: Generate a multi-tree structure corresponding to multiple joint nodes, where the multi-tree structure can identify the hierarchical relationship between the joint nodes.
[0113] For multiple joint nodes, joint nodes can correspond to different node types, and joint nodes of different node types can correspond to different hierarchical relationships. For example, multiple joint nodes can include root nodes, parent nodes, child nodes, etc. The number of root nodes can be 1, 1 root node can correspond to multiple parent nodes, and 1 parent node can correspond to multiple child nodes. For example: refer to the attached Figure 3a As shown, joint node No. 1 is the root node, which corresponds to the neck position of the task body. Joint node No. 1 can correspond to parent node No. 0, parent node No. 2, parent node No. 8, parent node No. 11 and parent node No. 5. The above-mentioned parent node No. 0 corresponds to child node No. 14 and child node No. 15, and so on.
[0114] In order to construct a stick figure model capable of flexible posture adjustment, after obtaining multiple joint nodes, a multi-branch tree structure construction operation can be performed based on the multiple joint nodes, thereby generating a multi-branch tree structure corresponding to the multiple joint nodes. In some examples, the multi-branch tree structure is constructed using a depth traversal algorithm. In this case, generating the multi-branch tree structure corresponding to the multiple joint nodes may include: determining a root node included in the multiple joint nodes; and performing a depth traversal operation based on the root node to generate a multi-branch tree structure capable of identifying the hierarchical relationship between the joint nodes.
[0115] Specifically, after obtaining multiple joint nodes, the root node included in the multiple joint nodes can be determined first, wherein the number of root nodes is one, such as Figure 3a Node 1 in is the root node, which can be determined by a pre-defined configuration file. In order to facilitate calculation, when the reference subject is a human subject, the neck joint node in the human subject can be determined as the root node. Then, a deep traversal operation can be performed based on the determined root node to obtain the linkage relationship and hierarchical relationship between each joint node, and then a multi-branch tree structure that can identify the hierarchical relationship between the joint nodes can be generated. This effectively ensures the accuracy and reliability of the generation of the multi-branch tree structure.
[0116] In other instances, the multi-branch tree structure can be constructed not only through a deep traversal algorithm, but also through a tree structure generation model. In this case, generating a multi-branch tree structure corresponding to multiple joint nodes can include: obtaining a pre-trained tree structure generation model for constructing a tree structure based on the identified multiple joint nodes; inputting multiple joint nodes and reference images into the tree structure generation model for processing to obtain a multi-branch tree structure output by the tree structure generation model. The multi-branch tree structure can automatically identify the hierarchical relationship between the joint nodes, thereby ensuring the flexibility and reliability of determining the multi-branch tree structure to a certain extent.
[0117] Step S303: Generate a posture model based on the multi-tree structure.
[0118] Since the multi-tree structure can identify the hierarchical relationship between multiple joint nodes, the above-mentioned hierarchical relationship plays an important role in the process of adjusting the posture of any joint node. In order to facilitate the overall or local adjustment operation of the original posture of the reference subject in the reference image, after obtaining the multi-tree structure, a stick figure model can be generated based on the multi-tree structure, wherein the posture of the generated stick figure model matches the original posture of the reference subject in the reference image, so that there is also a corresponding hierarchical relationship between the joint nodes in the constructed stick figure model, thereby facilitating the flexible posture adjustment operation of the original posture of the reference subject by performing an overall posture adjustment operation or a local adjustment operation on the stick figure model.
[0119] In addition, in the process of analyzing and processing the reference image, the size of the generated stick figure model may be inconsistent with the size of the reference subject. In this way, in the process of adjusting the posture of the stick figure model, the adjustment effect of the displayed stick figure model may be inconsistent with the posture adjustment effect of the reference subject, so that the posture effect desired by the user may be inconsistent with the actual posture effect corresponding to the posture adjustment operation. In order to avoid the occurrence of the above situation, after the stick figure model is generated, it is possible to identify whether the size of the stick figure model is consistent with the size of the reference subject in the reference image. When the size of the stick figure model is consistent with the size of the reference subject in the reference image, no operation is required; when the size of the stick figure model is inconsistent with the size of the reference subject in the reference image, the stick figure model can be scaled to make the size of the stick figure model consistent with the size of the reference subject in the reference image. This improves the accuracy and reliability of the user's posture adjustment operation based on the stick figure model to a certain extent.
[0120] In addition, the generated stick figure model can correspond to different posture adjustment models, namely, an overall posture adjustment model and a local posture adjustment mode. The overall posture adjustment model is used to implement overall posture adjustment operations on the stick figure model, such as performing overall translation, rotation, or mirroring operations on the stick figure model. The local posture adjustment model is used to implement local posture adjustment operations on the stick figure model, such as performing translation and rotation operations on some joint nodes in the stick figure model. Users can choose to perform posture adjustment operations on the stick figure model under different posture adjustment models according to their posture adjustment requirements, thereby improving the flexibility and reliability of the method.
[0121] In some instances, after generating a stick figure model corresponding to a reference subject, corresponding attribute information may be added to the joint nodes in the stick figure model so that the user can perform reasonable posture adjustment operations based on the added attribute information. At this time, the method in this embodiment may further include: obtaining adjustment constraint rules corresponding to multiple joint nodes in the stick figure model; adding attribute information to the multiple joint nodes based on the adjustment constraint rules, the attribute information including at least one of the following: attribute information on whether the stick figure can be followed for movement, and attribute information on whether the stick figure can be followed for rotation.
[0122] Since the stickman model is generated based on the reference subject in the reference image, different joint nodes between the reference subjects often correspond to different constraint rules. For example, when the reference subject is a human subject, the distance between the left hip joint node and the right hip joint node of the human subject cannot be too far, otherwise deformation is likely to occur; the distance between the head joint node and the neck joint node of the human subject cannot be too far or too close, otherwise deformation is likely to occur, etc.
[0123] In order to ensure that the effect of the posture adjustment operation of the stickman model (especially the local posture adjustment operation) is consistent with the actual situation, after generating the stickman model corresponding to the reference subject, the adjustment constraint rules corresponding to the multiple joint nodes in the stickman model can be obtained. For example, the adjustment constraint rules may include that the two joint nodes of the hips of the character subject cannot follow the movement or follow the rotation operation to avoid the deformation of the character subject's posture; or, the adjustment constraint rules may include that when the arm joint nodes of the character subject move, the joint nodes of the hands can follow the movement, etc.
[0124] As for the adjustment constraint rules, those skilled in the art can flexibly configure or adjust the specific items or contents included in the adjustment constraint rules according to specific application requirements or scenario requirements, which will not be described in detail here. In addition, after the adjustment constraint rules are configured or adjusted, the adjustment constraint rules can be stored in a preset area or preset device, so that the adjustment constraint rules can be obtained by accessing the preset area or preset device. The adjustment constraint rules can be used to constrain the local adjustment operation of the stick figure model to ensure that the posture of the adjusted stick figure model conforms to the actual situation.
[0125] After obtaining the adjustment constraint rules, attribute information can be added to multiple joint nodes based on the adjustment constraint rules, wherein different joint nodes can have different attribute information added. For example, the attribute information that can follow the movement can be identified as "1a", and the attribute information that cannot follow the movement can be identified as "0a". The attribute information that can follow the rotation can be identified as "1b", and the attribute information that cannot follow the movement can be identified as "0b". Then, for the hand joint nodes, they can correspond to the attribute information "1a", "1b". For the specific joint nodes of the head (eye joint nodes, ear joint nodes, etc.), they can correspond to the attribute information "0a", "0b". For the representative joint nodes of the head (the joint nodes that can be obtained by taking the midpoint of the two ear joint nodes), they can correspond to the attribute information "1a", "1b"; for the joint nodes at the hip position, they can correspond to the attribute information "0a", "0b". In this way, the posture adjustment operation is realized through the attribute information corresponding to each joint node, which can effectively ensure the rationality and effectiveness of the posture adjustment operation.
[0126] Furthermore, after adding attribute information to multiple joint nodes based on the adjustment constraint rules, for the joint nodes included in the stick figure model, although some joint nodes can follow the movement or rotation operation, if the movement range is too large or the rotation angle is too large, it is also easy for the stick figure model's posture to be deformed, and thus inconsistent with the actual situation. For example, for the stick figure model, although the joint nodes at the hand position can be moved, if the movement range of the arm position is too large, the shape of the hand may be deformed, and thus inconsistent with the actual situation; or, although the joint nodes at the neck position can be moved, if the movement range of the neck position is too large, it may cause the posture of the entire upper body of the stick figure model to be deformed, and thus inconsistent with the actual situation; or, although the representative joint node of the head can be moved or rotated, if the rotation angle of the representative joint node of the head is too large, for example: 180°, it will also be inconsistent with the actual situation.
[0127] Therefore, in order to avoid the occurrence of the above situation, the movement operation or rotation operation on each joint node can be controlled within a reasonable range. At this time, the method in this embodiment may also include: when the joint node corresponds to attribute information for identifying that it can follow the movement operation, and / or attribute information for identifying that it can follow the rotation operation, obtaining the physical constraint rules corresponding to the joint node; based on the physical constraint rules, determining the movable range and / or rotatable range corresponding to the joint node; associating and storing the joint node with the movable range; and / or associating and storing the joint node with the rotatable range.
[0128] In Example 1, when the hand joint node corresponds to attribute information for identifying the ability to follow movement operations and attribute information for identifying the ability to follow rotation operations, the physical constraint rules corresponding to the above-mentioned hand joint nodes can be obtained. The physical constraint rules can be rules determined based on forward kinematics rules, physical characteristics of the reference subject, and size information of the reference subject, and are used to identify the motion range area corresponding to the hand joint node.
[0129] Specifically, the specific method of obtaining the physical constraint rules is similar to the method of obtaining the above-mentioned adjustment constraint rules. For details, please refer to the above-mentioned statements and will not be repeated here. After obtaining the physical constraint rules, the physical constraint rules can be analyzed and processed to determine the movable range of the hand joint nodes for follow-up movement operations and the rotatable range of the hand joint nodes for follow-up rotation operations. The hand joint nodes can then be associated with the movable range and the rotatable range and stored, so that the follow-up movement operation of the hand joint nodes can be controlled to be implemented within the movable range, and the follow-up rotation operation of the hand joint nodes can be implemented within the rotatable range, thereby ensuring the accuracy and reliability of the posture adjustment of the stickman model, and complying with physical rules and actual scenarios.
[0130] Example 2: When the neck joint node corresponds to attribute information for identifying the ability to follow movement operations, the physical constraint rules corresponding to the above-mentioned neck joint node can be obtained. The physical constraint rules can be rules determined based on forward kinematics rules, physical characteristics of the reference body, and size information of the reference body, and are used to identify the motion range area corresponding to the neck joint node.
[0131] After obtaining the physical constraints, they can be analyzed and processed to determine the movable range of the neck joint node for follow-up movement. The neck joint node and the movable range can then be associated and stored. This allows the follow-up movement of the neck joint node to be controlled within the movable range, ensuring accurate and reliable posture adjustment of the stick figure model, consistent with physical rules and actual scenarios.
[0132] Example 3: When the representative joint node of the head corresponds to attribute information for identifying the ability to follow rotation operations, the physical constraint rules corresponding to the above-mentioned representative joint nodes of the head can be obtained. The physical constraint rules can be rules determined based on forward kinematics rules, physical characteristics of the reference body, and size information of the reference body, and are used to identify the motion range area corresponding to the representative joint node of the head.
[0133] After obtaining the physical constraints, they can be analyzed and processed to determine the rotation range of the head's representative joint nodes for follow-up rotation. The head's representative joint nodes and the rotation range can then be associated and stored. This allows the follow-up rotation of the head's representative joint nodes to be controlled within the rotation range, ensuring accurate and reliable posture adjustment of the stick figure model, consistent with physical rules and real-world scenarios.
[0134] In addition, when the reference subject is a human subject, in order to ensure the accuracy of the stickman model, the limb shape of the stickman model can be finely controlled, such as Figure 3b As shown, in order to be able to control the shape of each limb of the stick figure model in any posture, it can simulate the shape of the limb of the main body of the character, that is, to keep the limbs from thick to thin from the inside to the outside and from the top to the bottom. Specifically, the width change of the limbs can be determined according to the posture of the character. For example, taking node 1 where the neck is located as the root node, the limb shapes corresponding to all its child joint nodes are from thick to thin. For ease of understanding, the thickness of the limbs can be marked by the triangles in the figure. Specifically, each limb image can be made thick on the side close to the parent joint node and thin on the side away from it, so the basic shape of the human body can be constructed and restored. In particular, the posture of the head is thin when it is close to its parent joint node, and thick when it is away from it. Therefore, the problem can be solved by rotating the head limb image 180 degrees, which can improve the authenticity and accuracy of the stick figure model to a certain extent.
[0135] In some examples, see Appendix Figure 3cAs shown, after generating a stick figure model corresponding to the reference subject, the method in this embodiment may further include: generating a model image corresponding to the stick figure model, wherein the posture of the obtained model image meets the posture requirements of the user, so that the application can be directly based on the model image, thereby improving the practicality of the method to a certain extent.
[0136] In this embodiment, by obtaining multiple joint nodes corresponding to the reference body, a multi-branch tree structure corresponding to the multiple joint nodes is generated, and then a stick figure model is generated based on the multi-branch tree structure, so that the stick figure model is effectively modeled as a multi-branch tree structure, wherein each bone point (joint node) has its own rotation, translation and other characteristics, and the node position and proportion can be locally controlled and globally updated through tree transfer attributes. This multi-branch tree structure is convenient for processing various posture changes of the stick figure model, which not only ensures the accuracy and reliability of the stick figure model generation, but also the stick figure model generated by the multi-branch tree structure is simple and easy to operate, thereby reducing the learning cost of the operator and further improving the practicality of the method.
[0137] Figure 4 A flowchart of obtaining an adjusted stick figure model in response to a posture adjustment operation input by a user is provided for an exemplary embodiment of the present application; based on the above embodiment, refer to the attached Figure 4 As shown, since the reference images correspond to different image sources, the reference images from different image sources have different posture adjustment capabilities. For example, for reference images from the platform, the reference images can support posture adjustment operations on the reference subject through the display interface of the reference image; for reference images uploaded by users, the reference images do not support posture adjustment operations on the reference subject through the display interface of the reference image. Based on this, this embodiment provides a technical solution for implementing posture adjustment operations based on posture adjustment capabilities corresponding to different reference images. In this case, in response to the posture adjustment operation input by the user, obtaining an adjusted stick figure model may include:
[0138] Step S401: When the reference image supports an overall posture adjustment operation for the reference subject, in response to the overall posture adjustment operation input by the user for the reference subject, an adjusted posture model is obtained. Alternatively,
[0139] First, the interactive operations designed in the embodiments of the present application include two types of interactive operations: local interactive operations and overall interactive operations, wherein the local interactive operation can be to drag any joint node (or vertex) in combination with a mouse event, update the position information of the above-mentioned joint node, and trigger the relevant joint nodes / connection lines / bounding boxes / and display icons to be re-rendered. The overall interactive operation can refer to: performing operations such as translation, rotation, scaling, and mirroring on the reference image, canvas, or stick figure model as a whole. At this time, only the data information in the joint node is updated, which will change around the center point. However, the relative position relationship between any two joint nodes of the stick figure model will remain unchanged, so that the skeleton of the stick figure model dynamically maintains the structural relationship.
[0140] After acquiring the reference image, the reference image can be analyzed and processed first to identify whether the reference image supports the overall posture adjustment operation for the reference subject. In some instances, the above-mentioned identification operation can be implemented by an image recognition model. At this time, identifying whether the reference image supports the overall posture adjustment operation for the reference subject can include: obtaining a pre-trained image recognition model; inputting the reference image into the image recognition model for analysis and processing to output an identification result of whether the reference image supports the overall posture adjustment operation for the reference subject. The identification result can include a first result for identifying that the overall posture adjustment operation for the reference subject is supported; or, the identification result can include a second result for identifying that the overall posture adjustment operation for the reference subject is not supported.
[0141] In other instances, the above-mentioned recognition operation can not only be implemented through the image recognition model, but also can be implemented by analyzing and matching the reference image through an optional image library. At this time, before obtaining the adjusted stickman model in response to the posture adjustment operation input by the user, the method in this embodiment may further include: obtaining an optional image library, the optional image library including multiple optional images for implementing the image generation operation; when the optional image library includes a target optional image that matches the reference image, determining that the reference image supports the overall posture adjustment operation for the reference subject; when the optional image library does not include a target optional image that matches the reference image, determining that the reference image does not support the overall posture adjustment operation for the reference subject.
[0142] In one embodiment, the image generation device or the platform on which the image generation device resides provides a plurality of selectable images for user selection, the plurality of selectable images forming a selectable image library, and each selectable image in the selectable image library supports an overall posture adjustment operation for a reference subject. Therefore, in order to accurately identify whether an obtained reference image supports an overall posture adjustment operation for a reference subject, the selectable image library can be first obtained, and then a detection can be made as to whether the selectable image library includes a selectable image that matches the reference image. If the selectable image library includes a target selectable image that matches the reference image, it indicates that the obtained reference image is from the selectable image library, and it can be determined that the reference image at this time supports an overall posture adjustment operation for the reference subject. If the selectable image library does not include a target selectable image that matches the reference image, it indicates that the obtained reference image is not from the selectable image library, and it can be determined that the reference image at this time does not support an overall posture adjustment operation for the reference subject. This effectively and accurately identifies whether the obtained reference image supports an overall posture adjustment operation for a reference subject, and then facilitates the user to adopt different posture adjustment methods to implement the posture adjustment operation based on the above identification result, thereby improving the flexibility and reliability of image generation.
[0143] Specifically, if the recognition result shows that the reference image supports overall posture adjustment operations for the reference subject, then it means that the user can directly adjust the overall posture of the reference subject through the reference image. At this time, the user can input the overall posture adjustment operation for the reference subject displayed in the reference image. The above-mentioned overall posture adjustment operation can be implemented through voice interaction, or the overall posture adjustment operation can be generated by the user through preset controls in the real interface. Then, based on the above-mentioned overall posture adjustment operation, the adjusted stickman model can be obtained. At this time, the adjusted stickman model corresponds to the adjusted reference subject in the reference image, and the adjusted stickman model at this time is not displayed on the interactive interface; or, the adjusted stickman model at this time can be displayed on one side of the interactive interface.
[0144] In some instances, the overall posture adjustment operation input by the user for the reference subject displayed in the reference image can be implemented through at least one image adjustment control displayed in the reference image. At this time, in response to the overall posture adjustment operation input by the user for the reference subject, obtaining the adjusted stickman model may include: displaying at least one image adjustment control in the reference image, and the image adjustment control is used to implement the overall posture adjustment operation of the reference subject; in response to the posture adjustment operation input by the user for any image adjustment control, obtaining the adjusted stickman model.
[0145] Among them, displaying at least one image adjustment control in the reference image can include: obtaining a subject bounding box corresponding to the reference subject, the subject bounding box can be implemented as a rectangular bounding box or a rounded rectangular bounding box; and then displaying at least one image adjustment control at the top corner of the subject bounding box, and the at least one image adjustment control displayed can include at least one of the following: a translation adjustment control for implementing an overall translation operation; a zoom adjustment control for implementing an overall zoom operation; a rotation adjustment control for implementing an overall rotation operation; and a mirror adjustment control for implementing a horizontal mirror operation.
[0146] After at least one image adjustment control is displayed in the reference image, the user can selectively input a posture adjustment operation for any image adjustment control as needed, and then perform a corresponding posture adjustment operation based on the posture adjustment operation obtained, thereby obtaining an adjusted stick figure model. For example, when the user inputs a selection operation for the translation adjustment space, the translation adjustment operation input by the user for overall translation of the reference subject in the reference image can be obtained, and then the overall translation operation can be performed based on the above-mentioned translation adjustment operation obtained, thereby obtaining an adjusted stick figure model after the translation adjustment operation. The adjusted stick figure model corresponds to the posture of the reference subject after the translation operation, thus effectively enabling the user to directly perform the posture adjustment operation of the reference subject through the reference image and directly view the effect of the posture adjustment operation, thereby effectively ensuring the accuracy and reliability of the posture adjustment operation.
[0147] Step S402: When the reference image does not support an overall posture adjustment operation for the reference subject, in response to a posture adjustment operation input by the user for the posture model, an adjusted posture model is obtained.
[0148] If the recognition result is that the reference image does not support the overall posture adjustment operation for the reference subject, then it means that the user cannot directly adjust the overall posture of the reference subject through the reference image. At this time, in order to enable flexible posture adjustment operations for the reference subject in the reference image, the stick figure model display mode can be entered. Among them, the present application provides two display modes for posture adjustment operations, namely the reference image display mode and the stick figure model display mode. When in the reference image display mode, the reference image can be displayed in the interactive interface; when in the stick figure model display mode, the stick figure model can be displayed in the interactive interface. The above two display modes can be switched through a preset "adjust posture" control. In some instances, after obtaining the reference image, the method in this embodiment may also include: displaying the adjustment posture control in the reference image; and displaying the stick figure model and multiple editable joint nodes in the stick figure model in response to a selection operation input for the adjustment posture control.
[0149] For details, please refer to the attached Figure 4a As shown, an "adjust posture" control for switching the display mode is displayed in the display page of the reference image. When the user inputs a click operation on the "adjust posture" control, the display mode of the stickman model can be entered, that is, the stickman model is displayed in the interactive interface.
[0150] Furthermore, in order to remind the user that they can edit the joint nodes in the stickman model or adjust the posture, the stickman model and the joint nodes can be displayed in combination with the motion effects. At this time, displaying the stickman model and multiple editable joint nodes in the stickman model can include: determining the motion effect display information and the motion effect display duration corresponding to the stickman model; based on the motion effect display information and the motion effect display duration, displaying the stickman model and multiple editable joint nodes in the stickman model.
[0151] Among them, for the display mode of the stickman model, the user can configure the display dynamic effect of the stickman model, and specifically can flexibly configure the display dynamic effect and display duration of the stickman model. When the configuration is completed and the stickman model display mode is entered, the dynamic effect display information corresponding to the stickman model and the dynamic effect display duration corresponding to the dynamic effect display information can be determined. The above-mentioned dynamic effect display information may include at least one of the following: dynamic effect display type, dynamic effect display speed, dynamic effect display implementation data, etc. After obtaining the dynamic effect display information and the dynamic effect display duration, the stickman model and multiple editable joint nodes in the stickman model can be displayed based on the dynamic effect display information and the dynamic effect display duration. For example, when the user first enters the display mode of the stickman model, the following animation effects can be configured: the joint nodes are scaled (the size changes), and the transparency cycles between 30% and 100%, so as to conveniently remind the user that the displayed stickman model and the joint nodes of the stickman model support editing or posture adjustment operations, thereby improving the good user interaction experience to a certain extent.
[0152] It should be noted that the animation effect can be displayed not only when the user enters the display mode of the stickman model, but also when the user clicks to generate the target image, so as to remind the user that the target image generation operation is currently in progress, so that the user can timely understand the current image generation status through the displayed animation effect, which is conducive to improving the user's good experience.
[0153] After entering the display mode of the stick figure model, the user can input a posture adjustment operation for the stick figure model, so that an adjusted stick figure model can be obtained based on the obtained posture adjustment operation. In some instances, the adjusted stick figure model can be obtained by the user inputting a posture adjustment operation for any image adjustment control and / or a posture adjustment operation for at least one joint node in the stick figure model. In this case, in response to the posture adjustment operation input by the user for the stick figure model, obtaining the adjusted stick figure model may include: displaying at least one image adjustment control in the canvas where the stick figure model is located, the image adjustment control being used to implement an overall posture adjustment operation for the stick figure model; and obtaining the adjusted stick figure model in response to the posture adjustment operation input by the user for any image adjustment control and / or in response to the posture adjustment operation input by the user for at least one joint node.
[0154] Specifically, after entering the display mode of the stick figure model, at least one image adjustment control can be displayed on the canvas where the stick figure model is located. The image adjustment control can be implemented as at least one of the following: a translation adjustment control for implementing a translation operation, a zoom adjustment control for implementing a zoom operation, a rotation adjustment control for implementing a rotation operation, and a mirror adjustment control for implementing a horizontal mirror operation. The user can then input a posture adjustment operation for any of the displayed image adjustment controls as needed. In this case, the posture adjustment operation is a global posture adjustment operation. The adjusted stick figure can then be obtained based on the obtained posture adjustment operation. Alternatively, since the joint nodes in the stick figure model support editing operations, the user can also input a posture adjustment operation for at least one shutdown node in the stick figure model as needed. In this case, the posture adjustment operation is a local posture adjustment operation. This also implements the posture adjustment operation and obtains the adjusted stick figure model. Alternatively, the user can perform multiple posture adjustment operations on the stick figure model, some of which can be implemented through the image adjustment controls, and the remaining posture adjustment operations can be implemented through at least one joint node.
[0155] Among them, when the user inputs a posture adjustment operation for at least one joint node in the stickman model, in order to reduce the number of posture adjustment operations of the user, the forward kinematics rule can be used to implement the posture adjustment operation. At this time, in response to the posture adjustment operation input by the user for at least one joint node, obtaining the adjusted stickman model can include: obtaining the forward kinematics rule and the multi-tree structure corresponding to the stickman model; in response to the posture adjustment operation input by the user for at least one joint node, determining the posture adjustment parameters; based on the forward kinematics rule and the multi-tree structure, determining at least one operation joint node corresponding to the posture adjustment operation, the operation joint node includes at least one of the following: a selected joint node, a child node of the selected joint node, and a parent node corresponding to the selected joint node; adjusting the position of at least one operation joint node based on the posture adjustment parameters to obtain the adjusted stickman model.
[0156] In the process of adjusting the local posture of the stick figure model, in order to avoid the user needing to move or drag each joint node, a forward kinematics rule and a multi-branch tree structure corresponding to the stick figure model can be obtained. The multi-branch tree structure includes multiple joint nodes with a hierarchical relationship. For example, a root node can correspond to multiple parent nodes, and a parent node can correspond to multiple child nodes. When the parent node changes its posture, the child nodes corresponding to the parent node also change their posture synchronously; when the root node changes its posture, the parent node and child nodes corresponding to the root node also change their posture synchronously, etc. Specifically, after obtaining a posture adjustment operation input by the user for at least one joint node, a posture adjustment parameter can be obtained. The posture adjustment parameter can include at least one of the following: a translation adjustment parameter, a rotation adjustment parameter, a mirror adjustment parameter, etc.; then, based on the forward kinematics rule and the multi-branch tree structure, at least one operation joint node corresponding to the posture adjustment operation can be determined. The determined operation joint node can refer to the joint node that the posture adjustment operation can affect. It is understandable that different posture adjustment operations correspond to different operation joint nodes.
[0157] After obtaining at least one operating joint node, a position adjustment operation can be performed on at least one operating joint node based on the posture adjustment parameter. The position adjustment operation at this time is specifically a synchronous position adjustment operation on at least one operating joint node, for example: Figure 4b As shown, when joint node A in the stick figure model rotates locally around its parent joint node C, it also drives all of its child joint nodes B to rotate around their parent joint nodes, causing joint node A to change position to joint node A' and child joint node B to change position to joint node B'. When the upper body of the stick figure model is dragged and moved, the neck joint node can be dragged and moved, which can drive all the joint nodes of the upper body to translate accordingly. The principle is basically similar to the rotation scheme. This avoids the need for users to make multiple adjustments to other joint nodes, simplifies the number of posture adjustment operations, and allows users to quickly and stably obtain the adjusted stick figure model.
[0158] Furthermore, in order to facilitate understanding of how to obtain the adjusted stick figure model under different posture adjustment operations in the embodiment of the present application, the following describes the process of obtaining the adjusted stick figure model based on different image adjustment controls:
[0159] Example 1: When the image adjustment control includes a translation adjustment control for implementing a translation operation, the user can implement an overall translation operation on the stickman model through the displayed translation adjustment control. At this time, in response to a posture adjustment operation input by the user for any image adjustment control, obtaining the adjusted stickman model may include: obtaining a movement offset in response to the posture adjustment operation input by the user for the translation adjustment control; and performing an overall translation of the stickman model and the bounding box corresponding to the stickman model based on the movement offset to obtain the adjusted stickman model.
[0160] Among them, when the user has a need to translate the stick figure model as a whole, the user can input a posture adjustment operation for the displayed translation adjustment control. The posture adjustment operation can be a translation operation of the mouse in the plane where the canvas is located. Then, the movement offset can be obtained through the above-mentioned posture adjustment operation. In some instances, the movement offset can be determined by analyzing and processing the starting point and the end point of the mouse movement. After obtaining the movement offset, the stick figure model and the bounding box corresponding to the stick figure model can be translated as a whole based on the movement offset, and then the adjusted stick figure model after the overall translation can be obtained. At this time, the posture of the adjusted stick figure model has undergone a translation operation relative to the original stick figure model.
[0161] Furthermore, in order to ensure that the display posture of the stickman model is consistent with the posture data corresponding to the stickman model, after obtaining the adjusted stickman model, it is necessary to update the historically stored posture data based on the adjusted stickman model. At this time, the method in this embodiment may also include: obtaining the original position information of the joint nodes in the stickman model and the original center position of the bounding box corresponding to the stickman model; determining the target position information of the joint nodes based on the movement offset and the original position information; determining the target center position of the bounding box based on the movement offset and the original center position; and associating the target position information, the target center position, and the adjusted stickman model.
[0162] For the stickman model, after the translation operation, the posture data of the stickman model will undergo corresponding changes. In order to ensure that the display posture of the stickman model is consistent with the posture data corresponding to the stickman model, after obtaining the adjusted stickman model, it is necessary to calculate the posture-related data corresponding to the adjusted stickman model. Specifically, the original position information of the joint node that can identify the stickman model in the original posture and the original center position of the bounding box can be obtained first. After the offset operation, the target position information of the joint node after the move can be determined based on the movement offset and the original position information. The target position information is used to identify the adjusted posture corresponding to the adjusted stickman model.
[0163] Similarly, the target center position of the bounding box after the offset operation can also be determined based on the moving offset and the original center position of the bounding box. The target center position can identify the display position of the adjusted stickman model in the canvas. In this way, the adjusted posture and display position corresponding to the adjusted stickman model can be clearly determined through the target position information of the joint node and the target center position of the bounding box. The above-mentioned target position information, target center position and adjusted stickman model can then be associated and stored, so that in the process of the posture change of the stickman model, the posture-related data corresponding to the stickman model will also be updated and changed synchronously, which is conducive to ensuring that the display posture of the stickman model is consistent with the posture data corresponding to the stickman model, thereby helping to improve the accuracy and reliability of the posture adjustment operation.
[0164] It should be noted that, in the process of translating the stickman model as a whole, the translation operation may exceed the preset boundary (for example: determining whether the offset corresponding to the offset operation exceeds 2 / 3 of the canvas boundary), thereby making the stickman model unable to be displayed normally. In order to avoid the above situation, after obtaining the moving offset, you can first identify whether the moving offset can be executed. At this time, the method in this embodiment may also include: obtaining the moving boundary corresponding to the stickman model; when the moving offset is less than or equal to the parameter corresponding to the moving boundary, allowing the stickman model and the bounding box corresponding to the stickman model to be translated as a whole based on the moving offset; when the moving offset is greater than the parameter corresponding to the moving boundary, prohibiting the stickman model and the bounding box corresponding to the stickman model to be translated as a whole based on the moving offset.
[0165] For a stick figure model, to achieve reasonable and effective translation of the stick figure model, after obtaining the movement offset, the movement boundary corresponding to the stick figure model can be obtained. In some instances, the movement boundary can be determined by a user-specified operation; alternatively, the movement boundary can be implemented as the boundary corresponding to the canvas. Because the movement boundary defines the reasonable range for translation of the stick figure model, after obtaining the movement offset, the movement boundary and the movement offset can be analyzed and compared to determine whether the movement offset is less than or equal to the parameter corresponding to the movement boundary.
[0166] When the moving offset is less than or equal to the parameter corresponding to the moving boundary, it means that the translation operation at this time occurs within the specified reasonable operating range, and then the stickman model and the bounding box corresponding to the stickman model are allowed to be translated as a whole based on the moving offset; when the moving offset is greater than the parameter corresponding to the moving boundary, it means that the translation operation at this time has exceeded the specified reasonable operating range. In order to ensure the quality and effect of the display of the stickman model, the stickman model and the bounding box corresponding to the stickman model can be prohibited from being translated as a whole based on the moving offset. This effectively realizes the selective judgment of whether to perform a real translation operation based on different moving offsets, which is conducive to improving the stability and reliability of the overall translation operation of the stickman model.
[0167] Example 2: When the image adjustment control includes a rotation adjustment control for implementing a rotation operation, the user can implement an overall rotation operation on the stickman model through the rotation adjustment control. At this time, in response to a posture adjustment operation input by the user for any image adjustment control, obtaining the adjusted stickman model may include: obtaining a rotation angle in response to the posture adjustment operation input by the user for the rotation adjustment control; rotating the stickman model and the bounding box corresponding to the stickman model as a whole based on the rotation angle to obtain the adjusted stickman model.
[0168] Among them, when the user has the need to rotate the stickman model as a whole, the user can input a posture adjustment operation for the displayed rotation adjustment control. The posture adjustment operation can be a translation operation or a drag operation of the mouse in the plane where the canvas is located, etc., and then the rotation angle can be obtained through the above-mentioned posture adjustment operation. In some instances, the rotation angle can be determined by detecting the starting point and the ending point of the mouse rotation for analysis and processing. Specifically, in response to the posture adjustment operation input by the user for the rotation adjustment control, obtaining the rotation angle may include: in response to the posture adjustment operation input by the user for the rotation adjustment control, obtaining the rotation starting point and the rotation end point; determining the center point of the stickman model, wherein the center point of the stickman model can be determined by performing a centering operation on all joint nodes included in the stickman model; and then the rotation angle can be determined based on the rotation starting point, the center point and the rotation end point.
[0169] In other instances, the rotation angle can also be determined through human-computer interaction operations. In this case, in response to the posture adjustment operation input by the user for the rotation adjustment control, obtaining the rotation angle may include: determining the rotation starting point and the rotation end point in response to the posture adjustment operation input by the user for the rotation adjustment control; displaying an interactive control for the user to input the rotation angle in the display interface; and obtaining the interactive operation input by the user in the interactive control. In this way, the rotation angle can also be obtained stably.
[0170] like Figure 4c As shown in the figure, when the user uses the mouse to perform the rotation operation, the StartPoint (recorded as the rotation starting point B) and EndPoint (recorded as the rotation end point C) positions of the mouse before and after the rotation and dragging in the local coordinate system can be recorded, and the center coordinate Center (recorded as point A) of the stickman model in the local coordinate system can be calculated. Then, the angle formed by BAC can be calculated. The above angle is the rotation angle.
[0171] After obtaining the rotation angle, the stick figure model and its bounding box can be rotated based on the rotation angle to obtain the new coordinate position after the rotation operation. This can then result in an adjusted stick figure model after the overall rotation. At this point, the adjusted stick figure model has been rotated relative to the original stick figure model.
[0172] Furthermore, in order to ensure that the display posture of the stickman model is consistent with the posture data corresponding to the stickman model, after obtaining the adjusted stickman model, it is necessary to update the historically stored posture data based on the adjusted stickman model. At this time, the method in this embodiment may also include: obtaining the original position information of the joint nodes in the stickman model and the original position of the bounding box corresponding to the stickman model; determining the target position information of the joint nodes based on the rotation angle, center point and original position information; determining the target bounding box position based on the rotation angle, center point and original position of the bounding box; and associating and storing the target position information, target bounding box position, rotation angle and adjusted stickman model.
[0173] For the stickman model, after the rotation operation, the posture data of the stickman model will undergo corresponding changes. In order to ensure that the display posture of the stickman model is consistent with the posture data corresponding to the stickman model, after obtaining the adjusted stickman model, it is necessary to calculate the posture-related data corresponding to the adjusted stickman model. Specifically, you can first obtain the original position information of the joint nodes that can identify the stickman model in the original posture, and the original position of the bounding box corresponding to the bounding box, where the original position of the bounding box is used to identify the posture of the bounding box. After the rotation operation, the target position information corresponding to each joint node can be calculated based on the rotation angle, center point and original position information, and the target position information is used to identify the posture information after rotation; similarly, the target bounding box position can also be determined based on the rotation angle, center point and original position of the bounding box, and the target bounding box position is used to identify the target posture of the bounding box; then the target position information, target bounding box position, rotation angle and adjusted stickman model can be associated and stored, so that in the process of the stickman model's posture change, the posture-related data corresponding to the stickman model will also be updated and changed synchronously, which is conducive to ensuring that the display posture of the stickman model is consistent with the posture data corresponding to the stickman model, thereby helping to improve the accuracy and reliability of the posture adjustment operation.
[0174] It should be noted that, in the process of rotating the stickman model as a whole, the rotation operation may exceed the preset boundary, thereby making the stickman model unable to be displayed normally. In order to avoid the above situation, after obtaining the rotation angle, it is possible to first identify and detect whether the rotation angle can be executed. At this time, the method in this embodiment may further include: obtaining the rotation boundary corresponding to the stickman model; when the rotation angle is less than or equal to the parameter corresponding to the rotation boundary, allowing the stickman model and the bounding box corresponding to the stickman model to be rotated as a whole based on the rotation angle; when the rotation angle is greater than the parameter corresponding to the rotation boundary, prohibiting the stickman model and the bounding box corresponding to the stickman model to be rotated as a whole based on the rotation angle. This effectively ensures that the stickman model is rotated reasonably and effectively.
[0175] Example 3: When the image adjustment control includes a zoom adjustment control for implementing a zoom operation, the user can implement an overall zoom operation on the stickman model through the zoom adjustment control. At this time, in response to a posture adjustment operation input by the user for any image adjustment control, obtaining the adjusted stickman model may include: obtaining a zoom parameter in response to the posture adjustment operation input by the user for the zoom adjustment control; and scaling the stickman model and the bounding box corresponding to the stickman model as a whole based on the zoom parameter to obtain the adjusted stickman model.
[0176] Among them, when the user has the need to scale the stickman model as a whole, the user can input a posture adjustment operation for the displayed zoom adjustment control. The posture adjustment operation can be a translation operation or a drag operation of the mouse in the plane where the canvas is located, etc., and then the zoom parameter can be obtained through the above-mentioned posture adjustment operation. In some instances, the zoom parameter can be determined by detecting the zoom starting point and the zoom ending point of the mouse for analysis and processing. Specifically, in response to the posture adjustment operation input by the user for the zoom adjustment control, obtaining the zoom parameter may include: in response to the posture adjustment operation input by the user for the zoom adjustment control, obtaining the zoom operation starting point and the zoom operation end point; determining the center point of the bounding box corresponding to the stickman model; determining the zoom parameter based on the zoom operation starting point, the bounding box center point and the zoom operation end point. Specifically, the zoom parameter can be the distance from the zoom operation end point to the bounding box center point / the distance from the zoom operation starting point to the bounding box center point.
[0177] For example, see the attached Figure 4d As shown, when a user uses the mouse to perform a zoom operation, the local coordinates of the last operation's coordinate position (lastPoint) and the current position (currentPoint) can be obtained. The distances between the two mouse positions and the center point can then be compared to identify whether the current operation is a zoom-in or zoom-out operation. The zoom ratio can also be determined based on the last operation's coordinate position and the current coordinate position. Specifically, the zoom ratio is Scale = distance from the current coordinate to the center / distance from the last operation's coordinate to the center.
[0178] In other instances, the zoom parameters can also be determined through human-computer interaction operations. In this case, in response to the posture adjustment operation input by the user for the zoom adjustment control, obtaining the zoom parameters may include: in response to the posture adjustment operation input by the user for the zoom adjustment control, displaying an interactive control for the user to input the zoom parameter in the display interface; obtaining the interactive operation input by the user in the interactive control, so that the zoom parameters can also be obtained stably.
[0179] After obtaining the scaling parameters, the stick figure model and the bounding box corresponding to the stick figure model can be scaled as a whole based on the scaling parameters, and then the adjusted stick figure model after the overall scaling can be obtained. At this time, the posture of the adjusted stick figure model has been scaled relative to the original stick figure model.
[0180] It should be noted that when scaling the stick figure model, the stick figure model will maintain the relative connection relationship and relative connection distance between the existing joint nodes, so that the overall scaling can be achieved without changing the stick figure model's posture. Figure 4dAs shown, if the user drags the zoom icon, the zoom value is enlarged from 1 times to 1.3 times. Then, for the joint nodes in the stickman model, the position of the latest point should be the position C obtained by extending the extension line from the center point A to the current point B by 1.3 times. The same zoom operation is performed on all joint nodes to complete the overall zooming in / out operation of the stickman model.
[0181] In addition, in order to ensure the effectiveness and rationality of the zoom operation, after obtaining the zoom parameters, it is possible to detect whether the zoom operation corresponding to the zoom parameters is reasonable. At this time, the method in this embodiment may further include: obtaining a zoom restriction area corresponding to the stickman model (for example: the minimum side length after reduction shall not be less than 180px, and the maximum after enlargement shall not exceed the area corresponding to the width and height of the canvas); when the zoom operation corresponding to the zoom parameter is within the zoom restriction area, it means that the zoom operation corresponding to the zoom parameter is relatively reasonable, and thus the stickman model and the bounding box corresponding to the stickman model are allowed to be zoomed as a whole based on the zoom parameter; when the zoom operation corresponding to the zoom parameter is outside the zoom restriction area, it means that the zoom operation corresponding to the zoom parameter is unreasonable, and thus the stickman model and the bounding box corresponding to the stickman model are prohibited from being zoomed as a whole based on the zoom parameter.
[0182] Furthermore, in order to ensure that the display posture of the stickman model is consistent with the posture data corresponding to the stickman model, after obtaining the adjusted stickman model, it is necessary to update the historically stored posture data based on the adjusted stickman model. At this time, the method in this embodiment may also include: obtaining the original position information of the joint nodes in the stickman model and the original position of the bounding box corresponding to the stickman model; determining the target position information of the joint nodes based on the scaling parameters, the center point of the bounding box and the original position information; determining the target bounding box position based on the scaling parameters, the center point and the original position of the bounding box; and associating and storing the target position information, the target bounding box position, the scaling parameters and the adjusted stickman model.
[0183] In some special scenarios, since the original posture of the stickman model may not be a standard horizontal and vertical posture, but a posture with a certain tilt angle, at this time, in order to ensure the accuracy and reliability of the scaling operation of the stickman model, before the stickman model and the bounding box corresponding to the stickman model are scaled as a whole based on the scaling parameters, the stickman model can be pre-adjusted based on the tilt angle of the original posture. At this time, the method in this embodiment may further include: when the original posture corresponding to the stickman model is a tilted posture, obtaining the tilt angle corresponding to the original posture; adjusting the stickman model based on the tilt angle to obtain a stickman model in a standard posture.
[0184] After obtaining the stick figure model and when there is a need to scale the stick figure model, before performing the scaling operation on the stick figure model, it is possible to first identify whether the original posture of the stick figure model is a tilted posture. Specifically, this can be determined by performing a recognition operation on the stick figure model through an image recognition model. When the original posture corresponding to the stick figure model is a tilted posture, the tilt angle corresponding to the original posture can be determined. In some instances, the tilt angle can be determined based on the original posture and a preset standard posture that is horizontal and vertical; or, the tilt angle can be determined by analyzing and comparing the center line corresponding to the original posture and the center line corresponding to the preset standard posture.
[0185] After obtaining the tilt angle, the stick figure model can be adjusted based on the tilt angle. Specifically, the stick figure model can be controlled to rotate in the opposite direction based on the tilt angle, thereby obtaining a standard posture of the stick figure model. The standard posture can be a predefined horizontal and vertical posture that conforms to common sense (for example, head up, feet down). The adjusted stick figure model in the standard posture can then be rotated, which can improve the accuracy and reliability of the rotation operation to a certain extent.
[0186] Furthermore, after obtaining the adjusted stick figure model, since the stick figure model before the rotation operation may or may not have undergone a tilt posture adjustment operation, in order to accurately implement the posture adjustment operation on the original posture of the stick figure model, the method in this embodiment may also include: when the adjusted stick figure model corresponds to an adjustment mark of a tilt posture, obtaining a tilt adjustment angle corresponding to the tilt posture; and adjusting the adjusted stick figure model based on the tilt adjustment angle.
[0187] Specifically, for the stick figure model, before the stick figure model is rotated, if the stick figure model has undergone a tilting posture adjustment operation, an adjustment identifier corresponding to the tilting posture can be generated, and the adjustment identifier can be associated with the stick figure model and stored. When the stick figure model undergoes a posture adjustment operation and becomes an adjusted stick figure model, the above-mentioned association relationship will be updated to an association relationship between the adjustment identifier, the stick figure model and the adjusted stick figure model; if the stick figure model has not undergone a tilting posture adjustment operation, there is no need to generate an adjustment identifier corresponding to the tilting posture.
[0188] In order to accurately identify whether the stick figure model corresponding to the adjusted stick figure model has undergone a tilt posture adjustment operation, it is possible to first identify whether the adjusted stick figure model corresponds to an adjustment mark indicating a tilt posture. Specifically, the identification operation can be achieved by analyzing and matching the adjusted stick figure model using a pre-stored mapping relationship table including the adjustment mark. When the identification result shows that the adjusted stick figure model corresponds to an adjustment mark indicating a tilt posture, it means that the stick figure model corresponding to the adjusted stick figure model has undergone a tilt posture adjustment operation. At this time, in order to achieve a rotation operation on the original posture of the stick figure model, a tilt adjustment angle corresponding to the tilt posture can be obtained. Then, the posture of the adjusted stick figure model can be adjusted based on the tilt adjustment angle, that is, the adjusted stick figure model is restored to its original tilt posture, and a rotation operation is achieved based on the original tilt posture, further ensuring the stability and reliability of the rotation operation on the stick figure model.
[0189] Example 4: When the image adjustment control includes a mirror adjustment control for implementing a horizontal mirror operation, the user can implement an overall mirror operation on the stickman model through the mirror adjustment control. At this time, in response to a posture adjustment operation input by the user for any image adjustment control, obtaining the adjusted stickman model may include: obtaining a mirror trigger parameter in response to the posture adjustment operation input by the user for the mirror adjustment control; horizontally mirroring the stickman model and the bounding box corresponding to the stickman model based on the mirror trigger parameter to obtain the adjusted stickman model.
[0190] Among them, when the user has a need to mirror the entire stick figure model, the user can input a posture adjustment operation for the displayed mirror adjustment control. The posture adjustment operation can be a click operation of the mouse on the mirror adjustment control. Then, based on the posture adjustment operation, a mirror trigger parameter can be obtained. The mirror trigger parameter can be a parameter used to identify whether a mirror operation is required. For example, when the mirror trigger parameter is "1", it can be indicated that the stick figure model needs to be mirrored; when the mirror trigger parameter is "0", it is not required to mirror the stick figure model. After obtaining the mirror trigger parameter, the stick figure model and the bounding box corresponding to the stick figure model can be selectively horizontally mirrored based on the mirror trigger parameter. Specifically, the scale value scal e can be set to scale eX to -1, and scale eY remains unchanged. In this way, the entire stick figure data can be mirrored on the Y axis to obtain the adjusted stick figure model. Then, the adjusted stick figure model after the entire mirroring can be obtained. At this time, the posture of the adjusted stick figure model has been mirrored relative to the original stick figure model.
[0191] In this embodiment, by identifying whether the reference image supports the overall posture adjustment operation for the reference subject, and then selecting different methods to implement the posture adjustment operation based on different identification results, the flexibility and reliability of the posture adjustment operation are effectively improved. Specifically, when the reference image supports the overall posture adjustment operation for the reference subject, the adjusted stickman model is obtained in response to the overall posture adjustment operation input by the user for the reference subject; or, when the reference image does not support the overall posture adjustment operation for the reference subject, the adjusted stickman model is obtained in response to the posture adjustment operation input by the user for the stickman model. This effectively ensures the accuracy and reliability of the acquisition of the adjusted stickman model.
[0192] Figure 5 This is a flow chart of another image generation method provided by an exemplary embodiment of the present application; based on any of the above embodiments, refer to the attached Figure 5 As shown, since the bounding box can change with the change of the posture of the stick figure model, in order to accurately display the bounding box, after obtaining the adjusted stick figure model, the display position of the bounding box can be determined based on the adjusted stick figure model and the shape of the bounding box, so as to accurately display the bounding box. In this case, the method in this embodiment may further include:
[0193] Step S501: Determine the shape of the bounding box corresponding to the adjusted posture model.
[0194] Among them, for the bounding box, bounding boxes of different shapes can be configured in different application scenarios, such as: a rectangular bounding box, a rounded rectangular bounding box, a circular bounding box or a square bounding box, etc. Since the display position of the bounding box is related to the edge of the bounding box, and the edge of the bounding box is closely related to the shape of the bounding box, therefore, in order to accurately display the bounding box corresponding to the adjusted stickman model, the shape of the bounding box corresponding to the adjusted stickman model can be determined first. The shape of the bounding box can be a system default shape or a user-specified shape.
[0195] Step S502: Determine the display position of the bounding box based on the adjusted posture model and shape.
[0196] Among them, the adjusted stickman model may correspond to: position data of each joint node, posture adjustment related data, etc. After obtaining the shape of the bounding box, the adjusted stickman model and the shape of the bounding box may be analyzed and processed to determine the display position of the bounding box.
[0197] In some instances, the display position of the bounding box can be determined by a position calculation model. At this time, based on the adjusted stickman model and shape, determining the display position of the bounding box can include: obtaining a pre-trained position calculation model; sending relevant data of the adjusted stickman model and the shape of the bounding box to the position calculation model, so as to obtain the display position of the bounding box output by the position calculation model.
[0198] In other instances, the display position of the bounding box can be determined not only by a position calculation model, but also by constructing a coordinate system corresponding to the adjusted stickman model. At this time, based on the adjusted stickman model and shape, determining the display position of the bounding box may include: when the shape is a rectangle, constructing a coordinate system corresponding to the adjusted stickman model; determining the projection information of each joint node in the adjusted stickman model relative to the coordinate system; determining the minimum projection information and the maximum projection information in the projection information of each joint node; and determining the display position of the bounding box based on the minimum projection information and the maximum projection information.
[0199] Among them, since the bounding box is a display frame used to surround or wrap the adjusted stickman model, it can be determined by the projection boundary information of the adjusted stickman model in a preset coordinate system. Specifically, a coordinate system corresponding to the adjusted stickman model can be constructed first. The coordinate system can be a two-dimensional coordinate system, where the horizontal axis is used to identify the width of the stickman model and the vertical axis is used to identify the height of the stickman model; then the adjusted stickman model can be projected and displayed in the coordinate system, so that the projection information of each joint node relative to the coordinate system can be obtained, and then the minimum projection information and the maximum projection information can be determined in the projection information of each joint node. Specifically, the distance between the minimum projection information and the maximum projection information in the width direction can identify the width of the bounding box, and the distance between the minimum projection information and the maximum projection information in the height direction can identify the height of the bounding box. Therefore, after obtaining the minimum projection information and the maximum projection information, the display position of the bounding box can be determined by analyzing and calculating the minimum projection information and the maximum projection information.
[0200] In some instances, determining the display position of the bounding box based on the minimum projection information and the maximum projection information may include: determining the upper left corner position and the lower right corner position of the bounding box based on the minimum projection information and the maximum projection information; and determining the display position of the bounding box based on the upper left corner position and the lower right corner position.
[0201] In other instances, determining the display position of the bounding box based on the minimum projection information and the maximum projection information may include: obtaining a first distance between the minimum projection information and the maximum projection information in the height direction and a second distance between the minimum projection information and the maximum projection information in the width direction; then determining the interval distance between the pre-configured bounding box and the adjusted stickman model; determining the display position of the bounding box based on the interval distance, the first distance, and the second distance; specifically, determining the sum of the first distance and 2 times the interval distance as the height information of the bounding box; determining the sum of the second distance and 2 times the interval distance as the width information of the bounding box, and determining the center point of the bounding box based on the adjusted stickman model, so that the bounding box corresponding to the adjusted stickman model can be determined and displayed.
[0202] Reference Attachment Figure 5a As shown, when the bounding box is implemented as a rectangular bounding box, in order to be able to draw the corresponding bounding box according to the latest adjusted stick figure model, we can first construct the coordinate system hv in which the bounding box sits, that is, the unit vectors hVec = [1, 0] and vVec = [0, 1] in the horizontal and vertical directions. Then, let the unit vectors hVec and vVec of the bounding box apply the current rotation value of the adjusted stick figure model, that is, rotate the corresponding value around the center point of the adjusted stick figure model, and obtain the new unit vectors hVec' and vVec', as shown in Figure 5b shown.
[0203] Then, the projection lengths of all joint nodes on the adjusted stickman model in the direction of the unit vectors hVec' and vVec' can be calculated respectively, and the shortest projection length minH, the longest projection length maxH of all points in the hVec' coordinate direction, and the shortest projection length minV, the longest projection length maxV in the vVec' coordinate direction can be recorded. Then, based on the above shortest projection length minH, longest projection length maxH, shortest projection length minV, and longest projection length maxV, the coordinates of the upper left corner, upper right corner, lower left corner, and lower right corner of the bounding box can be restored. The following takes the restoration of the coordinates of the upper left corner as an example:
[0204] In the H coordinate direction, it is minH, so the projection vector in the H direction is minH*hVec; the projection length in the V coordinate direction is minV, so the projection vector in the V direction is minV*vVec; then add the projection vectors in the V coordinate direction and the H coordinate direction to get the coordinate point of the upper left corner. In this way, the coordinates of the upper left corner can be obtained through the data conversion operation in the coordinate system:
[0205] const topLeftV=new Po i nt(minV*vVec.x, minV*vVec.y);
[0206] const topLeftH=new Po i nt(minH*hVec.x, minH*hVec.y);
[0207] const topLeft=new Po i nt(topLeftV.x+topLeftH.x, topLeftH.y+topLeftH.y).
[0208] Similarly, the coordinates of the other upper right corner, lower left corner, and lower right corner can be determined in a similar manner as described above, which will not be repeated here.
[0209] In addition, when the shape of the bounding box is a rounded rectangle, it is also necessary to calculate the arc start point and arc end point in the rounded rectangle so that the bounding box can be displayed stably. At this time, based on the upper left corner position and the lower right corner position, determining the display position of the bounding box may include: when the shape is a rounded rectangle, determining the corner radius corresponding to the rounded rectangle; based on the upper left corner position and the lower right corner position, determining the length information and width information of the rounded rectangle; based on the corner radius, the upper left corner position and the lower right corner position, determining the arc start point and arc end point corresponding to the rounded rectangle, wherein the arc start point and arc end point corresponding to the rounded rectangle can be determined by inferring the corner radius, the upper left corner position and the lower right corner position through the trigonometric function relationship, and then determining the display position of the bounding box based on the arc start point and arc end point, thereby effectively ensuring the accuracy and reliability of determining the display position of the bounding box.
[0210] Reference Attachment Figure 5c As shown, the bounding box can be implemented as a bounding box with a fillet radius of 8 pixels. At this time, in order to accurately display the bounding box, it is necessary to calculate the coordinates of the arc starting point Q1 and the arc end point on the bounding box. To calculate the coordinates of Q1, first calculate the angle rad of Q1 P1 P5. Specifically, according to the trigonometric function relationship shown in the figure, cos (rad) = deta lX / 8 of Q1 can be obtained, and the x coordinate of Q1 = P1.x + cos (rad) * 8 can be obtained, where P1 is the coordinate position of the upper left corner of the bounding box calculated in the above embodiment.
[0211] Similarly, the y-axis coordinate of Q1 can be obtained using sin(rad). Specifically, sin(rad) = Q1's detalY / 8, which yields Q1's y-axis coordinate = P1.y + sin(rad)*8. Using a similar method, the coordinates of the arc's endpoints can be calculated. After obtaining the coordinates of each arc's starting and ending points, a rounded rectangular bounding box can be drawn according to the point trajectory, effectively ensuring flexible and reliable bounding box display.
[0212] Step S503: Displaying a bounding box at the display position.
[0213] After determining the display position of the bounding box, the bounding box may be directly displayed at the display position, so that the user can directly view the adjusted stick figure model and the bounding box corresponding to the adjusted stick figure model through the display interface.
[0214] In this embodiment, by determining the shape of the bounding box corresponding to the adjusted stickman model, and then determining the display position of the bounding box based on the adjusted stickman model and shape, and displaying the bounding box at the display position, it is effectively achieved that the shape, size and display posture of the bounding box can be updated along with the update of the stickman model. Through the displayed bounding box and the adjusted stickman model, the user can more intuitively view the effect of the posture adjustment, which is conducive to improving the good experience of user interaction.
[0215] Figure 6 A flowchart of another image generation method provided by an exemplary embodiment of the present application; based on any of the above embodiments, refer to the attached Figure 6 As shown, after obtaining the adjusted stickman model, the operation can be rolled back according to the data stored in the data stack. In this case, the method in this embodiment can further include:
[0216] Step S601: Acquire an operation rollback request corresponding to the posture model.
[0217] After obtaining the adjusted stick figure model, posture adjustment data and adjusted posture data corresponding to the adjusted stick figure model are obtained; the adjusted posture data and posture adjustment data are stored in a preset data stack, wherein the posture adjustment data may include at least one of the following: a translation percentage value, a rotation angle relative to the original posture, a scale relative to the original state, a mirror value (information indicating whether a mirror image has occurred), etc., and the adjusted posture data may include: the position percentage of the stick figure vertex relative to the upper left corner of the bounding box, the positions of the upper left corner and the lower right corner of the bounding box, etc. The data stack includes a first data stack for storing the data of the previous operation and a second data stack for storing the data of the next operation. When a posture adjustment operation is performed on the stick figure model, the relevant data generated by the current posture adjustment operation can be stored in the second data stack.
[0218] Step S602: determining historical gesture data and historical gesture adjustment data corresponding to the operation rollback request in the first data stack.
[0219] In order to implement operation rollback, after obtaining the operation rollback request, the historical posture data and historical posture adjustment data corresponding to the operation rollback request can be searched or determined in the first data stack. Specifically, the historical posture data and historical posture adjustment data can be searched and determined in the first data stack through timestamp information.
[0220] Step S603: Based on the historical posture data and the historical posture adjustment data, the posture model is reverted from the current posture to the historical posture.
[0221] Since the historical posture data is used to identify the posture data corresponding to the stickman model during the previous posture adjustment operation, and the historical posture adjustment data is used to identify which posture adjustment operations were performed on the stickman model in the previous step, after obtaining the historical posture data and the historical posture adjustment data, the stickman model can be directly reverted from the current posture to the historical posture based on the historical posture data and the historical posture adjustment data. The historical posture is the posture corresponding to the historical posture data, thereby effectively realizing the reversion operation.
[0222] Furthermore, since the display posture and related logical data corresponding to the stickman model can change with the change of the posture adjustment operation, in order to realize the rollback operation of the posture editing operation, the preset data stack can include the previous step data stack and the next step data stack. The previous step data stack can be used to realize the related logical data of rolling back to the previous step operation, and the next step data stack can be used to realize the related logical data of implementing the next step operation.
[0223] For example, after generating a stick figure model corresponding to the reference subject, the user can input multiple posture adjustment operations for the stick figure model. For example, if there are 6 posture adjustment operations for the stick figure model, the relevant logical data corresponding to each posture adjustment operation can be obtained, and the relevant logical data corresponding to the first 6 posture adjustment operations can be stored in the previous step data stack. When the user performs a rollback operation on the stick figure model, the relevant logical data corresponding to the 5th posture adjustment operation can be obtained from the previous step data stack, and the relevant logical data corresponding to the 6th posture adjustment operation can be stored in the next step data stack. In this way, the rollback operation of the posture adjustment operation for the stick figure model can be implemented through the previous step data stack and the next step data stack, further improving the flexibility and reliability of the use of this method.
[0224] Furthermore, the method in this embodiment can not only realize the operation rollback function, but also realize the rollback cancellation function. At this time, the method in this embodiment can also include: obtaining a rollback cancellation request corresponding to the stickman model; determining the posture data to be restored and the posture adjustment data to be restored corresponding to the rollback cancellation request in the second data stack; based on the posture data to be restored and the posture adjustment data to be restored, restoring the stickman model from the historical posture of the rollback to the current posture.
[0225] Among them, the specific implementation process and implementation principle of the rollback and undo operation in this embodiment are similar to the specific implementation process and implementation principle of the operation rollback in the above embodiment. Please refer to the above statements for details and will not be repeated here.
[0226] In this embodiment, by obtaining an operation rollback request corresponding to the stick figure model, the historical posture data and the historical posture adjustment data corresponding to the operation rollback request are determined in the first data stack, and then based on the historical posture data and the historical posture adjustment data, the stick figure model is rolled back from the current posture to the historical posture, thereby effectively achieving the ability to perform a rollback operation during the posture adjustment of the stick figure model, thereby avoiding the problem of the user affecting the image generation efficiency due to misoperation, and further improving the flexibility and reliability of the method.
[0227] Figure 7 A flowchart of obtaining an adjusted stick figure model in response to a posture adjustment operation input by a user is provided in an exemplary embodiment of the present application; based on any of the above embodiments, refer to the attached Figure 7 As shown, for the posture adjustment operation, the user can implement the posture adjustment operation not only through the reference image or the stick figure model, but also through the canvas. In this case, in response to the posture adjustment operation input by the user, obtaining the adjusted stick figure model may include:
[0228] Step S701: Displaying a canvas adjustment control for overall adjustment of the canvas of the posture model.
[0229] The canvas adjustment control includes at least one of the following: a canvas zoom control for implementing a zoom operation, a canvas translation control for implementing a translation operation, a canvas rotation control for implementing a rotation operation, a canvas mirror control for implementing a canvas mirror operation, and the like.
[0230] Step S702: In response to a posture adjustment operation input by the user to the canvas adjustment control, an adjusted posture model is obtained.
[0231] In some instances, the canvas adjustment control may include a canvas zoom control for implementing a zoom operation; at this time, in response to a gesture adjustment operation input by the user to the canvas adjustment control, obtaining the adjusted stickman model may include: obtaining the current zoom parameters of the canvas in response to the gesture adjustment operation input by the user to the canvas zoom control; determining the original center position and original size information of the canvas; based on the original center position, original size information and current zoom parameters, determining the target center position and target size information of the canvas; performing an overall zoom operation on the canvas and the stickman model based on the target center position and target size information to obtain the adjusted stickman model.
[0232] Among them, after obtaining the current scaling parameters, the target center position and target size information of the canvas after the scaling operation can be determined based on the original center position and original size information of the canvas, and then the canvas and the stickman model can be scaled as a whole based on the target center position and target size information. Since the relative posture between the stickman model and the canvas remains unchanged, the adjusted stickman model can be directly obtained during the scaling operation of the canvas.
[0233] Specifically, before and after scaling the canvas corresponding to the stick figure model, the stick figure model will also be scaled proportionally, and the relative positions of any two joint nodes in the stick figure model will remain unchanged. In some instances, after obtaining the posture adjustment operation input by the user for the canvas adjustment control, the latest rendering data of the stick figure model can be obtained from the top of the data stack. The rendering data may include: the position information of each joint in the stick figure model, the translation percentage information, the rotation parameter, the scaling parameter, and the mirror value. The above-mentioned translation percentage value is determined based on the X and Y percentage of the current stick figure's center position to the center position of the background image; the rotation parameter refers to the rotation angle relative to the original posture (or the reference image in the initialization state); the scaling value can refer to the scaling ratio relative to the original posture; and the mirror value is used to identify whether a left-right mirroring operation has occurred. Then, during the scaling operation of the canvas, the stick figure model can be synchronously scaled based on the above-mentioned rendering data and scaling ratio, and the adjusted stick figure model can be obtained.
[0234] It should be noted that during the overall scaling of the canvas, the center of the stick figure model in the canvas will translate. This can be calculated using the following formula, where this.translateX and this.translateY are the percentages of translation corresponding to the current scaling operation of the canvas. The above translation percentages can be obtained by detecting the distance moved by the mouse to determine the center coordinates of the canvas (bgCenterX, bgCenterY). Then, the center coordinates of the canvas after the overall scaling can be obtained using the following formula:
[0235] const offsetX=bgCenterX+th is.translateX*width;
[0236] const offsetY=bgCenterY+th is.translateY*height;
[0237] Width specifies the width of the canvas, and height specifies the height of the canvas. These two parameters can be obtained by scanning the canvas. The center of the canvas, calculated using the above formula, changes with zooming, and the center of the stick figure also changes with the center of the canvas. This ensures that the relative position of the canvas and the stick figure remains consistent across canvases of any size and proportion.
[0238] In other instances, the canvas adjustment control may include a canvas translation control for implementing a translation operation; at this time, in response to a posture adjustment operation input by the user to the canvas adjustment control, obtaining the adjusted stickman model may include: in response to the posture adjustment operation input by the user to the canvas translation control, obtaining the current translation parameters of the canvas; determining the original center position of the canvas; based on the original center position and the current translation parameters, determining the target center position of the canvas; performing an overall translation operation on the canvas and the stickman model based on the target center position to obtain the adjusted stickman model.
[0239] Specifically, the specific implementation method, implementation principle and implementation effect of the above steps in this embodiment are the same as those in the above Figure 4 The specific implementation methods, implementation principles and implementation effects of similar method steps in the corresponding embodiments are similar. Please refer to the above statements for details and will not be repeated here.
[0240] In this embodiment, by displaying a canvas adjustment control for overall adjustment of the canvas of the stick figure model, in response to the posture adjustment operation input by the user to the canvas adjustment control, the adjusted stick figure model is obtained, effectively realizing that the posture adjustment operation can also be performed through the canvas adjustment control, further improving the flexibility and reliability of the use of this method.
[0241] Specifically, based on the above description, the solution provided in the embodiments of the present application can achieve the following effects:
[0242] (1) Overcoming the limitations of the preset posture library;
[0243] The stick figure editor is implemented based on a multi-branch tree structure, allowing users to freely adjust the character's posture; specifically, a non-uniform hierarchical node distribution is adopted to achieve precise isolation of parent-child node attribute inheritance and local control; and, combined with the multi-branch tree structure, it can effectively manage and render changes in various details of the stick figure model in real time; a three-level transmission mechanism of "main control skeleton-auxiliary skeleton-derived skeleton" is constructed to support 30FPS real-time rendering on the Web; in addition, based on the observer mode data pipeline, the μs-level response of editor operations and rendering engines is achieved, and a full-link closed loop of "parameter modification → skeleton drive → node update" is constructed, and the synchronization delay is controlled within 8ms.
[0244] Secondly, two-way data binding is used to ensure real-time synchronization between editing operations and rendering. Specifically, the hierarchical skeletal system is bound to the two-way data stream to achieve real-time response of "local fine-tuning-global synchronization", thereby ensuring real-time synchronization between the user interface and the underlying data. In addition, two operation modes are provided: overall adjustment (rotation, scaling, mirroring, etc.) and local adjustment (single joint dragging). This completely breaks through the limitations of the preset pose library and supports any custom pose. The operation is simple and intuitive, and you can get started quickly without professional 3D skills. The editing time is shortened from several hours of traditional solutions to just a few minutes. Operation rollback is supported to reduce the cost of adjustment errors.
[0245] (2) Overcoming the problem of insufficient cross-industry adaptability;
[0246] Because the multi-branch tree structure can adapt to different human skeleton characteristics, a JSON configuration template is used to define the skeleton structure, supporting rapid expansion. This allows for dynamic reorganization of the human model skeleton structure, greatly improving expansion efficiency. It is also applicable across industries. Furthermore, the forward kinematics algorithm is used to ensure that joint movement conforms to human characteristics, allowing models of different roles and identities in different industries to strike arbitrary poses, while also supporting fine-tuning of poses in existing model images. For merchants, compared to offline photography, the efficiency and cost of generating model product images online are substantially improved, reducing the time from several days to just a few minutes. This can reduce the adaptation development cycle for new industries from two weeks to one day. It supports multiple industry scenarios, including home furnishings, automobiles, and cultural tourism. There is no need to customize a dedicated model system for each industry, significantly reducing cross-industry expansion costs.
[0247] (3) Overcoming the contradiction between rendering efficiency and interactive fluency;
[0248] It is based on lightweight 2D rendering instead of heavyweight 3D rendering, and adopts bounding box dynamic projection algorithm to optimize spatial calculation; it enables the calculation engine to implement efficient data update operations, thereby optimizing the first screen rendering delay of the Web side from 320ms to 85ms; editing operations can respond in real time, and the delay is controlled within 8ms; it supports 30FPS smooth rendering; it is adapted to ordinary device configurations and does not require high-performance hardware. In addition, merchants are allowed to upload pose reference images, fine-tune the pose based on the model's original pose, and allow users to edit the operation retraction and overall / partial pose adjustment, so that non-professional users can save about 20 minutes when creating natural poses for the first time. Overall adjustment supports a variety of operations, including overall model rotation, dragging, mirroring, scaling, operation retraction, background image scaling and movement, etc.; local adjustment follows the principle of forward kinematics, allowing the movement of the parent node to drive the movement of all child nodes, saving pose adjustment time.
[0249] In summary, the technical solution provided by this application significantly outperforms traditional solutions in multiple dimensions, including operating costs, rendering performance, and user experience, fully meeting the modern user's needs for speed, simplicity, and flexibility. It also offers the following advantages: an extremely fast operating experience, a low-threshold learning curve, and efficient cross-industry adaptability. This effectively achieves high-quality image rendering and image generation operations while maintaining low operating costs, meeting cross-industry scalability requirements and thus effectively improving the practicality of the solution.
[0250] Figure 8 This is a structural diagram of an image generating device provided by an exemplary embodiment of the present application; Figure 8 As shown, this embodiment provides an image generating device, which is used to perform the above Figure 2 The image generation method shown, specifically, the image generation device may include:
[0251] A first acquisition module 11 is configured to acquire a reference image, wherein the reference image includes a reference subject in an original posture;
[0252] a first generating module 12 for generating a posture model corresponding to a reference subject, wherein the posture model includes a plurality of editable joint nodes corresponding to the reference subject, and the joint nodes are associated with position data corresponding to the original posture;
[0253] A first processing module 13 is configured to obtain an adjusted posture model in response to a posture adjustment operation input by a user;
[0254] The first processing module 13 is further configured to generate a target image including a reference subject based on the adjusted posture model, wherein the posture of the reference subject in the target image matches the posture of the adjusted posture model.
[0255] The abnormality detection device in this embodiment can also perform the above Figure 1-Figure 7 For the description of the embodiment shown, please refer to the detailed description of the above embodiment, and will not be elaborated here.
[0256] In addition, some of the processes described in the above embodiments and the accompanying drawings include multiple operations that appear in a specific order, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The sequence numbers of the operations, such as 11, 12, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to being different types.
[0257] Figure 9 A schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application; Figure 9 As shown, this embodiment provides an electronic device for performing the above Figure 2 The image generating method shown, wherein the electronic device may include: a memory 24 and a processor 25.
[0258] The memory 24 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, data structures, contact data, phone book data, messages, pictures, videos, etc.
[0259] The processor 25 is coupled to the memory 24 and is used to execute the computer program in the memory 24 to: obtain a reference image, the reference image including a reference subject in an original posture; generate a posture model corresponding to the reference subject, wherein the posture model includes a plurality of editable joint nodes corresponding to the reference subject, and the joint nodes are associated with position data corresponding to the original posture; obtain an adjusted posture model in response to a posture adjustment operation input by a user; and generate a target image including the reference subject based on the adjusted posture model, wherein the posture of the reference subject in the target image matches the posture of the adjusted posture model.
[0260] In some instances, when the processor 25 generates a posture model corresponding to a reference subject, the processor 25 is used to execute: obtaining multiple joint nodes corresponding to the reference subject, the joint nodes being associated with position data corresponding to the original posture; generating a multi-tree structure corresponding to the multiple joint nodes, the multi-tree structure being able to identify the hierarchical relationship between the joint nodes; and generating a posture model based on the multi-tree structure.
[0261] In some instances, when the processor 25 generates a multi-branch tree structure corresponding to multiple joint nodes, the processor 25 is used to execute: determining the root node included in the multiple joint nodes; performing a depth traversal operation based on the root node to generate a multi-branch tree structure that can identify the hierarchical relationship between the joint nodes.
[0262] In some instances, after generating a posture model corresponding to a reference subject, the processor 25 is further used to: obtain adjustment constraint rules corresponding to multiple joint nodes in the posture model; add attribute information to the multiple joint nodes based on the adjustment constraint rules, and the attribute information includes at least one of the following: attribute information on whether the movement can be followed, and attribute information on whether the rotation can be followed.
[0263] In some instances, after adding attribute information to multiple joint nodes based on the adjustment constraint rules, the processor 25 is also used to: when the joint node corresponds to attribute information for identifying that it can follow a movement operation, and / or attribute information for identifying that it can follow a rotation operation, obtain the physical constraint rules corresponding to the joint node; based on the physical constraint rules, determine the movable range and / or rotatable range corresponding to the joint node; associate and store the joint node with the movable range; and / or associate and store the joint node with the rotatable range.
[0264] In some instances, when the processor 25 obtains an adjusted posture model in response to a posture adjustment operation input by a user, the processor 25 is used to perform: when the reference image supports an overall posture adjustment operation for the reference subject, obtaining the adjusted posture model in response to the overall posture adjustment operation input by the user for the reference subject; or, when the reference image does not support an overall posture adjustment operation for the reference subject, obtaining the adjusted posture model in response to the posture adjustment operation input by the user for the posture model.
[0265] In some instances, before obtaining the adjusted posture model in response to a posture adjustment operation input by the user, the processor 25 is further used to: obtain an optional image library, the optional image library including multiple optional images for implementing the image generation operation; when the optional image library includes a target optional image that matches the reference image, determine that the reference image supports the overall posture adjustment operation for the reference subject; when the optional image library does not include a target optional image that matches the reference image, determine that the reference image does not support the overall posture adjustment operation for the reference subject.
[0266] In some instances, when the processor 25 obtains an adjusted posture model in response to an overall posture adjustment operation input by the user for a reference subject, the processor 25 is used to perform: displaying at least one image adjustment control in the reference image, and the image adjustment control is used to implement an overall posture adjustment operation for the reference subject; and obtaining the adjusted posture model in response to a posture adjustment operation input by the user for any image adjustment control.
[0267] In some instances, when the processor 25 obtains an adjusted posture model in response to a posture adjustment operation input by the user for the posture model, the processor 25 is used to execute: displaying at least one image adjustment control in the canvas where the posture model is located, and the image adjustment control is used to implement an overall posture adjustment operation on the posture model; obtaining the adjusted posture model in response to a posture adjustment operation input by the user for any image adjustment control, and / or in response to a posture adjustment operation input by the user for at least one joint node.
[0268] In some instances, the image adjustment control includes a translation adjustment control for implementing a translation operation; when the processor 25 obtains an adjusted posture model in response to a posture adjustment operation input by the user for any image adjustment control, the processor 25 is used to execute: obtaining a movement offset in response to the posture adjustment operation input by the user for the translation adjustment control; and performing an overall translation of the posture model and the bounding box corresponding to the posture model based on the movement offset to obtain an adjusted posture model.
[0269] In some instances, after obtaining the moving offset, the processor 25 is used to execute: obtaining a moving boundary corresponding to the posture model; when the moving offset is less than or equal to the parameter corresponding to the moving boundary, allowing the posture model and the bounding box corresponding to the posture model to be translated as a whole based on the moving offset; when the moving offset is greater than the parameter corresponding to the moving boundary, prohibiting the posture model and the bounding box corresponding to the posture model to be translated as a whole based on the moving offset.
[0270] In some instances, after obtaining the adjusted posture model, the processor 25 is used to execute: obtaining the original position information of the joint nodes in the posture model and the original center position of the bounding box corresponding to the posture model; determining the target position information of the joint nodes based on the movement offset and the original position information; determining the target center position of the bounding box based on the movement offset and the original center position; and associating and storing the target position information, the target center position, and the adjusted posture model.
[0271] In some instances, the image adjustment control includes a rotation adjustment control for implementing a rotation operation; when the processor 25 obtains an adjusted posture model in response to a posture adjustment operation input by the user for any image adjustment control, the processor 25 is used to execute: obtaining a rotation angle in response to the posture adjustment operation input by the user for the rotation adjustment control; rotating the posture model and the bounding box corresponding to the posture model as a whole based on the rotation angle to obtain the adjusted posture model.
[0272] In some instances, when the processor 25 obtains the rotation angle in response to the user's posture adjustment operation input for the rotation adjustment control, the processor 25 is used to perform: obtaining the rotation starting point and the rotation end point in response to the user's posture adjustment operation input for the rotation adjustment control; determining the center point of the posture model; and determining the rotation angle based on the rotation starting point, the center point, and the rotation end point.
[0273] In some instances, after obtaining the adjusted posture model, the processor 25 is used to execute: obtaining the original position information of the joint node in the posture model and the original position of the bounding box corresponding to the posture model; determining the target position information of the joint node based on the rotation angle, center point and original position information; determining the target bounding box position based on the rotation angle, center point and original position of the bounding box; and associating and storing the target position information, target bounding box position, rotation angle and adjusted posture model.
[0274] In some instances, the image adjustment control includes a zoom adjustment control for implementing a zoom operation; when the processor 25 obtains an adjusted posture model in response to a posture adjustment operation input by the user for any image adjustment control, the processor 25 is used to execute: obtaining zoom parameters in response to the posture adjustment operation input by the user for the zoom adjustment control; scaling the posture model and the bounding box corresponding to the posture model as a whole based on the zoom parameters to obtain the adjusted posture model.
[0275] In some instances, when the processor 25 obtains the zoom parameters in response to the user's posture adjustment operation input for the zoom adjustment control, the processor 25 is used to perform: obtaining the zoom operation start point and the zoom operation end point in response to the user's posture adjustment operation input for the zoom adjustment control; determining the center point of the bounding box corresponding to the posture model; and determining the zoom parameters based on the zoom operation start point, the bounding box center point, and the zoom operation end point.
[0276] In some instances, after obtaining the scaling parameters, the processor 25 is used to execute: obtaining a scaling restriction area corresponding to the posture model; when the scaling operation corresponding to the scaling parameters is within the scaling restriction area, allowing the posture model and the bounding box corresponding to the posture model to be scaled as a whole based on the scaling parameters; when the scaling operation corresponding to the scaling parameters is outside the scaling restriction area, prohibiting the posture model and the bounding box corresponding to the posture model to be scaled as a whole based on the scaling parameters.
[0277] In some instances, before scaling the posture model and the bounding box corresponding to the posture model as a whole based on the scaling parameters, the processor 25 is used to execute: when the original posture corresponding to the posture model is a tilted posture, obtaining the tilt angle corresponding to the original posture; adjusting the posture model based on the tilt angle to obtain a posture model in a standard posture.
[0278] In some instances, after obtaining the adjusted posture model, the processor 25 is used to execute: when the adjusted posture model corresponds to an adjustment identifier of a tilt posture, obtaining a tilt adjustment angle corresponding to the tilt posture; and adjusting the adjusted posture model based on the tilt adjustment angle.
[0279] In some instances, after obtaining the adjusted posture model, the processor 25 is used to execute: obtaining the original position information of the joint node in the posture model and the original position of the bounding box corresponding to the posture model; determining the target position information of the joint node based on the scaling parameter, the center point of the bounding box and the original position information; determining the target bounding box position based on the scaling parameter, the center point and the original position of the bounding box; and associating and storing the target position information, the target bounding box position, the scaling parameter and the adjusted posture model.
[0280] In some instances, the image adjustment control includes a mirror adjustment control for implementing a horizontal mirroring operation; when the processor 25 obtains an adjusted posture model in response to a posture adjustment operation input by the user for any image adjustment control, the processor 25 is used to execute: obtaining a mirror trigger parameter in response to the posture adjustment operation input by the user for the mirror adjustment control; horizontally mirroring the posture model and the bounding box corresponding to the posture model based on the mirror trigger parameter to obtain the adjusted posture model.
[0281] In some instances, when the processor 25 obtains an adjusted posture model in response to a posture adjustment operation input by a user for at least one joint node, the processor 25 is used to execute: obtaining forward kinematics rules and a multi-tree structure corresponding to the posture model; determining posture adjustment parameters in response to a posture adjustment operation input by a user for at least one joint node; determining at least one operation joint node corresponding to the posture adjustment operation based on the forward kinematics rules and the multi-tree structure, the operation joint node including at least one of the following: a selected joint node, a child node of the selected joint node, and a parent node corresponding to the selected joint node; and adjusting the position of at least one operation joint node based on the posture adjustment parameters to obtain an adjusted posture model.
[0282] In some examples, after obtaining the adjusted posture model, the processor 25 is configured to: determine the shape of a bounding box corresponding to the adjusted posture model; determine a display position of the bounding box based on the adjusted posture model and the shape; and display the bounding box at the display position.
[0283] In some instances, when the processor 25 determines the display position of the bounding box based on the adjusted posture model and shape, the processor 25 is used to perform: when the shape is a rectangle, construct a coordinate system corresponding to the adjusted posture model; determine the projection information of each joint node in the adjusted posture model relative to the coordinate system; determine the minimum projection information and the maximum projection information in the projection information of each joint node; and determine the display position of the bounding box based on the minimum projection information and the maximum projection information.
[0284] In some instances, when the processor 25 determines the display position of the bounding box based on the minimum projection information and the maximum projection information, the processor 25 is used to perform: determining the upper left corner position and the lower right corner position of the bounding box based on the minimum projection information and the maximum projection information; determining the display position of the bounding box based on the upper left corner position and the lower right corner position.
[0285] In some instances, when the processor 25 determines the display position of the bounding box based on the upper left corner position and the lower right corner position, the processor 25 is used to perform: in the case where the shape is a rounded rectangle, determine the corner radius corresponding to the rounded rectangle; based on the upper left corner position and the lower right corner position, determine the length information and width information of the rounded rectangle; based on the corner radius, the upper left corner position and the lower right corner position, determine the arc starting point and arc end point corresponding to the rounded rectangle; based on the arc starting point and arc end point, determine the display position of the bounding box.
[0286] In some examples, after acquiring the reference image, the processor 25 is configured to: display a posture adjustment control in the reference image; and display a posture model and a plurality of editable joint nodes in the posture model in response to a selection operation inputted for the posture adjustment control.
[0287] In some instances, when the processor 25 displays a posture model and multiple editable joint nodes in the posture model, the processor 25 is used to execute: determining the animation display information and the animation display duration corresponding to the posture model; and displaying the posture model and multiple editable joint nodes in the posture model based on the animation display information and the animation display duration.
[0288] In some instances, when the processor 25 obtains an adjusted posture model in response to a posture adjustment operation input by the user, the processor 25 is used to execute: displaying a canvas adjustment control for overall adjustment of the canvas of the posture model; and obtaining the adjusted posture model in response to a posture adjustment operation input by the user to the canvas adjustment control.
[0289] In some instances, the canvas adjustment control includes a canvas zoom control for implementing a zoom operation; when the processor 25 obtains an adjusted posture model in response to a posture adjustment operation input by the user to the canvas adjustment control, the processor 25 is used to execute: in response to the posture adjustment operation input by the user to the canvas zoom control, obtain the current zoom parameters of the canvas; determine the original center position and original size information of the canvas; based on the original center position, original size information and current zoom parameters, determine the target center position and target size information of the canvas; perform an overall zoom operation on the canvas and the posture model based on the target center position and target size information to obtain the adjusted posture model.
[0290] In some instances, the canvas adjustment control includes a canvas translation control for implementing a translation operation; when the processor 25 obtains an adjusted posture model in response to a posture adjustment operation input by the user to the canvas adjustment control, the processor 25 is used to execute: in response to the posture adjustment operation input by the user to the canvas translation control, obtain the current translation parameters of the canvas; determine the original center position of the canvas; based on the original center position and the current translation parameters, determine the target center position of the canvas; perform an overall translation operation on the canvas and the posture model based on the target center position to obtain the adjusted posture model.
[0291] Further, if Figure 9 As shown, the electronic device also includes: a communication component 26, a display 27, a power component 28, an audio component 29 and other components. Figure 9 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 9 In addition, Figure 9The components in the center line frame are optional components, not mandatory components, and the specific configuration depends on the product form of the working node. The working node of this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone or an IOT device, or as a server-side device such as a conventional server, a cloud server or a server array. If the working node of this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, etc., it can include Figure 9 If the working node of this embodiment is implemented as a server device such as a conventional server, cloud server or server array, it may not include Figure 9 Components within the center wireframe.
[0292] The above-mentioned memory can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0293] The communication component is configured to facilitate wired or wireless communication between the device in which the communication component resides and other devices. The device in which the communication component resides can access a wireless network based on a communication standard, such as a 2G, 3G, 4G / LTE, 5G, or other mobile communication network, or a combination thereof. In an exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel.
[0294] The above-mentioned display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0295] The power supply assembly provides power to various components of the device in which the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.
[0296] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode, the microphone is configured to receive external audio signals. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0297] Accordingly, an embodiment of the present application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above method embodiment. The computer-readable storage medium includes volatile or non-volatile or a combination thereof, and may be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic cassette, tape disk storage or other magnetic storage device or any other non-transmission medium.
[0298] Accordingly, the present application embodiment also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is enabled to implement the steps in the above-mentioned method embodiment. It should be understood that each process or a combination of multiple processes in the above-mentioned method flow can be implemented by a computer program or instruction. In addition, these computer programs or instructions can be applied to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device, so that the processor of the general-purpose computer, the special-purpose computer, the embedded processor or other programmable data processing device can be implemented as a device for implementing the corresponding functions in the above-mentioned method embodiment.
[0299] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0300] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. An image generation method, characterized in that: include: Acquire a reference image, wherein the reference image includes a reference subject in an original posture; generating a posture model corresponding to the reference subject, wherein the posture model includes a plurality of editable joint nodes corresponding to the reference subject, and the joint nodes are associated with position data corresponding to the original posture; In response to a posture adjustment operation input by a user, obtaining an adjusted posture model; A target image including the reference subject is generated based on the adjusted posture model, wherein the posture of the reference subject in the target image matches the posture of the adjusted posture model.
2. The method according to claim 1, characterized in that Generating a posture model corresponding to the reference subject, comprising: Acquire a plurality of joint nodes corresponding to the reference subject, wherein the joint nodes are associated with position data corresponding to the original posture; generating a multi-tree structure corresponding to the plurality of joint nodes, wherein the multi-tree structure is capable of identifying a hierarchical relationship between the joint nodes; Based on the multi-tree structure, the posture model is generated.
3. The method according to claim 2, characterized in that Generating a multi-branch tree structure corresponding to the plurality of joint nodes, including: Determining a root node included in the plurality of joint nodes; A depth traversal operation is performed based on the root node to generate a multi-branch tree structure capable of identifying the hierarchical relationship between joint nodes.
4. The method according to claim 1, wherein After generating a posture model corresponding to the reference subject, the method further includes: Obtaining adjustment constraint rules corresponding to a plurality of joint nodes in the posture model; Attribute information is added to the multiple joint nodes based on the adjustment constraint rule, where the attribute information includes at least one of the following: attribute information on whether the joint nodes can be moved or rotated.
5. The method according to claim 4, characterized in that After adding attribute information to the plurality of joint nodes based on the adjustment constraint rule, the method further includes: When the joint node corresponds to attribute information for identifying that a movement operation can be performed, and / or attribute information for identifying that a rotation operation can be performed, obtaining a physical constraint rule corresponding to the joint node; Determining a movable range and / or a rotatable range corresponding to the joint node based on the physical constraint rule; The joint node and the movable range are associated and stored; and / or the joint node and the rotatable range are associated and stored.
6. The method according to claim 1, characterized in that In response to a posture adjustment operation input by a user, obtaining an adjusted posture model includes: In a case where the reference image supports an overall posture adjustment operation for the reference subject, in response to an overall posture adjustment operation input by a user for the reference subject, obtaining the adjusted posture model; or In a case where the reference image does not support an overall posture adjustment operation for the reference subject, the adjusted posture model is obtained in response to a posture adjustment operation input by a user for the posture model.
7. The method according to claim 6, characterized in that Before obtaining the adjusted posture model in response to the posture adjustment operation input by the user, the method further includes: Acquire an optional image library, wherein the optional image library includes a plurality of optional images for implementing an image generation operation; In a case where the selectable image library includes a target selectable image that matches the reference image, determining that the reference image supports an overall posture adjustment operation for the reference subject; In a case where the selectable image library does not include a target selectable image that matches the reference image, it is determined that the reference image does not support an overall posture adjustment operation for the reference subject.
8. The method according to claim 6, characterized in that In response to an overall posture adjustment operation input by a user for the reference subject, obtaining the adjusted posture model includes: At least one image adjustment control is displayed in the reference image, and the image adjustment control is used to implement an overall posture adjustment operation on the reference subject; In response to a posture adjustment operation input by the user for any image adjustment control, the adjusted posture model is obtained.
9. The method according to claim 6, characterized in that In response to a posture adjustment operation input by a user for the posture model, obtaining the adjusted posture model includes: At least one image adjustment control is displayed in the canvas where the posture model is located, and the image adjustment control is used to implement an overall posture adjustment operation on the posture model; The adjusted posture model is obtained in response to a posture adjustment operation input by the user for any image adjustment control, and / or in response to a posture adjustment operation input by the user for at least one joint node.
10. The method according to claim 9, characterized in that The image adjustment control includes a translation adjustment control for implementing a translation operation; in response to a posture adjustment operation input by a user for any image adjustment control, obtaining the adjusted posture model includes: acquiring a movement offset in response to a posture adjustment operation input by a user to the translation adjustment control; The posture model and the bounding box corresponding to the posture model are translated as a whole based on the movement offset to obtain the adjusted posture model.
11. The method according to claim 10, characterized in that After obtaining the movement offset, the method further includes: Obtaining a movement boundary corresponding to the posture model; In a case where the movement offset is less than or equal to the parameter corresponding to the movement boundary, allowing the posture model and the bounding box corresponding to the posture model to be translated as a whole based on the movement offset; In a case where the movement offset is greater than the parameter corresponding to the movement boundary, overall translation of the posture model and the bounding box corresponding to the posture model based on the movement offset is prohibited.
12. The method according to claim 10, characterized in that After obtaining the adjusted posture model, the method further includes: Obtaining original position information of joint nodes in the posture model and original center position of a bounding box corresponding to the posture model; Determining target position information of the joint node based on the movement offset and the original position information; Determining a target center position of the bounding box based on the movement offset and the original center position; The target position information, the target center position, and the adjusted posture model are associated and stored.
13. The method according to claim 9, characterized in that The image adjustment control includes a rotation adjustment control for implementing a rotation operation; in response to a posture adjustment operation input by a user for any image adjustment control, obtaining the adjusted posture model includes: acquiring a rotation angle in response to a posture adjustment operation input by a user to the rotation adjustment control; The posture model and the bounding box corresponding to the posture model are rotated as a whole based on the rotation angle to obtain the adjusted posture model.
14. The method according to claim 13, characterized in that In response to a posture adjustment operation input by a user to the rotation adjustment control, obtaining a rotation angle includes: In response to a posture adjustment operation input by a user to the rotation adjustment control, obtaining a rotation starting point and a rotation end point; Determining a center point of the posture model; The rotation angle is determined based on the rotation starting point, the center point, and the rotation end point.
15. The method according to claim 14, characterized in that After obtaining the adjusted posture model, the method further includes: Obtaining original position information of joint nodes in the posture model and original positions of bounding boxes corresponding to the posture model; Determining target position information of the joint node based on the rotation angle, the center point, and the original position information; Determine a target bounding box position based on the rotation angle, the center point, and the original position of the bounding box; The target position information, the target bounding box position, the rotation angle, and the adjusted posture model are associated and stored.
16. The method according to claim 9, characterized in that The image adjustment control includes a zoom adjustment control for implementing a zoom operation; in response to a posture adjustment operation input by a user for any image adjustment control, obtaining the adjusted posture model includes: acquiring a zoom parameter in response to a gesture adjustment operation input by a user to the zoom adjustment control; The posture model and the bounding box corresponding to the posture model are scaled as a whole based on the scaling parameter to obtain the adjusted posture model.
17. The method according to claim 16, characterized in that In response to a gesture adjustment operation input by a user to the zoom adjustment control, obtaining a zoom parameter includes: In response to a gesture adjustment operation input by a user to the zoom adjustment control, obtaining a zoom operation start point and a zoom operation end point; Determine the center point of the bounding box corresponding to the posture model; The scaling parameter is determined based on the scaling operation starting point, the bounding box center point, and the scaling operation end point.
18. The method according to claim 16, characterized in that After obtaining the scaling parameters, the method further includes: Acquire a zoom restriction area corresponding to the posture model; In a case where the scaling operation corresponding to the scaling parameter is within the scaling restriction area, allowing the posture model and the bounding box corresponding to the posture model to be scaled as a whole based on the scaling parameter; In a case where the scaling operation corresponding to the scaling parameter is outside the scaling restriction area, scaling the posture model and the bounding box corresponding to the posture model as a whole based on the scaling parameter is prohibited.
19. The method according to claim 16, wherein Before scaling the posture model and the bounding box corresponding to the posture model as a whole based on the scaling parameter, the method further includes: When the original posture corresponding to the posture model is a tilted posture, obtaining the tilt angle corresponding to the original posture; The posture model is adjusted based on the tilt angle to obtain the posture model in a standard posture.
20. The method according to claim 19, characterized in that After obtaining the adjusted posture model, the method further includes: When the adjusted posture model corresponds to an adjustment identifier of a tilt posture, obtaining a tilt adjustment angle corresponding to the tilt posture; The adjusted posture model is adjusted based on the tilt adjustment angle.
21. The method according to claim 16, wherein After obtaining the adjusted posture model, the method further includes: Obtaining original position information of joint nodes in the posture model and original positions of bounding boxes corresponding to the posture model; Determining target position information of the joint node based on the scaling parameter, the center point of the bounding box, and the original position information; Determining a target bounding box position based on the scaling parameter, the center point, and the original position of the bounding box; The target position information, the target bounding box position, the scaling parameter, and the adjusted posture model are stored in association.
22. The method according to claim 9, characterized in that The image adjustment control includes a mirror adjustment control for implementing a horizontal mirror operation; in response to a posture adjustment operation input by a user for any image adjustment control, obtaining the adjusted posture model includes: In response to a posture adjustment operation input by a user to the mirror adjustment control, obtaining a mirror trigger parameter; The posture model and the bounding box corresponding to the posture model are horizontally mirrored based on the mirror trigger parameter to obtain the adjusted posture model.
23. The method according to claim 9, characterized in that In response to a posture adjustment operation input by a user for at least one joint node, obtaining the adjusted posture model includes: Acquire forward kinematics rules and a multi-branch tree structure corresponding to the posture model; determining a posture adjustment parameter in response to a posture adjustment operation input by a user for the at least one joint node; Determining, based on the forward kinematics rule and the multi-branch tree structure, at least one operation joint node corresponding to the posture adjustment operation, the operation joint node comprising at least one of the following: a selected joint node, a child node of the selected joint node, and a parent node corresponding to the selected joint node; The position of the at least one operating joint node is adjusted based on the posture adjustment parameter to obtain the adjusted posture model.
24. The method according to any one of claims 1 to 23, characterized in that After obtaining the adjusted posture model, the method further includes: determining a shape of a bounding box corresponding to the adjusted pose model; determining a display position of the bounding box based on the adjusted posture model and the shape; The bounding box is displayed at the display position.
25. The method according to claim 24, characterized in that Determining a display position of the bounding box based on the adjusted posture model and the shape includes: In the case where the shape is a rectangle, constructing a coordinate system corresponding to the adjusted posture model; Determining projection information of each joint node in the adjusted posture model relative to the coordinate system; Determining minimum projection information and maximum projection information among the projection information of each joint node; A display position of the bounding box is determined based on the minimum projection information and the maximum projection information.
26. The method according to claim 25, characterized in that Determining a display position of the bounding box based on the minimum projection information and the maximum projection information includes: Determining a position of an upper left corner and a lower right corner of the bounding box based on the minimum projection information and the maximum projection information; A display position of the bounding box is determined based on the upper left corner position and the lower right corner position.
27. The method according to claim 26, characterized in that Determining a display position of the bounding box based on the upper left corner position and the lower right corner position includes: In the case where the shape is a rounded rectangle, determining a fillet radius corresponding to the rounded rectangle; Determining the length and width of the rounded rectangle based on the upper left corner position and the lower right corner position; Determine the arc starting point and arc ending point corresponding to the rounded rectangle based on the fillet radius, the upper left corner position, and the lower right corner position; The display position of the bounding box is determined based on the arc start point and the arc end point.
28. The method according to any one of claims 1 to 23, characterized in that After acquiring the reference image, the method further includes: displaying an adjustment pose control in the reference image; In response to a selection operation inputted for the adjustment posture control, the posture model and a plurality of editable joint nodes in the posture model are displayed.
29. The method according to claim 28, characterized in that Displaying the posture model and multiple editable joint nodes in the posture model, including: Determining the dynamic effect display information and the dynamic effect display duration corresponding to the posture model; Based on the motion effect display information and the motion effect display duration, the posture model and multiple editable joint nodes in the posture model are displayed.
30. An image generating device, characterized in that: include: A first acquisition module is configured to acquire a reference image, wherein the reference image includes a reference subject in an original posture; a first generating module, configured to generate a posture model corresponding to the reference subject, wherein the posture model includes a plurality of editable joint nodes corresponding to the reference subject, and the joint nodes are associated with position data corresponding to the original posture; A first processing module, configured to obtain an adjusted posture model in response to a posture adjustment operation input by a user; The first processing module is further configured to generate a target image including the reference subject based on the adjusted posture model, wherein the posture of the reference subject in the target image matches the posture of the adjusted posture model.
31. An electronic device, characterized in that: include: A memory, a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any one of claims 1 to 29.
32. A computer storage medium, characterized in that Used to store a computer program, which enables a computer to implement the method according to any one of claims 1 to 29 when executed.
33. A computer program product, characterized in that include: A computer program, when executed by a processor of an electronic device, causes the processor to perform the steps of the method according to any one of claims 1 to 29.
Citation Information
Cited By
Virtual gift customizing method and device, equipment and medium
CN121126044A