Image processing method, device, electronic device and storage medium
By dividing virtual objects into multiple bone chains and adjusting the display positions of bone points, the problem of penetration and superposition when virtual objects collide is solved, and the display realism and animation effects in virtual reality are improved.
Patent Information
- Application Number
- CN202210837536.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-07-15
AI Technical Summary
In virtual reality technology, when the skeleton points of a virtual object collide with a collision body, they cause mutual penetration and superposition, affecting the realism of the displayed image.
The target virtual object is divided into multiple skeleton chains, the collision information between the skeleton points and the collision body is determined, and the display position of the skeleton points in the display interface is adjusted based on the collision information.
It improves the realism of the display of virtual objects, solves the problem of mutual penetration and superposition between skeleton points and collision bodies, and improves the display effect of animation and user experience.
Smart Images

Figure CN115131478B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to an image processing method, device, electronic device, and storage medium. Background Art
[0002] With the rapid development of virtual reality (VR) technology, it has become a common form of leisure and entertainment for users to experience the virtual world by wearing VR devices.
[0003] In some virtual scenes, collisions between virtual objects, or between objects can lead to interpenetration and overlap. This is especially true when virtual objects perform physical movements, which can cause limb occlusion or interpenetration, resulting in a lower level of fidelity. Summary of the Invention
[0004] The present disclosure provides an image processing method, device, electronic device and storage medium, so that when the skeleton points of a virtual object in the display interface collide with a collision body, the display position of the corresponding skeleton points in the display interface can be adjusted, thereby achieving the effect of improving the realism of the display image.
[0005] In a first aspect, an embodiment of the present disclosure provides an image processing method, comprising:
[0006] Divide the target virtual object in the video frame to be processed into multiple skeleton chains; wherein the skeleton chain includes at least one skeleton point;
[0007] Determining collision information between at least one skeletal point in the plurality of skeletal chains and a collision body, and determining target display information of the at least one skeletal point in a to-be-processed video frame based on the collision information;
[0008] Based on the target display information of at least one skeleton point, the target virtual object is controlled to be displayed in the video frame to be processed.
[0009] In a second aspect, the embodiments of the present disclosure further provide an image processing device, including:
[0010] A skeleton chain division module is used to divide the target virtual object in the video frame to be processed into multiple skeleton chains; wherein the skeleton chain includes at least one skeleton point;
[0011] a collision information determination module, configured to determine collision information between at least one skeletal point in a plurality of skeletal chains and a collision body, and based on the collision information, determine target display information of the at least one skeletal point in a video frame to be processed;
[0012] The target virtual object display module is used to control the target virtual object to be displayed in the video frame to be processed based on the target display information of at least one skeleton point.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in any one of the embodiments of the present disclosure.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the image processing method as described in any one of the embodiments of the present disclosure.
[0018] The technical solution of the embodiment of the present disclosure is as follows: by dividing the target virtual object in the video frame to be processed into multiple skeleton chains, further determining the collision information between at least one skeleton point in the multiple skeleton chains and the collision body, and based on the collision information, determining the target display information of at least one skeleton point in the video frame to be processed; finally, based on the target display information of at least one skeleton point, controlling the target virtual object to be displayed in the video frame to be processed, thereby solving the problem of poor animation display effect caused by the mutual penetration and superposition of the skeleton point and the collision body due to the collision between the skeleton point of the target virtual object and the collision body; by automatically adjusting the display position of the skeleton point of the target virtual object in the display interface when the penetration problem is detected in the display interface, the effect of improving the realism of the display picture is achieved, further improving the display effect of the animation, and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure;
[0021] Figure 2 A flowchart of an image processing method provided by an embodiment of the present disclosure;
[0022] Figure 3A schematic plan view of a spherical collision body provided in an embodiment of the present disclosure;
[0023] Figure 4 A schematic plan view of a spherical collision body provided in an embodiment of the present disclosure;
[0024] Figure 5 A schematic plan view of a spherical collision body provided in an embodiment of the present disclosure;
[0025] Figure 6 A flowchart of an image processing method provided by an embodiment of the present disclosure;
[0026] Figure 7 A schematic plan view of a rectangular collision body provided in an embodiment of the present disclosure;
[0027] Figure 8 A schematic plan view of a rectangular collision body provided in an embodiment of the present disclosure;
[0028] Figure 9 A schematic plan view of a rectangular collision body provided in an embodiment of the present disclosure;
[0029] Figure 10 A flowchart of an image processing method provided by an embodiment of the present disclosure;
[0030] Figure 11 A schematic plan view of a skeleton point collision adjustment method provided by an embodiment of the present disclosure;
[0031] Figure 12 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure;
[0032] Figure 13 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0034] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0035] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0036] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "a plurality of" mentioned in this disclosure are illustrative and not restrictive. Those skilled in the art should understand that unless the context clearly indicates otherwise, they should be understood as "one or more".
[0037] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0038] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0039] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0040] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0041] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0042] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0043] Before introducing the present technical solution, the application scenario of the embodiment of the present disclosure can be exemplified. The technical solution of the present disclosure can be applied to scenarios where there are limb animations in the display interface, such as animation redirection, artificial intelligence limb recognition, etc. The limb animation can be triggered by a button displayed on the display interface, or it can be triggered by a preset continuous motion process of the target part of the target object. For example: in a game, the user controls the target character in the display interface to release skills by pressing buttons or touching, etc., which can make the target part of the target character move to show the skill effects. At this time, when the limb animation is displayed in the display interface, the solution provided by the embodiment of the present disclosure can be adopted to achieve the effect of repositioning the skeletal part. In other words, as long as the target virtual object in the display interface is in motion, and there is a skeletal point of a limb that collides with the collision body to which other limbs belong, the solution provided by the embodiment of the present disclosure can be adopted to adjust the display position of the skeletal point in the display interface, so as to achieve the effect of avoiding penetration or obstructed display.
[0044] The apparatus for executing the image processing method provided in the embodiments of the present disclosure may be integrated into application software having image processing capabilities, and the software may be installed in an electronic device, optionally a mobile terminal or a PC. The application software may be software for image / video processing, and the specific application software will not be described in detail here; as long as the application software can implement image / video processing, it will be sufficient.
[0045] Figure 1 This is a flow chart of an image processing method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is suitable for obtaining collision information between each skeleton point in the target virtual object and the collision body in real time or periodically, and then adjusting the display position of the corresponding skeleton point in the display interface based on the collision information. The method can be executed by an image processing device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, PC or server, etc.
[0046] like Figure 1 As shown, the method includes:
[0047] S110: Divide the target virtual object in the video frame to be processed into multiple skeletal chains.
[0048] It should be noted that the pre-collected or generated video can be processed. In this case, during the video playback process, each video frame can be used as a video frame to be processed; or the video is generated in real time. For example, when accessing an external game, in order to prevent the game screen from being distorted during playback, the video frame played or collected in real time can be used as a video frame to be processed. The video frame to be processed may or may not include the target virtual object. When the video frame to be processed includes the target virtual object, the technical solution provided by the embodiment of the present disclosure can be used to determine whether the skeleton point of the target virtual object collides with the collision body. If no collision occurs, it can be displayed directly; if a collision occurs, the technical solution provided by the embodiment of the present disclosure can be used to determine the display position of the skeleton point where the collision occurred in the display interface. The target virtual object can be a three-dimensional object constructed in a virtual scene. For example, the target virtual object can be a virtual character or a virtual animal.
[0049] A skeleton chain can be a skeleton model that constitutes a target virtual object. The skeleton chain can include at least one skeleton point. Each skeleton point corresponds to a different joint point on the skeleton chain. For example, when the skeleton chain is an arm skeleton chain, the skeleton points can be a shoulder skeleton point, an upper arm skeleton point, an elbow skeleton point, a lower arm skeleton point, and a wrist skeleton point.
[0050] In practical applications, the target virtual object is composed of at least one part, such as a shoulder, a hand, or a leg, etc. Therefore, when dividing the target virtual object into multi-bone chains, the division can be performed according to the corresponding parts.
[0051] Optionally, dividing the target virtual object in the video frame to be processed into multiple skeletal chains includes: dividing the target virtual object into multiple detection parts based on a preset part division rule; and determining skeletal chains corresponding to the multiple detection parts.
[0052] The part division rule is the basis for dividing the target virtual object into multiple skeletal chains. The detection part can be any part of the target virtual object. For example, the detection part can be the face, shoulders, hands, legs, etc.
[0053] In this embodiment, the entire skeleton of the target virtual object is a tree structure, which can be divided into five skeleton chains, namely, a trunk skeleton chain, two arm skeleton chains, and two leg skeleton chains.
[0054] Specifically, a video frame to be processed can be obtained, and a target virtual object in the frame can be determined. Furthermore, the target virtual object is segmented according to pre-set body part classification criteria to obtain at least one detection part. The skeletal chain corresponding to each detection part is then determined, allowing for corresponding analysis of each detection part. This setup has the advantage of accurately determining collision information for each skeletal point on the skeletal chain and the corresponding target display information, ensuring accurate correction of the skeletal points of the target virtual object.
[0055] S120: Determine collision information between at least one skeletal point in the plurality of skeletal chains and a collision body, and determine target display information of the at least one skeletal point in the video frame to be processed based on the collision information.
[0056] The collision body can be a collision body corresponding to other components in the video frame to be processed, or it can be a collision body corresponding to the target virtual object itself. For example, different parts of the target virtual object correspond to different collision bodies. When the target virtual object waves, its arm collides with the collision body corresponding to its torso, causing the target virtual object's body parts to be obscured from display. In this case, the collision body is the collision body corresponding to the torso of the target virtual object. Collision information can be used to indicate whether a skeleton point has collided with the collision body. Since the component to which the skeleton point belongs in the virtual scene is also a collision body, the collision information between the skeleton point and the collision body can be reflected in whether there is overlap or penetration between the two models. Generally, when performing collision detection between each skeleton point and the collision body and determining the corresponding collision information, in order to resolve the collision problem, it is necessary to move the display position of the skeleton point where the collision problem occurs in the display interface based on the collision information so that the skeleton point and the corresponding collision body are in a state where they do not pass through each other, and the current display position information of the skeleton point is displayed in the video frame to be processed. The position information of the skeleton point finally displayed in the display interface can be used as the target display information.
[0057] Specifically, when at least one skeleton chain in the target virtual object collides with the collision body corresponding to other components in the video frame to be processed, or collides with the collision body corresponding to its own body part, it is necessary to determine the relative position information of the colliding skeleton point and the collision body, so that the target display information of the skeleton point in the video frame to be processed can be determined based on the relative position information.
[0058] S130: Based on the target display information of at least one skeleton point, control the target virtual object to be displayed in the video frame to be processed.
[0059] Specifically, after determining the target display information of at least one skeleton point, the display position of the skeleton point in the display interface can be adjusted according to the target display information to solve the problem of penetration caused by collision and improve the picture display effect and realism.
[0060] Optionally, based on the target display information of at least one skeleton point, controlling the target virtual object to be displayed in the video frame to be processed includes: rendering the target virtual object in the video frame to be processed based on the target display position adjusted by at least one skeleton point.
[0061] The target display position may be the position information of each skeleton point that does not collide with the collision body and is finally displayed in the video frame to be processed.
[0062] In a specific implementation, the display position of each skeleton point in the display interface can be adjusted from the initial display position to the target display position according to the target display position of each skeleton point. Furthermore, the target virtual object is rendered in the video frame to be processed, so that the target virtual object is displayed in the video to be processed according to the target display position of the skeleton point in the display interface, so as to improve the display effect and authenticity of the target virtual object in the video frame to be processed.
[0063] The technical solution of the embodiment of the present disclosure is as follows: by dividing the target virtual object in the video frame to be processed into multiple skeleton chains, further determining the collision information between at least one skeleton point in the multiple skeleton chains and the collision body, and based on the collision information, determining the target display information of at least one skeleton point in the video frame to be processed; finally, based on the target display information of at least one skeleton point, controlling the target virtual object to be displayed in the video frame to be processed, thereby solving the problem of poor animation display effect caused by the mutual penetration and superposition of the skeleton point and the collision body due to the collision between the skeleton point of the target virtual object and the collision body; by automatically adjusting the display position of the skeleton point of the target virtual object in the display interface when the penetration problem is detected in the display interface, the effect of improving the realism of the display picture is achieved, further improving the display effect of the animation, and enhancing the user experience.
[0064] Figure 2 This is a flow chart of an image processing method provided by an embodiment of the present disclosure. Based on the aforementioned embodiments, the methods for determining target display information for skeletal points differ for different types of collision bodies. This embodiment uses a spherical collision body as an example for illustration. For specific implementations, please refer to the detailed description of this technical solution. The explanations of terms that are identical or corresponding to those in the aforementioned embodiments are not repeated here.
[0065] like Figure 2 As shown, the method specifically includes the following steps:
[0066] S210: Divide the target virtual object in the video frame to be processed into multiple skeleton chains.
[0067] S220: Determine at least one target collision body corresponding to the target virtual object and a corresponding collision body type.
[0068] The target collision body can be an object that collides with the target virtual object in the virtual scene. For example, if the target virtual object displayed in the video frame to be processed collides with a box when it steps over it, the box is the target collision body; if the target virtual object displayed in the video frame to be processed passes through a wall in the virtual scene, the wall is the target collision body. The collision body type can be classified according to the displayed shape of the collision body in the virtual scene.
[0069] It should be noted that the number of target collision bodies can be one or more. When the target virtual object in the display interface is performing corresponding limb movements, it may collide with one or more collision bodies to which it belongs. For example, when the target virtual object is waving, it may collide with the collision body to which the shoulder bone point of the target virtual object belongs, and / or the collision body to which multiple torso bone points belong, depending on the amplitude of the waving. The embodiment of the present disclosure is only described by taking the adjustment of the display position of the skeleton point in the display interface when a skeleton point collides with a target collision body as an example. When there are multiple target collision bodies, the display position of the skeleton point in the display interface can be adjusted by the technical method provided in the embodiment of the present disclosure.
[0070] In a specific embodiment, after the target virtual object is divided into multiple skeletal chains, since the collision information corresponding to collision bodies of different shapes is different, and the adjustment method of the skeletal points after the collision is also different, therefore, when determining the collision information between each skeletal point and the collision body, it is necessary to determine at least one collision body that collides with the target virtual object, and the collision body types corresponding to these collision bodies, so that the corresponding collision information can be determined according to different types of collision bodies to improve the display effect of the target virtual object.
[0071] S230: Determine collision information between the at least one skeleton point and the spherical collision body, and determine target display information of the at least one skeleton point in the video frame to be processed based on the collision information.
[0072] It should be noted that for different types of target collision bodies, the method for determining the collision information between each skeleton point and the corresponding target collision body is different, and the method for adjusting the skeleton point that causes the collision is also different. Therefore, when determining the collision information between the skeleton point and the target collision body, different collision information determination methods can be executed according to different collision body types.
[0073] Optionally, based on at least one skeleton point and the collision body type, the collision information between the skeleton point and at least one target collision body is determined, including: for two adjacent skeleton points along the first direction on the same skeleton chain, based on the target collision body, the first collision body to which the parent skeleton point belongs, and the second collision body to which the child skeleton point belongs, the collision information between the skeleton point and the target collision body is determined.
[0074] The first direction may be the direction from a parent skeletal point to a child skeletal point in a skeletal chain. The parent skeletal point and the child skeletal point may be two adjacent nodes in a parent-child relationship on the same skeletal chain. The parent skeletal point is the skeletal point facing away from the first direction, and the child skeletal point is the skeletal point pointing in the first direction. In the same skeletal chain, the parent skeletal point and the child skeletal point are relative terms. For example, an arm skeletal chain includes a shoulder skeletal point, an elbow skeletal point, and a wrist skeletal point in the first direction. For the shoulder and elbow skeletal points, the shoulder skeletal point is the parent skeletal point, and the elbow skeletal point is the child skeletal point; for the elbow and wrist skeletal points, the elbow skeletal point is the parent skeletal point, and the wrist skeletal point is the child skeletal point. The first collision body to which the parent skeletal point belongs may be a collision body constructed with the parent skeletal point as the center. Correspondingly, the second collision body to which the child skeletal point belongs may be a collision body constructed with the child skeletal point as the center. It should be noted that both the first collision body and the second collision body are body parts of the target virtual object. For example, when the target virtual object is a virtual character, the parent bone point is a shoulder bone point, and the child bone point is an upper arm joint bone point, the first collision body is the shoulder of the target virtual object, and the second collision body is the upper arm of the target virtual object.
[0075] In practical applications, for a pair of adjacent parent and child skeletal points on the same skeletal chain, since the collision information determined when the first collision body to which the parent skeletal point belongs and the second collision body to which the child skeletal point belongs collide with the target collision body are different, when determining the collision information between the skeletal point and the target collision body, the collision information can be determined separately for the parent skeletal point and the child skeletal point. The advantage of this setting is that it can determine the relative position of the collision body corresponding to different skeletal points and the target collision body, accurately determine the collision information between the skeletal point and the target collision body, and thus improve the realism of the target virtual object displayed in the video frame to be processed.
[0076] For example, Figure 3 As shown, the sphere to which point S belongs is the target collision body, point B is the child skeleton point, the sphere constructed with this point as the center is the second collision body, point A is the parent skeleton point, and the sphere constructed with this point as the center is the first collision body.
[0077] Optionally, the collision information of the skeleton point and the target collision body is determined based on the target collision body, the first collision body to which the parent skeleton point belongs, and the second collision body to which the child skeleton point belongs, including: for the parent skeleton point, determining the first sphere center distance between the first collision body and the target collision body, and determining the collision information of the parent skeleton point and / or the child skeleton point and the target collision body based on the first sphere center distance and the target sphere radius of the target collision body; for the child skeleton point, determining the second sphere center distance between the second collision body and the target collision body, and determining the collision information of the child skeleton point and the target collision body based on the second sphere center distance, the target sphere radius, and the second sphere radius of the second collision body.
[0078] The first sphere center distance can be the straight-line distance between the parent skeletal point and the node where the target collider's center is located. The target sphere radius can be the line segment connecting the target collider's center and any point on its surface. The second sphere center distance can be the straight-line distance between the child skeletal point and the node where the target collider's center is located. The second sphere radius can be the line segment connecting the child skeletal point and any point on the surface of the second collider.
[0079] In practical applications, when determining the collision information between a parent bone point and a child bone point and a target collision body, the relative distance between the first collision body to which the parent bone point belongs and the target collision body can be determined, and this distance can be compared with the radius of the target collision body. The collision information between the parent bone point and / or the child bone point and the target collision body can be determined based on the comparison result. The advantage of this setting is that for a pair of adjacent parent bone points and child bone points in the bone chain, the corresponding collision information is determined based on different relative position information, which can improve the accuracy of the collision information, thereby improving the realism of the target virtual object displayed in the video frame to be processed.
[0080] For example, Figure 3 As shown, the first spherical center distance |SA| is the distance between point S and point A, and the second spherical center distance |BS| is the distance between point S and point B.
[0081] Optionally, the collision information of the parent skeleton point and / or the child skeleton point with the target collision body is determined based on the first sphere center distance and the target sphere radius of the target collision body, including: if the first sphere center distance is less than the target sphere radius, the collision information of the parent skeleton point is determined to be the first collision information; if the first sphere center distance is greater than the target sphere radius, the collision information of the child skeleton point is determined to be the second collision information.
[0082] The first collision information is that the parent skeleton point is located inside the target collision body; the second collision information is that the child skeleton point is located inside the target collision body.
[0083] In a specific implementation, in order to more accurately and quickly determine the collision information between each bone point and the target collision body, after determining the first center distance between the first collision body and the target collision body, the first center distance is compared with the radius of the target sphere to determine the collision information between the parent bone point and the child bone point and the target collision body. When the first center distance is less than the radius of the target sphere, it can be indicated that the parent bone point is inside the target collision body, and its corresponding collision information is the first collision information; when the first center distance is greater than the radius of the target sphere, since at least one bone point on the current bone chain collides with the target collision body, for adjacent parent and child bone points on the same bone chain, the parent bone point and the child bone point are in a connected state. Therefore, when the distance between the center of the parent bone point and the target collision body is greater than the radius of the target sphere, it can be indicated that the child bone point adjacent to the parent bone point is inside the target collision body, and its corresponding collision information is the second collision information.
[0084] Exemplarily, as Figure 3 shown, the radius of the collision body S is Sr, and the radii of the collision bodies A and B are both Br. If |SA| < Sr, it means that point A is inside the collision body S; if |SA| > Sr, it means that point B is inside the collision body S.
[0085] Optionally, according to the second center distance, the radius of the target sphere, and the second sphere radius of the second collision body, determine the collision information between the child bone point and the target collision body, including: based on the radius of the target sphere and the second sphere radius, determine the first sum radius; if the second center distance is greater than the first sum radius, determine the collision information as the third collision information; if the second center distance is less than the first sum radius, determine the collision information as the second collision information.
[0086] Among them, the first sum radius can be the distance after adding the radius of the target sphere and the second sphere radius. The third collision information is that the child bone point does not collide with the target collision body; the second collision information is that the child bone point is inside the target collision body.
[0087] Specifically, in order to more accurately and quickly determine the collision information between the sub-skeleton point and the target collision object, the radius of the target sphere and the second sphere radius of the second collision object to which the sub-skeleton point belongs can be added to obtain the first sum radius. Further, the first sum radius is compared with the second center distance to determine the collision information between the sub-skeleton point and the target collision object according to the comparison result. When the second center distance is greater than the first sum radius, it indicates that the second collision object to which the sub-skeleton point belongs and the target collision object do not come into contact with each other to cause a collision. Therefore, the collision information between the sub-skeleton point and the target collision object can be determined as the third collision information, that is, the sub-skeleton point does not collide with the target collision object. When the second center distance is less than the first sum radius, it indicates that the second collision object to which the sub-skeleton point belongs and the target collision object are in contact with each other, and a part of the two collision objects overlaps. Therefore, the collision information between the sub-skeleton point and the target collision object can be determined as the second collision information, that is, the sub-skeleton point is located inside the target collision object.
[0088] Exemplarily, as Figure 3 shown, if |BS|>Sr + Br, it means that point B has no collision with the collision object S, and there is no need to process this skeleton point, and this skeleton point can be displayed with its corresponding initial position information. If |BS|<Sr + Br, it means that point B is located inside the collision object S.
[0089] Further, since the collision information of each skeleton point with the target collision object is different, when determining the target display information of each skeleton point in the to-be-processed video frame based on the collision information, it can be determined separately according to different collision information.
[0090] Optionally, determining the target display information of at least one skeleton point in the to-be-processed video frame based on the collision information includes: if the collision information is the first collision information, adjusting the target display position of the parent skeleton point in the to-be-processed video frame according to the target center coordinate of the target collision object, the first center coordinate of the first collision object, the second center coordinate of the second collision object, and the first sum radius.
[0091] In practical applications, a space coordinate system can be constructed in three-dimensional space according to the target collision object, the first collision object, and the second collision object. Among them, the center position coordinate of the target collision object is the target center coordinate, the center position coordinate of the first collision object is the first center coordinate, and the center position coordinate of the second collision object is the second center coordinate. Among them, the parent skeleton point corresponds to the first center coordinate, the sub-skeleton point corresponds to the second center coordinate, and the target display information includes the target display position.
[0092] Specifically, when the collision information is first collision information, that is, the parent bone point is located inside the target collision body, since the direction between a pair of adjacent parent bone points and child bone points on the same bone chain is from the parent bone point to the child bone point, in order to adjust the display position of the parent bone point in the video frame to be processed, the first vector between the two sphere centers can be determined based on the first sphere center radius and the second sphere center radius, with the direction of the vector being the parent bone point executing the child bone point. Then, the first vector is divided by its corresponding modulus to obtain a unit vector with a modulus of 1 and a vector direction the same as the vector direction of the first vector. Further, the dot product between the unit vector and the first radius is determined to obtain a value whose modulus is the length of the line segment corresponding to the first radius and the direction is the middle value of the vector direction of the first vector. The target sphere center coordinates are added to the middle value to determine the target display position of the parent bone point in the video frame to be processed after the update. The advantage of this setting is that the target display position of the parent bone point in the video frame to be processed can be accurately determined based on the corresponding collision information, so that the parent bone point can be quickly adjusted to the target display position, thereby improving the display effect of the animation.
[0093] For example, the target display position of the parent bone point in the video frame to be processed can be determined by the following formula:
[0094] A′=S+Normalize(AB)*(Sr+Br)
[0095] Among them, A′ represents the target display position coordinate after the parent bone point is updated, S represents the target sphere center coordinate, A represents the first sphere center coordinate, B represents the second sphere center coordinate, Sr+Br represents the first sum radius, and * represents the scalar product processing.
[0096] Optionally, based on the collision information, the target display information of at least one skeleton point in the video frame to be processed is determined, including: if the collision information is the second collision information, the target display information of the child skeleton point in the video frame to be processed is determined based on the first radius, the first sphere center distance, the first sphere center coordinates of the parent skeleton point, and the second sphere center coordinates of the child skeleton point.
[0097] Specifically, when the collision information is the second collision information, that is, the child skeleton point is located inside the target collision body, the relevant position information of the parent skeleton point, the relevant position information of the child skeleton point, and the position information between the parent skeleton point and the target collision body are required to determine the target display position of the child skeleton point in the processing video frame after the update. The advantage of this setting is that the target display position of the child skeleton point in the processing video frame can be accurately determined based on the corresponding collision information, so that the child skeleton point can be quickly adjusted to the target display position, improving the display effect of the animation.
[0098] Optionally, the target display information of the child skeleton point in the video frame to be processed is determined based on the first sum radius, the first sphere center distance, the first sphere center coordinate of the parent skeleton point, and the second sphere center coordinate of the child skeleton point, including: determining the first transition value based on the first sphere center distance, the first sum radius, the third sphere center distance between the first sphere center coordinate and the second sphere center coordinate; determining the first unit vector based on the first sphere center coordinate and the target sphere center coordinate; determining the second transition value based on the first transition value, the first sphere center coordinate and the first unit vector; and determining the target display information based on the second transition value, the first unit vector and the second sphere center coordinate.
[0099] The third spherical center distance may be the distance between the parent bone point and the child bone point.
[0100] For example, Figure 4 and Figure 5 As shown, a corresponding auxiliary circle can be constructed to calculate the target display position of the child skeleton point in the video frame to be processed.
[0101] In practical applications, in order to more accurately determine the target display information of the child skeleton point, the first sphere center distance, the first radius and the third sphere center distance can be squared respectively to obtain the first distance value, the second distance value and the third distance value. Then, the first distance value is subtracted from the second distance value, and the result of the subtraction is added to the third distance value, and the result of the addition is divided by twice the first sphere center distance to obtain a distance value, which can be used as the first transition value.
[0102] Furthermore, each coordinate value in the target sphere center coordinate is subtracted from each coordinate value in the first sphere center coordinate to determine the vector between the two sphere center coordinates, and then the unit vector of the vector is determined, which can be used as the first unit vector, and then the dot product between the first unit vector and the vector corresponding to the first transition value is determined to obtain a coordinate, and then the coordinate is added to the first sphere center coordinate to determine the second transition value, and finally, the target display information of the sub-skeleton point is determined based on the second transition value, the first unit vector and the second sphere center coordinate.
[0103] Optionally, target display information is determined based on the second transition value, the first unit vector and the second sphere center coordinates, including: determining the third transition value based on the first sphere center distance, the third sphere center distance and the first radius; determining the fourth transition value based on the third transition value, the second sphere center coordinates, the first unit vector, the second transition value and the second unit vector formed by the second sphere center coordinates; determining the target display information of the sub-skeleton point based on the fourth transition value, the second transition value and the third transition value.
[0104] Specifically, in order to more accurately determine the target display information of the child skeleton point, the first sphere center distance, the first radius and the third sphere center distance can be squared respectively to obtain a first distance value, a second distance value and a third distance value. Then, the first distance value is subtracted from the second distance value, and the result of the subtraction is added to the third distance value, and the result of the addition is squared to obtain a first value to be processed. At the same time, the first distance value is multiplied by the third distance value, and the result of the multiplication is multiplied by 4 to obtain a second value to be processed. Further, the second value to be processed is subtracted from the first value to be processed, and the result of the subtraction is squared to obtain a third value to be processed. The third value to be processed is divided by 2 times the first sphere radius to obtain a third transition value.
[0105] Furthermore, since the second transition value is obtained by adding two coordinates, the second transition value is also represented by coordinates. By subtracting each coordinate value in the second center coordinate from each coordinate value in the second transition value, the second unit vector can be obtained. The dot product of the first unit vector and the second unit vector is determined, and the dot product is multiplied with the first unit vector to obtain a vector to be processed. The fourth transition value can be obtained by subtracting the second center coordinate from the vector.
[0106] Finally, since the fourth transition value is obtained by subtracting two coordinates, the representation of the fourth transition value is also a coordinate. Each coordinate value in the fourth transition value is subtracted from each coordinate value in the second transition value, and the unit vector corresponding to the coordinate after subtraction is determined, and the dot product between the unit vector and the vector corresponding to the third transition value is determined. The dot product is added to the second transition value to obtain the target display position after the sub-skeleton point is updated.
[0107] S240: Based on the target display information of at least one skeleton point, control the target virtual object to be displayed in the video frame to be processed.
[0108] The technical solution of the embodiment of the present disclosure is as follows: the target virtual object in the video frame to be processed is divided into multiple skeleton chains, and then at least one target collision body corresponding to the target virtual object and the corresponding collision body type are determined. Furthermore, based on at least one skeleton point and the spherical collision body, the collision information between the skeleton point and the at least one target collision body is determined, and based on the collision information, the target display information of the at least one skeleton point in the video frame to be processed is determined. Finally, based on the target display information of the at least one skeleton point, the target virtual object is controlled to be displayed in the video frame to be processed. This solves the problem that when a skeleton point collides with a spherical collision body, the collision bodies are blocked or penetrated, thereby resulting in poor animation display effect. This achieves accurate and rapid determination of the collision information between the skeleton point and the spherical collision body and the target display information of the skeleton point in the display interface, and then adjusts the display position of the skeleton point in the display interface according to the target display information, thereby improving the display effect of the animation.
[0109] Figure 6 This is a flow chart of an image processing method provided by an embodiment of the present disclosure. Based on the aforementioned embodiments, the methods for determining target display information for skeletal points differ for different types of collision bodies. This embodiment uses a rectangular collision body as an example for illustration. For specific implementations, please refer to the detailed description of this technical solution. The explanations of terms that are identical or corresponding to those in the aforementioned embodiments are omitted here.
[0110] like Figure 6 As shown, the method specifically includes the following steps:
[0111] S310: Divide the target virtual object in the video frame to be processed into multiple skeleton chains.
[0112] S320: Determine at least one target collision body corresponding to the target virtual object and a corresponding collision body type.
[0113] S330: Determine collision information between the at least one skeleton point and the cuboid collision body, and determine target display information of the at least one skeleton point in the video frame to be processed based on the collision information.
[0114] In actual applications, when the collision body type is a rectangular collision body, the method of determining the collision information between the skeleton point and the collision body is different from the method corresponding to the spherical collision body, and the method of determining the target display information of the skeleton point will also change accordingly.
[0115] Optionally, based on at least one skeleton point and the collision body type, collision information between the skeleton point and at least one target collision body is determined, including: for a skeleton point along the first direction on the same skeleton chain, collision information between the skeleton point and the target collision body is determined based on the sub-coordinates of the skeleton point and a preset function.
[0116] The first direction may be the direction from the parent bone point to the child bone point on the same bone chain. The child coordinate may be the coordinate information corresponding to the child bone point on the same bone chain. The preset function may be a pre-set function for determining collision information between the bone point and the target collision body. For example, the preset function may be an Abs function, which corresponds to calculating the absolute value of an integer.
[0117] In actual applications, when the target collision body is a rectangular collision body, for the bone points on the same skeleton chain that are in the direction from the parent bone point to the child bone point, the child coordinates of the bone point can be substituted into the preset function to determine the collision information between the bone point and the target collision body. The advantage of this setting is that it can determine the corresponding collision information determination method based on different types of collision bodies, so as to achieve more accurate and rapid determination of the collision situation between the bone point and the target collision body, and determine the corresponding solution.
[0118] Optionally, the collision information between the skeleton point and the target collision body is determined based on the sub-coordinates of the skeleton point and the preset function, including: determining the depth value of the skeleton point in each dimension based on the sub-coordinates and the preset function; if the maximum depth value is less than the preset value, then determining that the collision information between the skeleton point and the target collision body is the fourth collision information.
[0119] Generally, since the target collision volume is a cuboid collision volume, a three-dimensional collision volume with dimensions of length, width, and height, the depth values of the skeleton point in each dimension include depth values for length, width, and height. It should be noted that in a spatial coordinate system, dimensions can be represented by coordinate axes: the X-axis can represent length, the Y-axis can represent width, and the Z-axis can represent height. The depth value can be the vertical distance between the position of the skeleton point in the target collision volume and the surface of the target collision volume. In practical applications, the depth values of the skeleton point in each dimension are compared, and the largest of these depth values is used as the maximum depth value. The preset value can be a pre-set criterion for determining the type of collision information between the skeleton point and the target collision volume. For example, the preset value can be 0. When the maximum depth value is less than the preset value, it can be considered that the skeleton point intersects the target collision volume, i.e., the fourth collision information indicates that the skeleton point intersects the target collision volume.
[0120] For example, Figure 7As shown, assuming that the lengths of the target collision body in the X-axis, Y-axis, and Z-axis directions are Kx, Ky, and Kz respectively, the radius of the collision body to which the skeleton point belongs is Br, the center coordinate C of the target collision body is (0, 0, 0), and the sub-coordinates of the skeleton point are, then the depth value of the skeleton point in each dimension can be determined by the following formula:
[0121] DepthX=Abs(Bx-Cx)-Kx-Br
[0122] DepthY=Abs(By-Cy)-Ky-Br
[0123] DepthZ=Abs(Bz-Cz)-Kz-Br
[0124] Among them, DepthX represents the depth value in the X-axis direction, DepthY represents the depth value in the Y-axis direction, DepthZ represents the depth value in the Z-axis direction, B represents the sub-coordinate of the skeleton point, and Abs represents the absolute value of the integer.
[0125] When DepthX < 0, it means that the bone point intersects with the target collision body in the X-axis direction.
[0126] For example, the maximum depth value can be expressed as T=max(DepthX, DepthY, DepthZ). When T<0, it indicates that the skeleton point intersects with the target collision body.
[0127] Specifically, the sub-coordinates and a preset function of the skeleton point are determined. Based on the sub-coordinates and the preset function, the depth value of the skeleton point in each dimension is determined. Then, the depth values in each dimension are compared, and the value with the largest value is used as the maximum depth value. When the maximum depth value is less than the preset value, the collision information between the skeleton point and the target collision body can be determined as the fourth collision information. The advantage of this setting is that the relative position relationship between the skeleton point and the target collision body can be accurately determined, and the collision situation between the skeleton point and the target collision body can be determined based on the relative position relationship.
[0128] It should be noted that when the target collision body is a rectangular collision body and the collision information between the skeleton point and the target collision body is the fourth collision information, when determining the target display information of the skeleton point in the video frame to be processed based on the current collision information, it is necessary to determine the updated target display information of the skeleton point based on the position information of the skeleton point, the position information of the parent skeleton point connected to the skeleton point, and the position information of the target collision body.
[0129] On the basis of the above embodiment, in order to more accurately determine the target display information of the skeleton point in the video frame to be processed, the following method may be used:
[0130] If the collision information is the fourth collision information, the target display information of the skeleton point in the video frame to be processed is determined based on the parent coordinate information, child coordinate information of the parent skeleton point that the skeleton point depends on, and the length information of the target collision body in each dimension.
[0131] The front-dependent parent bone point may be a bone point adjacent to the bone point and driven to move accordingly based on the movement of the bone point. The parent coordinate information may be the coordinates of the parent bone point in three-dimensional space. The length information of the target collision body in each dimension may be the size information of the target collision body, i.e., the length, width, and height of the target collision body. In a three-dimensional coordinate system, the length value of the target collision body in the X-axis direction, the length value in the Y-axis direction, and the length value in the Z-axis direction may be included.
[0132] For example, Figure 8 and Figure 9 As shown, the horizontal direction is the X-axis, the vertical direction is the Y-axis, and DepthX is the maximum value. Through sign = (Ax-Cx) / Abs(Ax-Cx), the plane is (Kx, 0, 0)*sign, where the sign function is a sign function, and its function is to take the sign of a number. It can be seen from the figure that sign = 1. Therefore, the plane vector of the plane is (Kx, 0, 0), and the right line segment of the rectangle in the figure is used as the cross section of the plane.
[0133] like Figure 9 As shown, OA is perpendicular to OB', so the distance between point O and point A can be obtained by subtracting the coordinate value of point A on the X-axis, the coordinate value of point C on the X-axis, and the radius of the collision body to which the skeleton point belongs. Since OA is perpendicular to OB', according to the Pythagorean theorem, the distance between point O and point B' can be obtained by the following calculation process: first determine the distance between point A and point B, and square the distance to obtain a first square value to be processed. Then, square the distance between point O and point A to obtain a second square value to be processed. Further, subtract the first square value to be processed from the second square value to be processed, and take the square root of the result after subtraction, so as to finally determine the distance between point O and point B'. Furthermore, based on the distance between point O and point B', the coordinates of the final point B' can be determined, that is, the target display information of the skeleton point in the video frame to be processed is the position of B' in the figure.
[0134] S340: Based on the target display information of at least one skeleton point, control the target virtual object to be displayed in the video frame to be processed.
[0135] The technical solution of the embodiment of the present disclosure is as follows: the target virtual object in the video frame to be processed is divided into multiple skeleton chains, and then at least one target collision body corresponding to the target virtual object and the corresponding collision body type are determined. Furthermore, based on at least one skeleton point and the spherical collision body, the collision information between the skeleton point and the at least one target collision body is determined, and based on the collision information, the target display information of the at least one skeleton point in the video frame to be processed is determined. Finally, based on the target display information of the at least one skeleton point, the target virtual object is controlled to be displayed in the video frame to be processed. This solves the problem that when a skeleton point collides with a rectangular collision body, the collision bodies are blocked or penetrated, thereby resulting in poor animation display effect. This achieves accurate and rapid determination of the collision information between the skeleton point and the rectangular collision body and the target display information of the skeleton point in the display interface, and then adjusts the display position of the skeleton point in the display interface according to the target display information, thereby improving the display effect of the animation.
[0136] Figure 10 This is a flow chart of an image processing method provided by an embodiment of the present disclosure. Based on the aforementioned embodiments, when determining the target display information of a skeletal point in a display interface, in order to achieve a smooth transition between skeletal points on the same skeletal chain, the rotation angle of each skeletal point during the smooth transition can be determined using the method provided by this embodiment. For specific implementation methods, please refer to the detailed description of this technical solution. The explanations of terms that are identical or corresponding to those in the aforementioned embodiments are not further elaborated here.
[0137] It should be noted that when adjusting the display position of a bone point in the display interface, other bone points belonging to the same bone chain as the bone point may not collide with the collision body. In order to achieve a smooth transition of each bone point, the following method can be used to adjust the rotation angle of the bone point on the display interface.
[0138] like Figure 10 As shown, the method specifically includes the following steps:
[0139] S410: Divide the target virtual object in the video frame to be processed into multiple skeleton chains.
[0140] S420: Determine collision information between at least one skeletal point in the plurality of skeletal chains and a collision body, and determine target display information of the at least one skeletal point in the video frame to be processed based on the collision information.
[0141] S430: Determine the target displacement according to the initial position information of the current skeleton point and the target display information.
[0142] The current skeleton point may be the skeleton point that has collided with the target collision body and is located within the target collision body. The initial position information may be the position information of the current skeleton point when it is within the target collision body. The target display information may be the target position information of the current skeleton point after adjustment in the video frame to be processed. The target displacement may be the change in the display position of the current skeleton point in the display interface from the initial position to the target display position.
[0143] It should be noted that when adjusting the positions of skeletal points based on their initial position information and target display information, FABRIK (Forward and Backward Reaching Inverse Kinematics) can be used for this purpose. However, while standard FABRIK can set angle constraints for each joint skeletal point, the final result can result in strong distortion of some joint skeletal points, resulting in severe distortion compared to the original motion. The presence of specific joint skeletal points (such as the wrist) can lead to even more severe anti-human skeletal distortion. Therefore, the distortion changes caused by collisions can be evenly distributed across the entire skeletal chain to avoid partial distortion of joints within the skeletal chain, which can lead to severe distortion compared to the original motion.
[0144] Specifically, when the current skeletal point is determined to be within the target collision volume, the initial position information of the current skeletal point and the adjusted target display information of the skeletal point are determined. Based on the initial position information and the target display information, the target displacement to which the current skeletal point should be moved in the display interface is determined. This arrangement has the advantage of accurately moving the skeletal point's display position in the display interface from the initial display position to the target display position, thereby improving the smoothness of the skeletal animation movement and the animation display effect.
[0145] S440: Obtain target display information of at least one to-be-used skeletal point that belongs to the same skeletal chain as the current skeletal point and is associated in a direction opposite to the first direction, and use the target display information of the at least one to-be-used skeletal point as the to-be-used target display information.
[0146] Among them, the skeleton point to be used can be a skeleton point adjacent to the current skeleton point, or it can be other skeleton points on the same skeleton chain as the current skeleton point. It should be noted that the skeleton points to be used can include but are not limited to 1, 2, 3 or 4, etc. Exemplarily, if the current skeleton point is a hand joint skeleton point, the skeleton point to be used can be an upper arm joint skeleton point, a forearm joint skeleton point and a shoulder joint skeleton point on the same skeleton chain as the hand joint skeleton point. The opposite direction of the first direction can be the direction from the current skeleton point to each skeleton point to be used. The target display information of the skeleton point to be used is the display position information of each skeleton point to be used connected to the current skeleton point when the current skeleton point is located inside the target collision body.
[0147] In practical applications, the target display information of the parent bone point belonging to the same bone chain as the current bone point is determined, and each target display information is used as reference information when moving the current collision point from the initial position to the target display position. These reference information can be used as the target display information to be used.
[0148] S450: Determine a rotation angle between at least one skeleton point to be used and the current skeleton point according to the target display information to be used, the initial position information of the current skeleton point, the target display information, and the target displacement.
[0149] The rotation angle can be the small angle that each bone point rotates during collision adjustment. Generally, collision adjustment is required after a bone point collides with the target collision body. During the adjustment process, the bone point and other bone points in the same bone chain as the bone point will rotate a small angle to achieve similarity and smoothness of the skeletal animation.
[0150] Optionally, the rotation angle of at least one skeleton point to be used and the current skeleton point is determined based on the target display information to be used, the target display information of the current skeleton point, and the target displacement, including: for at least one target display information to be used, determining a first offset vector based on the target display information to be used and the initial position information; determining a second offset vector based on the initial display position of the current skeleton point and the target display information; and determining the rotation angle based on the at least one first offset vector, the second offset vector, and the target displacement.
[0151] Among them, the first offset vector can be a vector between the display position of each to-be-used skeleton point in the display interface before adjustment and the initial display position of the current skeleton point in the display interface. It should be noted that the direction of the first offset vector is from each to-be-used skeleton point to the current skeleton point, and the number of first offset vectors is associated with the number of to-be-used skeleton points. For example, when the number of to-be-used skeleton points belonging to the same skeleton chain as the current skeleton point is 3, each to-be-used skeleton point has its corresponding first offset vector. The second offset vector can be a vector from the initial display position of the current skeleton point to the target display position of the current skeleton point. The numerical value of the second offset vector is the same as the target displacement.
[0152] In a specific implementation, for each target display information to be used, a first offset vector is determined based on the target display information to be used and the initial position information of the current skeleton point. Then, based on the initial display position of the current skeleton point and its corresponding target display position, a second offset vector is determined. The vector product between the first offset vector and the second offset vector is determined, and the result after multiplying the modulus of the first offset vector and the target displacement is divided, and the scalar product between the quotient and the first offset vector is determined to obtain the first vector to be used. It should be noted that when there are multiple first offset vectors, the above calculation process needs to be performed to obtain multiple first vectors to be used. Further, each first vector to be used is added together, and the result after addition is divided by the target displacement to obtain the quotient, so as to finally obtain the rotation angle. The advantage of this setting is that it improves the similarity and smoothness of the skeletal animation movement, thereby improving the animation display effect and realism.
[0153] For example, Figure 11 As shown, there are 3 bone points to be used, and the number of corresponding first offset vectors is also 3, namely L1, L2, L3, and d is the second offset vector. The rotation angle can be determined by the following formula:
[0154]
[0155] Where a represents the rotation angle.
[0156] S460: Determine an offset angle of at least one to-be-used skeleton point based on the rotation angle and a preset correction rate.
[0157] Among them, the preset correction rate can be a pre-set adjustment basis for adjusting the to-be-used bone point. The preset correction rate can be any value, optionally, it can be 0.7. In actual application, when the current bone point is adjusted from the initial position to the target position so that the bone point and the target collision body no longer collide, the to-be-used bone point belonging to the same bone chain as the current bone point also needs to be offset accordingly. The angle of movement of the to-be-used bone point in the process can be used as the offset angle of the to-be-used bone point.
[0158] Specifically, after determining the rotation angles of the current skeleton point and each skeleton point to be used, each rotation angle can be multiplied by a preset correction rate to obtain an offset angle of each skeleton point to be used, so that each skeleton point to be used can be moved according to the corresponding offset angle.
[0159] It should be noted that when determining the offset angle of the bone point to be used to correct each bone point to be used, the iterative method can be used for multiple corrections. The number of iterations can be determined based on the number of bone points on the bone chain. During the first few correction adjustments, the rotation angle can be multiplied by the corresponding preset correction rate to achieve the correction of each bone point to be used. During the last iteration, only the parent bone point is updated to ensure that there is no penetration constraint.
[0160] It should also be noted that if during the iteration process, the bone points on the bone chain no longer collide with the target collision body, the iteration process can be ended early.
[0161] S470: Update target display information of the current skeleton point and at least one to-be-used skeleton point in the to-be-processed video frame based on the offset angle of each to-be-used skeleton point and the rotation angle of the current skeleton point.
[0162] In a specific implementation, after determining the offset angle of each skeleton point to be used according to the rotation angle, the display position of the current skeleton point and at least one skeleton point to be used in the display interface can be adjusted according to the determined offset angle and the rotation angle of the current skeleton point, thereby updating the target display information of the current skeleton point and each skeleton point to be used in the video frame to be processed, so that each skeleton point no longer collides with the target collision body, and the collision adjustment process is completed.
[0163] S480: Based on the target display information of at least one skeleton point, control the target virtual object to be displayed in the video frame to be processed.
[0164] It should be noted that when a bone point on the bone chain collides with a target collision body, there may be multiple bone points located inside the target collision body. In this case, when making correction adjustments, it is easy for the bone point to jump when it moves out of the target collision body.
[0165] Based on this, on the basis of the above technical solution, it also includes: if the current bone point is the Nth consecutive bone point on the bone chain located inside the target collision body, then when determining the rotation angle of the next bone point of the current bone point, the next bone point is used as the initial bone point.
[0166] Wherein, N is a preset value, and the initial skeleton point is a skeleton point whose rotation angle is determined independently of the target display information of the skeleton point to be used.
[0167] In practice, when there are multiple skeletal points within the target collision body, when determining the rotation angle of the next skeletal point following the Nth current skeletal point within the collision body, the next skeletal point should be used as the skeletal point whose rotation angle is determined independently of the target display information of the skeletal point to be used. This setting has the advantage of preventing joint distortion during skeletal point movement and improving the smoothness of skeletal movement.
[0168] On the basis of the above technical solution, it also includes: if the current skeleton point belongs to the same skeleton chain and the to-be-used skeleton point located before the current skeleton point in the opposite direction of the first direction is not located inside the target collision body, the current skeleton point is used as the initial skeleton point.
[0169] In a specific implementation, there are multiple current skeleton points located inside the target collision body, and when correcting and adjusting the skeleton points to be used that belong to the same skeleton chain and are located before the current skeleton point in the opposite direction of the first direction according to the current skeleton point, it is necessary to determine the positional relationship between the skeleton point to be used and the current skeleton point to be adjusted. When the skeleton point to be used is not located inside the target collision body, the current skeleton point adjacent to the skeleton point to be used is used as the initial skeleton point, and the angle calculation is performed based on the initial skeleton point, and the offset angle of the skeleton point to be used is determined based on the rotation angle to achieve corrective adjustment of each skeleton point. The advantage of this setting is that it avoids the problem of joint distortion of the skeleton point during movement and improves the smoothness of the skeleton movement.
[0170] The technical solution of the disclosed embodiment, by determining that the current skeleton point is located inside the target collision body and determining the target display information corresponding to the current skeleton point, updates the target display information of the current skeleton point in the video frame to be processed. This solves the problem that when the display position of the skeleton point in the display interface is adjusted for collision, the adjusted virtual object movement is severely distorted compared with the original movement. This ensures the continuity and smoothness of the adjusted skeleton movement when adjusting the display position of the skeleton point in the display interface, thereby improving the display effect and authenticity of the animation.
[0171] Figure 12A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure is shown in FIG. Figure 12 As shown, the apparatus includes: a skeleton chain division module 510 , a collision information determination module 520 and a target virtual object display module 530 .
[0172] The skeleton chain division module 510 is used to divide the target virtual object in the video frame to be processed into multiple skeleton chains; wherein the skeleton chain includes at least one skeleton point;
[0173] A collision information determination module 520 is configured to determine collision information between at least one skeletal point in a plurality of skeletal chains and a collision body, and based on the collision information, determine target display information of the at least one skeletal point in a video frame to be processed;
[0174] The target virtual object display module 530 is configured to control the target virtual object to be displayed in the video frame to be processed based on the target display information of at least one skeleton point.
[0175] On the basis of the above technical solutions, the skeleton chain division module 510 includes a detection part division unit and a skeleton chain determination unit.
[0176] A detection part division unit, configured to divide the target virtual object into a plurality of detection parts based on a preset part division rule;
[0177] The skeleton chain determining unit is used to determine the skeleton chains corresponding to the multiple detection parts.
[0178] On the basis of the above technical solutions, the collision information determination module 520 includes a collision body type determination submodule and a collision information determination submodule.
[0179] A collision body type determination submodule, configured to determine at least one target collision body corresponding to the target virtual object and a corresponding collision body type;
[0180] The collision information determination submodule is configured to determine collision information between the skeleton point and the at least one target collision body according to the type of the at least one skeleton point and the collision body.
[0181] On the basis of the above technical solutions, the collision body type is a spherical collision body, and the collision information determination submodule is also used to determine the collision information between the skeleton point and the target collision body for two adjacent skeleton points along the first direction on the same skeleton chain according to the target collision body, the first collision body to which the parent skeleton point belongs, and the second collision body to which the child skeleton point belongs; wherein the parent skeleton point is the skeleton point that deviates from the first direction, and the child skeleton point is the skeleton point that points to the first direction.
[0182] On the basis of the above technical solutions, the collision information determination submodule includes a parent skeleton point collision information determination unit and a child skeleton point collision information determination unit.
[0183] a parent skeleton point collision information determining unit, configured to determine, for a parent skeleton point, a first sphere center distance between the first collision body and the target collision body, and determine collision information between the parent skeleton point and the target collision body based on the first sphere center distance and a target sphere radius of the target collision body;
[0184] The sub-skeleton point collision information determination unit is used to determine the second sphere center distance between the second collision body and the target collision body for the sub-skeleton point, and determine the collision information between the sub-skeleton point and the target collision body based on the second sphere center distance, the target sphere radius and the second sphere radius of the second collision body.
[0185] On the basis of the above technical solutions, the parent skeleton point collision information determining unit includes a first collision information determining subunit and a second collision information determining subunit.
[0186] a first collision information determining subunit, configured to determine, if the first sphere center distance is less than the radius of the target sphere, the collision information of the parent skeleton point as first collision information, wherein the first collision information indicates that the parent skeleton point is located inside the target collision body;
[0187] The second collision information determination subunit is used to determine that the collision information of the child skeleton point is the second collision information if the first sphere center distance is greater than the radius of the target sphere, and the second collision information is that the child skeleton point is located inside the target collision body.
[0188] On the basis of the above technical solutions, the sub-skeleton point collision information determining unit includes a first radius determining sub-unit, a third collision information determining sub-unit and a second collision information determining sub-unit.
[0189] The first sum radius determination subunit is used to determine the first sum radius based on the target sphere radius and the second sphere radius; the third collision information determination subunit is used to determine that the collision information is the third collision information if the second sphere center distance is greater than the first sum radius, and the third collision information is that the child skeleton point does not collide with the target collision body; the second collision information determination subunit is used to determine that the collision information is the second collision information if the second sphere center distance is less than the first sum radius, and the second collision information is that the child skeleton point is located inside the target collision body.
[0190] On the basis of the above technical solutions, the collision information determination module 520 includes a target display position adjustment submodule for adjusting the target display position of the parent bone point in the video frame to be processed according to the target sphere center coordinates of the target collision body, the first sphere center coordinates of the first collision body, the second sphere center coordinates of the second collision body, and the first sum radius if the collision information is the first collision information;
[0191] The parent skeleton point corresponds to the first sphere center coordinate, the child skeleton point corresponds to the second sphere center coordinate, and the target display information includes the target display position.
[0192] Based on the above technical solutions, the collision information determination module 520 includes a target display information determination submodule, which is used to determine the target display information of the child skeleton point in the video frame to be processed based on the first radius, the first sphere center distance, the first sphere center coordinates of the parent skeleton point, and the second sphere center coordinates of the child skeleton point if the collision information is the second collision information.
[0193] On the basis of the above technical solutions, the target display information determination submodule includes a first transition value determination unit, a first unit vector determination unit, a second transition value determination unit and a target display information determination unit.
[0194] a first transition value determining unit, configured to determine a first transition value based on the first spherical center distance, a first radius, and a third spherical center distance between the first spherical center coordinate and the second spherical center coordinate;
[0195] a first unit vector determining unit, configured to determine a first unit vector according to the first sphere center coordinates and the target sphere center coordinates;
[0196] a second transition value determining unit, configured to determine a second transition value based on the first transition value, the first sphere center coordinates, and the first unit vector;
[0197] The target display information determining unit is configured to determine the target display information based on the second transition value, the first unit vector, and the second sphere center coordinates.
[0198] On the basis of the above technical solutions, the target display information determination unit includes a third transition value determination subunit, a fourth transition value determination subunit and a target display information determination subunit.
[0199] A third transition value determining subunit, configured to determine a third transition value according to the first sphere center distance, the third sphere center distance, and the first radius;
[0200] a fourth transition value determining subunit, configured to determine a fourth transition value based on the third transition value, the second sphere center coordinates, the first unit vector, and a second unit vector formed by the second transition value and the second sphere center coordinates;
[0201] The target display information determining subunit is configured to determine the target display information of the child skeleton point based on the fourth transition value, the second transition value, and the third transition value.
[0202] Based on the above technical solutions, the collision body type is a rectangular collision body, and the collision information determination submodule is also used to determine the collision information between the bone point and the target collision body for the bone point along the first direction on the same bone chain according to the sub-coordinates of the bone point and the preset function.
[0203] On the basis of the above technical solutions, the collision information determination submodule includes a depth value determination unit and a fourth collision information determination unit.
[0204] a depth value determining unit, configured to determine the depth value of the skeleton point in each dimension based on the sub-coordinates and a preset function;
[0205] The fourth collision information determining unit is configured to determine, if the maximum depth value is less than a preset value, that the collision information between the skeleton point and the target collision body is fourth collision information.
[0206] On the basis of the above-mentioned technical solutions, the collision information determination module 520 is also used to determine the target display information of the skeleton point in the video frame to be processed based on the parent coordinate information of the parent skeleton point on which the skeleton point depends, the child coordinate information, and the length information of the target collision body in each dimension if the collision information is the fourth collision information.
[0207] Based on the above technical solutions, when the current skeleton point is located inside the target collision body and after determining the target display information corresponding to the current skeleton point, the device also includes: a target displacement determination module, a target display information to be used determination module, a rotation angle determination module, an offset angle determination module and a target display information update module.
[0208] A target displacement determination module, configured to determine the target displacement according to the initial position information of the current skeleton point and the target display information;
[0209] a target display information determination module to be used, configured to obtain target display information of at least one skeletal point to be used that belongs to the same skeletal chain as the current skeletal point and is associated with the current skeletal point in a direction opposite to the first direction, and use the target display information of the at least one skeletal point to be used as the target display information to be used;
[0210] a rotation angle determination module, configured to determine a rotation angle between the at least one to-be-used skeleton point and the current skeleton point according to the to-be-used target display information, the target display information of the current skeleton point, and the target displacement;
[0211] an offset angle determination module, configured to determine an offset angle of the at least one to-be-used skeletal point based on the rotation angle and a preset correction rate;
[0212] The target display information updating module is used to update the target display information of the current skeleton point and the at least one to-be-used skeleton point in the to-be-processed video frame based on the offset angle of each to-be-used skeleton point and the rotation angle of the current skeleton point.
[0213] On the basis of the above technical solutions, the device further includes: a first module for determining initial skeleton points.
[0214] The first module for determining an initial skeleton point is configured to, if the current skeleton point is the Nth consecutive skeleton point on the skeleton chain located inside the target collision body, use the next skeleton point as the initial skeleton point when determining the rotation angle of the next skeleton point of the current skeleton point;
[0215] Wherein, N is a preset value, and the initial skeleton point is a skeleton point whose rotation angle is determined independently of the target display information of the skeleton point to be used.
[0216] On the basis of the above technical solutions, the device further includes: a second module for determining initial skeleton points.
[0217] The second module for determining the initial skeleton point is used to use the current skeleton point as the initial skeleton point if the skeleton point to be used belongs to the same skeleton chain as the current skeleton point and is located before the current skeleton point in the opposite direction of the first direction but is not located inside the target collision body.
[0218] The technical solution of the embodiment of the present disclosure is as follows: by dividing the target virtual object in the video frame to be processed into multiple skeleton chains, further determining the collision information between at least one skeleton point in the multiple skeleton chains and the collision body, and based on the collision information, determining the target display information of at least one skeleton point in the video frame to be processed; finally, based on the target display information of at least one skeleton point, controlling the target virtual object to be displayed in the video frame to be processed, thereby solving the problem of poor animation display effect caused by the mutual penetration and superposition of the skeleton point and the collision body due to the collision between the skeleton point of the target virtual object and the collision body; by automatically adjusting the display position of the skeleton point of the target virtual object in the display interface when the penetration problem is detected in the display interface, the effect of improving the realism of the display picture is achieved, further improving the display effect of the animation, and enhancing the user experience.
[0219] The image processing device provided by the embodiments of the present disclosure can execute the image processing method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0220] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0221] Figure 13 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 13 , which shows an electronic device (eg Figure 13 The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 13 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0222] like Figure 13 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a pattern processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 306 into a random access memory (RAM) 303. Various programs and data required for the operation of the electronic device 300 are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An edit / output (I / O) interface 305 is also connected to the bus 304.
[0223] Typically, the following devices may be connected to the I / O interface 305: an editing device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 13The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0224] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 306, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0225] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0226] The electronic device provided by the embodiment of the present disclosure and the image processing method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0227] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the image processing method provided by the above embodiment is implemented.
[0228] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0229] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0230] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0231] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0232] Dividing the target virtual object in the video frame to be processed into multiple skeleton chains; wherein the skeleton chain includes at least one skeleton point;
[0233] Determining collision information between at least one skeletal point in the plurality of skeletal chains and a collision body, and determining target display information of the at least one skeletal point in the to-be-processed video frame based on the collision information;
[0234] Based on the target display information of the at least one skeleton point, the target virtual object is controlled to be displayed in the video frame to be processed.
[0235] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0236] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0237] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0238] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0239] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0240] According to one or more embodiments of the present disclosure, [Example 1] provides an image processing method, the method comprising:
[0241] Dividing the target virtual object in the video frame to be processed into multiple skeleton chains; wherein the skeleton chain includes at least one skeleton point;
[0242] Determining collision information between at least one skeletal point in the plurality of skeletal chains and a collision body, and determining target display information of the at least one skeletal point in the to-be-processed video frame based on the collision information;
[0243] Based on the target display information of the at least one skeleton point, the target virtual object is controlled to be displayed in the video frame to be processed.
[0244] According to one or more embodiments of the present disclosure, [Example 2] provides an image processing method, the method further comprising:
[0245] Optionally, the target virtual object is divided into a plurality of detection parts based on a preset part division rule;
[0246] A skeletal chain corresponding to the plurality of detection parts is determined.
[0247] According to one or more embodiments of the present disclosure, [Example 3] provides an image processing method, the method further comprising:
[0248] Optionally, determining at least one target collision body corresponding to the target virtual object and a corresponding collision body type;
[0249] According to the type of the at least one skeleton point and the collision body, collision information between the skeleton point and the at least one target collision body is determined.
[0250] According to one or more embodiments of the present disclosure, [Example 4] provides an image processing method, the method further comprising:
[0251] Optionally, for two adjacent skeletal points along the first direction on the same skeletal chain, collision information between the skeletal points and the target collision body is determined according to the target collision body, the first collision body to which the parent skeletal point belongs, and the second collision body to which the child skeletal point belongs;
[0252] The parent skeleton point is a skeleton point that deviates from the first direction, and the child skeleton point is a skeleton point that points to the first direction.
[0253] According to one or more embodiments of the present disclosure, [Example 5] provides an image processing method, the method further comprising:
[0254] Optionally, for the parent skeleton point, a first sphere center distance between the first collision body and the target collision body is determined, and collision information between the parent skeleton point and / or the child skeleton point and the target collision body is determined based on the first sphere center distance and the target sphere radius of the target collision body;
[0255] For the child skeleton point, determine the second sphere center distance between the second collision body and the target collision body, and determine the collision information between the child skeleton point and the target collision body based on the second sphere center distance, the target sphere radius and the second sphere radius of the second collision body.
[0256] According to one or more embodiments of the present disclosure, [Example 6] provides an image processing method, the method further comprising:
[0257] Optionally, if the first sphere center distance is smaller than the radius of the target sphere, the collision information of the parent skeleton point is determined to be first collision information, and the first collision information indicates that the parent skeleton point is located inside the target collision body;
[0258] If the first sphere center distance is greater than the radius of the target sphere, the collision information of the child skeleton point is determined to be the second collision information, and the second collision information indicates that the child skeleton point is located inside the target collision body.
[0259] According to one or more embodiments of the present disclosure, [Example 7] provides an image processing method, the method further comprising:
[0260] Optionally, a first sum radius is determined based on the target sphere radius and the second sphere radius;
[0261] If the second sphere center distance is greater than the first sum radius, determining that the collision information is third collision information, and the third collision information indicates that the child skeleton point does not collide with the target collision body;
[0262] If the second sphere center distance is less than the first sum radius, the collision information is determined to be second collision information, and the second collision information indicates that the child skeleton point is located inside the target collision body.
[0263] According to one or more embodiments of the present disclosure, [Example 8] provides an image processing method, the method further comprising:
[0264] Optionally, if the collision information is first collision information, adjusting the target display position of the parent bone point in the video frame to be processed according to the target sphere center coordinates of the target collision body, the first sphere center coordinates of the first collision body, the second sphere center coordinates of the second collision body, and the first sum radius;
[0265] The parent skeleton point corresponds to the first sphere center coordinate, the child skeleton point corresponds to the second sphere center coordinate, and the target display information includes the target display position.
[0266] According to one or more embodiments of the present disclosure, [Example 9] provides an image processing method, the method further comprising:
[0267] Optionally, if the collision information is the second collision information, the target display information of the child skeleton point in the video frame to be processed is determined based on the first radius, the first center-of-sphere distance, the first center-of-sphere coordinates of the parent skeleton point, and the second center-of-sphere coordinates of the child skeleton point.
[0268] According to one or more embodiments of the present disclosure, [Example 10] provides an image processing method, the method further comprising:
[0269] Optionally, a first transition value is determined based on the first spherical center distance, the first radius, and a third spherical center distance between the first spherical center coordinate and the second spherical center coordinate;
[0270] Determine a first unit vector according to the first sphere center coordinates and the target sphere center coordinates;
[0271] determining a second transition value based on the first transition value, the first spherical center coordinates, and the first unit vector;
[0272] The target display information is determined based on the second transition value, the first unit vector, and the second sphere center coordinates.
[0273] According to one or more embodiments of the present disclosure, [Example 11] provides an image processing method, the method further comprising:
[0274] Optionally, a third transition value is determined according to the first spherical center distance, the third spherical center distance, and the first radius;
[0275] determining a fourth transition value based on the third transition value, the second spherical center coordinates, the first unit vector, and a second unit vector formed by the second transition value and the second spherical center coordinates;
[0276] Target display information of the child skeleton point is determined based on the fourth transition value, the second transition value, and the third transition value.
[0277] According to one or more embodiments of the present disclosure, [Example 12] provides an image processing method, the method further comprising:
[0278] Optionally, for a skeleton point along the first direction on the same skeleton chain, collision information between the skeleton point and the target collision body is determined according to the sub-coordinates of the skeleton point and a preset function.
[0279] According to one or more embodiments of the present disclosure, [Example 13] provides an image processing method, the method further comprising:
[0280] Optionally, determining the depth value of the skeleton point in each dimension based on the sub-coordinates and a preset function;
[0281] If the maximum depth value is less than a preset value, the collision information between the skeleton point and the target collision body is determined to be fourth collision information.
[0282] According to one or more embodiments of the present disclosure, [Example 14] provides an image processing method, the method further comprising:
[0283] Optionally, if the collision information is the fourth collision information, the target display information of the skeleton point in the video frame to be processed is determined based on the parent coordinate information of the parent skeleton point on which the skeleton point depends, the child coordinate information, and the length information of the target collision body in each dimension.
[0284] According to one or more embodiments of the present disclosure, [Example 15] provides an image processing method, the method further comprising:
[0285] Optionally, based on the target display position after the adjustment of at least one skeleton point, the target virtual object is rendered in the video frame to be processed.
[0286] According to one or more embodiments of the present disclosure, [Example 16] provides an image processing method, the method further comprising:
[0287] Optionally, determining a target displacement based on the initial position information of the current skeleton point and the target display information;
[0288] Acquire target display information of at least one to-be-used skeletal point that belongs to the same skeletal chain as the current skeletal point and is associated with the current skeletal point in a direction opposite to the first direction, and use the target display information of the at least one to-be-used skeletal point as the to-be-used target display information;
[0289] determining a rotation angle between the at least one to-be-used skeleton point and the current skeleton point according to the to-be-used target display information, the target display information of the current skeleton point, and the target displacement;
[0290] determining an offset angle of the at least one to-be-used skeletal point based on the rotation angle and a preset correction rate;
[0291] Based on the offset angle of each to-be-used skeleton point and the rotation angle of the current skeleton point, target display information of the current skeleton point and the at least one to-be-used skeleton point in the to-be-processed video frame is updated.
[0292] According to one or more embodiments of the present disclosure, [Example 17] provides an image processing method, the method further comprising:
[0293] Optionally, for the at least one target display information to be used, determining a first offset vector according to the target display information to be used and the initial position information;
[0294] determining a second offset vector according to the initial display position of the current skeleton point and the target display information;
[0295] The rotation angle is determined based on at least one first offset vector, a second offset vector, and the target displacement.
[0296] According to one or more embodiments of the present disclosure, [Example 18] provides an image processing method, the method further comprising:
[0297] If the current skeleton point is the Nth consecutive skeleton point on the skeleton chain located inside the target collision body, then when determining the rotation angle of the next skeleton point of the current skeleton point, the next skeleton point is used as the initial skeleton point;
[0298] Wherein, N is a preset value, and the initial skeleton point is a skeleton point whose rotation angle is determined independently of the target display information of the skeleton point to be used.
[0299] According to one or more embodiments of the present disclosure, [Example 19] provides an image processing method, the method further comprising:
[0300] If the to-be-used skeleton point belongs to the same skeleton chain as the current skeleton point and is located before the current skeleton point in the opposite direction of the first direction and is not located inside the target collision volume, the current skeleton point is used as the initial skeleton point.
[0301] According to one or more embodiments of the present disclosure, [Example 20] provides an image processing device, the device including:
[0302] A skeleton chain division module, configured to divide the target virtual object in the video frame to be processed into a plurality of skeleton chains; wherein the skeleton chain includes at least one skeleton point;
[0303] a collision information determination module, configured to determine collision information between at least one skeletal point in the plurality of skeletal chains and a collision body, and determine target display information of the at least one skeletal point in the to-be-processed video frame based on the collision information;
[0304] The target virtual object display module is used to control the target virtual object to be displayed in the video frame to be processed based on the target display information of the at least one skeleton point.
[0305] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0306] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0307] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. An image processing method, characterized in that: include: Dividing the target virtual object in the video frame to be processed into multiple skeleton chains; wherein the skeleton chain includes at least one skeleton point; Determine collision information between at least one skeletal point in the plurality of skeletal chains and a collision body, and determine target display information of the at least one skeletal point in the to-be-processed video frame based on the collision information; wherein the collision information includes information determined when a detection portion to which the skeletal point belongs collides with the collision body; and the target display information is a display position of the skeletal point in the to-be-processed video frame when the detection portion to which the skeletal point belongs does not collide with the collision body; Based on the target display information of the at least one skeleton point, the target virtual object is controlled to be displayed in the video frame to be processed.
2. The method according to claim 1, characterized in that The step of dividing the target virtual object in the video frame to be processed into multiple skeletal chains includes: Dividing the target virtual object into a plurality of detection parts based on a preset part division rule; A skeletal chain corresponding to the plurality of detection parts is determined.
3. The method according to claim 1, characterized in that The determining of collision information between at least one skeletal point in the at least one skeletal chain and a collision body includes: Determine at least one target collision body corresponding to the target virtual object and a corresponding collision body type; According to the type of the at least one skeleton point and the collision body, collision information between the skeleton point and the at least one target collision body is determined.
4. The method according to claim 3, characterized in that The collision body type is a spherical collision body, and determining, based on the at least one skeleton point and the collision body type, collision information between the skeleton point and the at least one target collision body includes: For two adjacent skeletal points along the first direction on the same skeletal chain, determining collision information between the skeletal points and the target collision body according to the target collision body, the first collision body to which the parent skeletal point belongs, and the second collision body to which the child skeletal point belongs; The parent skeleton point is a skeleton point that deviates from the first direction, and the child skeleton point is a skeleton point that points to the first direction.
5. The method according to claim 4, characterized in that The determining, based on the target collision body, the first collision body to which the parent skeleton point belongs, and the second collision body to which the child skeleton point belongs, collision information between the skeleton point and the target collision body includes: For the parent skeleton point, determine a first sphere center distance between the first collision body and the target collision body, and determine collision information between the parent skeleton point and / or the child skeleton point and the target collision body according to the first sphere center distance and the target sphere radius of the target collision body; For the child skeleton point, determine the second sphere center distance between the second collision body and the target collision body, and determine the collision information between the child skeleton point and the target collision body based on the second sphere center distance, the target sphere radius and the second sphere radius of the second collision body.
6. The method according to claim 5, characterized in that The determining, according to the first sphere center distance and the target sphere radius of the target collision body, collision information between the parent skeleton point and the target collision body includes: If the first sphere center distance is less than the radius of the target sphere, determining the collision information of the parent skeleton point as the first collision information, the first collision information indicates that the parent skeleton point is located inside the target collision body; If the first sphere center distance is greater than the radius of the target sphere, the collision information of the child skeleton point is determined to be the second collision information, and the second collision information indicates that the child skeleton point is located inside the target collision body.
7. The method according to claim 5, characterized in that The determining, according to the second sphere center distance, the target sphere radius, and the second sphere radius of the second collision body, collision information between the child skeleton point and the target collision body includes: determining a first sum radius based on the target sphere radius and the second sphere radius; If the second sphere center distance is greater than the first sum radius, determining that the collision information is third collision information, and the third collision information indicates that the child skeleton point does not collide with the target collision body; If the second sphere center distance is less than the first sum radius, the collision information is determined to be second collision information, and the second collision information indicates that the child skeleton point is located inside the target collision body.
8. The method according to claim 6, characterized in that The determining, based on the collision information, target display information of the at least one skeleton point in the to-be-processed video frame includes: If the collision information is the first collision information, adjusting the target display position of the parent bone point in the video frame to be processed according to the target sphere center coordinates of the target collision body, the first sphere center coordinates of the first collision body, the second sphere center coordinates of the second collision body, and the first sum radius; The parent skeleton point corresponds to the first sphere center coordinate, the child skeleton point corresponds to the second sphere center coordinate, and the target display information includes the target display position.
9. The method according to claim 6 or 7, characterized in that The determining, based on the collision information, target display information of the at least one skeleton point in the to-be-processed video frame includes: If the collision information is the second collision information, the target display information of the child skeleton point in the video frame to be processed is determined based on the first radius, the first sphere center distance, the first sphere center coordinates of the parent skeleton point, and the second sphere center coordinates of the child skeleton point.
10. The method according to claim 9, characterized in that The step of determining target display information of the child skeleton point in the video frame to be processed according to the first sum radius, the first sphere center distance, the first sphere center coordinates of the parent skeleton point, and the second sphere center coordinates of the child skeleton point includes: determining a first transition value based on the first spherical center distance, a first radius, and a third spherical center distance between the first spherical center coordinate and the second spherical center coordinate; Determine a first unit vector according to the first sphere center coordinates and the target sphere center coordinates; determining a second transition value based on the first transition value, the first spherical center coordinates, and the first unit vector; The target display information is determined based on the second transition value, the first unit vector, and the second sphere center coordinates.
11. The method according to claim 10, characterized in that The determining the target display information based on the second transition value, the first unit vector, and the second sphere center coordinates includes: determining a third transition value according to the first spherical center distance, the third spherical center distance, and the first radius; determining a fourth transition value based on the third transition value, the second spherical center coordinates, the first unit vector, and a second unit vector formed by the second transition value and the second spherical center coordinates; Target display information of the child skeleton point is determined based on the fourth transition value, the second transition value, and the third transition value.
12. The method according to claim 3, characterized in that The collision body type is a cuboid collision body, and determining, based on the at least one skeleton point and the collision body type, collision information between the skeleton point and the at least one target collision body includes: For a skeleton point along the first direction on the same skeleton chain, collision information between the skeleton point and the target collision body is determined according to the sub-coordinates of the skeleton point and a preset function.
13. The method according to claim 12, characterized in that The determining, based on the sub-coordinates of the skeleton point and a preset function, collision information between the skeleton point and the target collision body includes: Determining the depth value of the skeleton point in each dimension based on the sub-coordinates and a preset function; If the maximum depth value is less than a preset value, the collision information between the skeleton point and the target collision body is determined to be fourth collision information.
14. The method according to claim 13, characterized in that The determining, based on the collision information, target display information of the at least one skeleton point in the to-be-processed video frame includes: If the collision information is the fourth collision information, the target display information of the skeleton point in the video frame to be processed is determined based on the parent coordinate information of the parent skeleton point on which the skeleton point depends, the child coordinate information, and the length information of the target collision body in each dimension.
15. The method according to claim 1, wherein When the current skeleton point is located inside the target collision body and after determining the target display information corresponding to the current skeleton point, the method further includes: Determining target displacement according to the initial position information of the current skeleton point and the target display information; Acquire target display information of at least one to-be-used skeletal point that belongs to the same skeletal chain as the current skeletal point and is associated with the current skeletal point in a direction opposite to the first direction, and use the target display information of the at least one to-be-used skeletal point as the to-be-used target display information; Determining a rotation angle between the at least one to-be-used skeleton point and the current skeleton point according to the to-be-used target display information, the initial position information of the current skeleton point, the target display information, and the target displacement; determining an offset angle of the at least one to-be-used skeletal point based on the rotation angle and a preset correction rate; Based on the offset angle of each to-be-used skeleton point and the rotation angle of the current skeleton point, target display information of the current skeleton point and the at least one to-be-used skeleton point in the to-be-processed video frame is updated.
16. The method according to claim 15, characterized in that Also includes: If the current skeleton point is the Nth consecutive skeleton point on the skeleton chain located inside the target collision body, then when determining the rotation angle of the next skeleton point of the current skeleton point, the next skeleton point is used as the initial skeleton point; Wherein, N is a preset value, and the initial skeleton point is a skeleton point whose rotation angle is determined independently of the target display information of the skeleton point to be used.
17. The method according to claim 15, characterized in that Also includes: If the to-be-used skeleton point belongs to the same skeleton chain as the current skeleton point and is located before the current skeleton point in the opposite direction of the first direction and is not located inside the target collision volume, the current skeleton point is used as the initial skeleton point.
18. An image processing device, characterized in that: include: A skeleton chain division module, configured to divide the target virtual object in the video frame to be processed into a plurality of skeleton chains; wherein the skeleton chain includes at least one skeleton point; A collision information determination module is configured to determine collision information between at least one skeletal point in the plurality of skeletal chains and a collision body, and based on the collision information, determine target display information of the at least one skeletal point in the video frame to be processed; wherein the collision information includes information determined when a detection portion to which the skeletal point belongs collides with the collision body; and the target display information is a display position of the skeletal point in the video frame to be processed when the detection portion to which the skeletal point belongs does not collide with the collision body. The target virtual object display module is used to control the target virtual object to be displayed in the video frame to be processed based on the target display information of the at least one skeleton point.
19. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method according to any one of claims 1 to 17.
20. A storage medium comprising computer-executable instructions, wherein the computer-executable instructions are used to perform the image processing method according to any one of claims 1 to 17 when executed by a computer processor.
Citation Information
Patent Citations
Virtual character action control method and device, equipment and storage medium
CN114602177A
Three-dimensional clothing simulation method and device, terminal equipment and storage medium
CN114742952A