Detailed Description
In order to enable a person skilled in the art to better understand the technical solutions of the present application, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
Before the transaction method provided by the application is described in detail, related elements, application scenes and implementation environments related to the application are briefly described.
First, the relevant elements related to the present application will be briefly described.
The augmented reality (augmented reality, AR) technology is a technology for skillfully fusing virtual information with a real world, and widely uses various technical means such as multimedia, three-dimensional modeling, real-time tracking and registration, intelligent interaction, sensing and the like, and applies virtual information such as characters, images, three-dimensional models, music, videos and the like generated by a computer to the real world after simulation, wherein the two kinds of information are mutually complemented, so that the enhancement of the real world is realized.
Secondly, the application scene related to the application is briefly introduced.
With the development of video products (such as short video products), users' demands for video products are also becoming more diversified, such as interesting demands for video products.
In the related art, in order to improve the interestingness of video products, some virtual props are often presented, but the existing virtual props have the technical problem that the display is single and interaction between a user and a video cannot be provided, so that the interestingness of the video content is insufficient.
Aiming at the problems, the application provides a display method of virtual props, which comprises the steps of displaying a shooting picture, and in response to the detection of a target limb in the shooting picture, rendering a first virtual prop in a stereoscopic space corresponding to the shooting picture, wherein the first virtual prop follows the target limb. And when the movement result of the first virtual prop in the three-dimensional space of the shooting picture meets the preset condition, updating the display effect of the first virtual prop in the shooting picture.
In this way, a photographed picture including the target limb and a first virtual prop superimposed on the photographed picture are displayed, wherein the first virtual prop follows the target limb. Further, the motion of the target limb is detected, and when the motion of the target limb is a target motion (for example, a throwing motion or a throwing motion), a motion track of the first virtual prop generated based on the target motion in the three-dimensional space is displayed. Subsequently, under the condition that the movement result of the first virtual prop in the three-dimensional space meets the preset condition, the display effect of the first virtual prop is updated. Therefore, the user can interact with the virtual prop in real time, the virtual prop is controlled to move through the interaction action, and the display effect of the virtual prop display is controlled through the interaction action, so that the interestingness of the video content is improved, and the interestingness of video shooting is improved.
Finally, the implementation environment (implementation architecture) related to the method provided by the application is briefly introduced.
The method for displaying the virtual prop provided by the embodiment of the disclosure can be applied to a display system of the virtual prop, and fig. 1 shows a schematic structural diagram of the display system of the virtual prop. As shown in fig. 1, a display system 10 of a virtual prop includes a display device 11 of the virtual prop and an electronic apparatus 12. The display device 11 of the virtual prop is connected to the electronic device 12. The display device 11 of the virtual prop and the electronic device 12 may be connected in a wired manner or may be connected in a wireless manner, which is not limited in the embodiment of the present invention.
The display device 11 of the virtual prop is used for displaying a shooting picture, and rendering a first virtual prop in a stereoscopic space corresponding to the shooting picture in response to detecting a target limb in the shooting picture. The first virtual prop follows the target limb. The display device 11 of the virtual prop is further configured to display, in the photographed image, a motion trajectory of the first virtual prop generated based on the target motion in the stereoscopic space when the motion of the target limb is the first target motion. The display device 11 of the virtual prop is further configured to update a display effect of the first virtual prop in the photographed picture when a movement result of the first virtual prop in the photographed picture stereoscopic space meets a preset condition.
The display device 11 of the virtual prop comprises a camera. The display device of the virtual prop is also used for collecting the image of the real world through the camera, inputting the image of the real world into a preset enhancement algorithm and outputting a display picture.
It should be noted that, the preset enhancement algorithm is in the display device 11 of the virtual prop preset by the operation and maintenance personnel.
The display device 11 of the virtual prop may implement the display method of the virtual prop of the embodiment of the present disclosure in various electronic devices 12.
The electronic device 12 may be, but is not limited to, a device that supports running application clients for cell phones, tablet computers, notebook computers, PCs, and the like.
In different application scenarios, the display device 11 and the electronic device 12 of the virtual prop may be independent devices, or may be integrated in the same device, which is not limited in particular in the embodiment of the present invention.
When the display device 11 of the virtual prop and the electronic device 12 are integrated in the same device, the data transmission mode between the display device 11 of the virtual prop and the electronic device 12 is the data transmission mode between the internal modules of the device. In this case, the data transfer flow therebetween is the same as the "data transfer flow between the display device 11 of the virtual prop and the electronic device 12 in the case where the two are independent of each other".
In the following embodiments provided in the embodiments of the present disclosure, a display device 11 and an electronic device 12 of a virtual prop are set independently of each other for example.
Fig. 2 is a flow chart illustrating a method of displaying a virtual prop, according to some example embodiments. In some embodiments, the method for displaying a virtual prop described above may be applied to a display device of a virtual prop, an electronic device, or other similar devices as shown in fig. 1, and the following description is given with respect to the application of the method for displaying a virtual prop to an electronic device.
In order to improve the interest of video content, the method for displaying virtual props provided by the embodiment of the application, as shown in fig. 2, comprises S201-S205.
S201, the electronic equipment displays a shooting picture.
As one possible implementation manner, the electronic device responds to a first operation of a user, enters a first special effect mode, and obtains a shooting picture in real time through the camera. Further, the electronic device displays the photographing screen.
In some embodiments, the electronic device turns on the camera in response to an operation to turn on the camera with the user, and enters a first special effect mode in response to a first operation by the user. Further, the electronic device acquires the shooting picture in real time through the camera, and displays the shooting picture.
In some embodiments, the electronic device turns on the camera and enters the first special effect mode in response to a special effect mode selection operation by the user. Further, the electronic device acquires the shooting picture in real time through the camera, and displays the shooting picture.
The electronic device, after displaying the target interface of the target application, opens the camera and enters the first special effect mode in response to a click operation of the user. Further, the electronic device acquires the shooting picture in real time through the camera, and displays the shooting picture.
The first operation may be a touch operation by the user, a long press operation by the user, or a limb movement operation by the user. The first special effect mode is a special effect mode for entering the display method of the virtual prop provided by the embodiment of the application.
The electronic device, upon detecting that the user is drawing a gesture of "V", illustratively, enters a first special effect mode.
And S202, the electronic equipment responds to the detection of the target limb in the shooting picture, and renders the first virtual prop in the stereoscopic space corresponding to the shooting picture.
Wherein the first virtual prop follows the target limb.
As one possible implementation manner, after acquiring a shooting picture shot by the camera, the electronic device detects whether a target limb is included in the shooting picture, and if the target limb is detected in the shooting picture, superimposes the first virtual prop on the shooting picture. Subsequently, the electronic equipment renders the shooting picture overlapped with the first virtual prop to obtain a display picture, and displays the display picture.
In some embodiments, after acquiring a shot picture taken by the camera, the electronic device constructs a stereoscopic space corresponding to the shot picture based on the shot picture and a preset space construction algorithm. Further, the electronic device detects whether the shooting picture includes the target limb, and determines the position of the target limb in the stereoscopic space when the shooting picture detects the target limb. And subsequently, rendering the first virtual prop in the stereoscopic space corresponding to the shooting picture of the electronic equipment, and displaying the shooting picture and the first virtual prop.
Illustratively, the first virtual prop is a rabbit with the target limb as a hand. And rendering the rabbit in the stereoscopic space corresponding to the shooting picture under the condition that the electronic equipment detects hands in the shooting picture. Further, the electronic device is based on the shot picture and the rendered rabbit, and displays the shot picture and the rabbit.
Illustratively, the first virtual prop is a football with the target limb as a foot. In the case where the electronic device detects a foot in the photographed screen, a soccer ball is superimposed on the photographed screen. Further, the electronic device is based on the shot picture and the rendered football, and displays the shot picture and the football.
In some implementations, the position of the electronic device at which the first virtual prop is superimposed is determined by the position of the target limb and/or the pose of the target limb.
Illustratively, with the target limb as the hand, the first virtual prop is stone. In the case where the electronic apparatus detects a hand in the photographed screen, a stone is superimposed over the hand of the photographed screen.
Illustratively, the first virtual prop is a football with the target limb as a foot. When the electronic device detects a foot in the photographed screen, a soccer ball is superimposed on the foot surface of the photographed screen.
Illustratively, with the target limb as the hand, the first virtual prop is stone. In the case where the electronic apparatus detects the hand-held posture in the photographed picture, a stone is superimposed in the palm of the photographed picture.
It should be noted that, the first virtual prop may be selected randomly, or may be corresponding to the target limb, and the relationship between the target limb and the first virtual prop is not limited in the embodiment of the present application. The position of the first virtual prop may be located at any position in the shot image, for example, may be above the target limb or may be below the target limb, which is not limited in the embodiment of the present application.
In another case, the electronic apparatus detects whether a target limb is included in a photographed picture after acquiring the photographed picture photographed by the camera. If the shooting picture is detected to not comprise the target limb within the preset time, the electronic equipment displays a prompt message or prompt voice.
For example, in the case where the electronic device does not detect that the target limb is included in the photographed image within 5 seconds, the electronic device displays "please show the interactive limb" or issues "please show the interactive limb within the photographing range of the camera" in the screen.
S203, the electronic equipment detects the action of the target limb in the shooting picture.
As one possible implementation manner, the electronic device acquires motion characteristic data of the target limb in the stereoscopic space corresponding to the photographed picture. Wherein the motion characteristic data includes a motion velocity and a motion gesture. Further, the electronic device inputs the movement characteristic data to a preset movement detection neural network, and detects whether the movement of the target limb is the target movement.
Illustratively, the target limb is a hand and the target action is a hand throwing action. The electronic equipment acquires the motion speed and the motion gesture of the hand in the stereoscopic space of the shot picture, and inputs the motion speed and the motion gesture into a preset motion detection neural network so as to detect the motion of the hand.
Illustratively, the target limb is the head and the target motion is the top-impact motion. The electronic equipment acquires the movement speed and the movement gesture of the head in a shooting picture, and inputs the movement speed and the movement gesture into a preset action detection neural network so as to detect the action of the target limb.
Also exemplary, taking the target limb as a foot, the target motion is exemplified by a skirting motion. The electronic equipment acquires the movement speed and the movement gesture of the head in a shooting picture, and inputs the movement speed and the movement gesture into a preset action detection neural network so as to detect the action of the foot.
The preset action detection neural network is an electronic device which is pre-trained and set by operation and maintenance personnel. The video frame of the target limb in the photographed picture is generated based on the moving image of the target limb in the real world. The shot picture may be a shot picture of shooting a short video or a shot picture of a live broadcasting room, and the embodiment of the application is not limited thereto.
And S204, when the motion of the target limb is the target motion, the electronic equipment displays a motion track generated by the first virtual prop based on the target motion in the three-dimensional space.
As one possible implementation manner, the electronic device determines whether the motion of the target limb is a target motion, and obtains a current motion parameter of the target limb in the stereoscopic space when determining that the motion of the target limb is the target motion. The current motion parameters include a current speed, a current position, and a current time. The electronic equipment inputs the current motion parameters into a preset motion equation, determines a motion track, and displays the motion track of the first virtual prop in the three-dimensional space.
Illustratively, the target limb is a hand, the target motion is a hand throwing motion, and the first virtual prop is a bone. And the electronic equipment determines the motion trail of the hand-thrown bone and displays the motion trail of the meat bone in the three-dimensional space under the condition that the hand-thrown motion is determined.
Illustratively, the first virtual prop is a football, taking the target limb as the head, the target motion as the impact motion. And the electronic equipment determines the motion track of the football in the collision under the condition of determining to make the collision action, and displays the motion track of the football in the three-dimensional space.
Also exemplary, taking a target limb as a foot, a target action as a skirting action, and a first virtual prop as an example of a flower. And under the condition that the electronic equipment determines to make the skirting action, determining the motion trail of the skirting flower, and displaying the motion trail of the football in the three-dimensional space.
The specific implementation manner of this step may refer to the following embodiments, and will not be described herein.
In another implementation, the electronic device obtains a movement speed and a movement posture of the target limb, and determines whether the movement speed is greater than or equal to a first preset threshold. Further, the electronic device determines whether the motion gesture matches a preset motion gesture when determining that the motion speed is greater than or equal to a first preset threshold, and determines that the motion of the target limb is a target motion when the motion gesture matches the preset motion gesture. Subsequently, the electronic device displays a motion trail generated by the first virtual prop based on the target motion in the three-dimensional space under the condition that the motion of the target limb is the target motion.
It should be noted that the motion track may include a first motion track in which the first virtual prop follows the target limb and a second motion track in which the first virtual prop moves away from the target limb.
It can be appreciated that in the embodiment of the present application, the electronic device configures a first virtual prop for the target limb in the photographed image. Wherein the first virtual prop moves with the target limb. The electronic device detects whether a target limb makes a target action (such as hand throwing or foot kicking) in the shooting picture, and displays a motion track of the first virtual prop in the three-dimensional space under the condition that the target limb is determined to make the target action in the shooting picture. In this way, the electronic equipment responds to the target action of the target limb, virtually obtains the motion trail of the first virtual prop, displays the first virtual prop according to the motion trail, increases the interactive picture and improves the interestingness of the video content.
S205, updating the display effect of the first virtual prop in the shooting picture by the electronic equipment under the condition that the movement result of the first virtual prop in the three-dimensional space meets the preset condition.
As one possible implementation manner, the electronic device determines whether the first virtual prop collides with a preset plane in the stereoscopic space, and replaces the first virtual prop with the second virtual prop if it is determined that the first virtual prop collides with the plane in the stereoscopic space.
In some embodiments, the electronic device calculates a motion trajectory of the first virtual prop in the stereoscopic space and a collision point of the first virtual prop with the plane in the stereoscopic space if the motion of the target limb is determined to be the target motion. Further, the electronic device displays the first virtual prop in the three-dimensional space according to the motion track, and replaces the first virtual prop with the second virtual prop under the condition that the first virtual prop is displayed to the collision point.
Illustratively, the first virtual prop is a meat bone, the first virtual prop impacts the ground in the stereoscopic space, and the second virtual prop is a puppy. The electronic device replaces the meat bones with puppies to display the puppies at the collision point of the ground in the stereoscopic space in case it is determined that the meat bones are moving to the ground.
Illustratively, taking the first virtual prop as a football, the first virtual prop collides with the sky in the three-dimensional space, and the second virtual prop is a star. In the case of the football moving to the sky, the electronic device replaces the football with a star to display the star at the collision point of the sky.
Also exemplary, a first virtual prop is a flower, the first virtual prop collides with a wall surface in the three-dimensional space, and a second virtual prop is a plant. The electronic device replaces the fresh flowers with plants under the condition that the fresh flowers move to the wall surface so as to display the plants at the collision point of the wall.
Also exemplary, taking the first virtual prop as a cat, the first virtual prop collides with the wall surface of the three-dimensional space. The electronic device displays a lying cat at a collision point where the cat collides with the wall surface in the three-dimensional space.
In some embodiments, the second virtual prop may be determined by the electronic device randomly from a plurality of virtual props, may be determined by the electronic device from a preset prop mapping table based on the first virtual prop, and may be determined by a collision location of the first virtual prop or a collision object of the first virtual prop. The embodiment of the present application is not limited in this regard.
As one possible implementation manner, the electronic device determines whether the first virtual prop collides with a preset position in the stereoscopic space, and replaces the first virtual prop with the second virtual prop if it is determined that the first virtual prop collides with the preset position in the stereoscopic space.
As another possible implementation manner, the electronic device determines whether the first virtual prop collides with a preset position in the stereoscopic space, and updates the current gesture of the first virtual prop to the target gesture if it is determined that the first virtual prop collides with the preset position in the stereoscopic space.
As another possible implementation manner, the electronic device determines whether the first virtual prop collides with a preset object in the stereoscopic space, and updates the current gesture of the first virtual prop to the target gesture if it is determined that the first virtual prop collides with the preset object in the stereoscopic space.
As another possible implementation manner, the electronic device determines whether the first virtual prop collides with a preset plane in the stereoscopic space, and updates the current gesture of the first virtual prop to the target gesture if it is determined that the first virtual prop collides with the preset plane in the stereoscopic space.
As another possible implementation manner, the electronic device determines whether the first virtual prop collides with a preset position in the stereoscopic space, and replaces the first virtual prop with the second virtual prop after updating the current posture of the first virtual prop to the target posture for a preset duration in case of determining that the first virtual prop collides with the preset position in the stereoscopic space.
As another possible implementation manner, the electronic device determines whether the first virtual prop collides with a preset plane in the stereoscopic space, and replaces the first virtual prop with the second virtual prop after updating the current posture of the first virtual prop to the target posture for a preset duration in case of determining that the first virtual prop collides with the preset plane in the stereoscopic space.
As another possible implementation manner, the electronic device determines whether the first virtual prop collides with a preset object in the stereoscopic space, and replaces the first virtual prop with the second virtual prop after updating the current posture of the first virtual prop to the target posture for a preset duration in case of determining that the first virtual prop collides with the preset object in the stereoscopic space.
In the embodiment of the present application, reference may be made to the following steps, which are not described herein.
For a clearer description of the method for displaying the virtual prop in the embodiment of the application, with reference to fig. 3, an exemplary method is that in fig. 3 (a), a small stone is followed in the palm, in fig. 3 (b) and (c), the small stone is thrown out by hand, the small stone makes parabolic motion in a three-dimensional space, and in fig. 3 (d), the small stone collides with the ground. In fig. 3 (e), the doggie is replaced with a puppy.
The application provides a display method of virtual props, which has the following beneficial effects that a shooting picture comprising a target limb and a first virtual prop overlapped on the shooting picture are displayed, wherein the first virtual prop follows the target limb. Further, the motion of the target limb is detected, and when the motion of the target limb is a target motion (for example, a throwing motion or a throwing motion), a motion track of the first virtual prop generated based on the target motion in the three-dimensional space is displayed. Subsequently, under the condition that the movement result of the first virtual prop in the three-dimensional space meets the preset condition, the display effect of the first virtual prop is updated. Therefore, the user can interact with the virtual prop in real time, the virtual prop is controlled to move through the interaction action, and the display effect of the virtual prop display is controlled through the interaction action, so that the interestingness of the video content is improved, and the interestingness of video shooting is improved.
In one design, in order to enhance the interest of the video content, as shown in fig. 4, S206-S208 are further included before S203 provided in the embodiment of the present application.
S206, the electronic equipment detects the gesture of the target limb in the shooting picture.
As one possible implementation, the electronic device detects the posture of the target limb in the photographed picture after acquiring the photographed picture photographed by the camera.
Specifically, after the electronic device acquires the shooting picture, determining the movement speed of the target limb in the stereoscopic space corresponding to the shooting picture and the pose of the target limb, and determining the pose of the target limb according to the movement speed of the target limb in the stereoscopic space corresponding to the shooting picture and the pose of the target limb. Further, the electronic device detects a posture of the target limb.
S207, the electronic device judges whether the gesture of the target limb in the shooting picture is a preset gesture.
As one possible implementation method, the electronic device detects whether the posture of the target limb in the photographing screen is a preset posture in the case of determining the posture of the target limb.
In some embodiments, the preset gesture may include a hand-held gesture, a back gesture, a bending gesture, and may further include a hand-held gesture and a hand-held gesture, which is not limited in the embodiment of the present application.
And S208, the electronic equipment displays the first virtual prop under the condition that the gesture of the target limb is a preset gesture.
As a possible implementation manner, under the condition that the gesture of the target limb is determined to be the preset gesture, the electronic device queries the first virtual prop from the second mapping relation based on the preset gesture, and superimposes the first virtual prop on the shooting picture. The second mapping relation comprises a plurality of gestures and virtual props corresponding to the gestures. Further, the electronic device renders the shooting picture overlapped with the first virtual prop to obtain a display picture, and displays the display picture.
The second mapping relationship is a preset second mapping relationship table.
Illustratively, taking a target limb as a hand, and taking a preset gesture as a hand holding gesture as an example. And under the condition that the gesture of the hand is determined to be the hand-holding gesture, the electronic equipment searches a first virtual prop corresponding to the hand-holding gesture from a first preset mapping relation table based on the hand-holding gesture. Further, the electronic device renders the stone on the hand in the three-dimensional space, obtains a display picture of holding the stone, and displays the display picture of holding the stone.
Illustratively, taking a target limb as a back, a preset posture is taken as an example of a bending posture. And under the condition that the back gesture is determined to be the bending gesture, the electronic equipment searches a first virtual prop corresponding to the bending gesture from a first preset mapping relation table based on the hand bending gesture, namely the rockery. Further, the electronic device renders the rockery on the back in the three-dimensional space, obtains a display picture of the back rockery, and displays the display picture of the back rockery.
In other embodiments, the electronic device randomly configures a first virtual prop for the preset gesture under the condition that the gesture of the target limb is determined to be the preset gesture, renders the first virtual prop in the stereoscopic space, obtains a display picture, and displays the display picture.
In other embodiments, the electronic device determines the first virtual prop based on the current time and a third preset mapping relationship table if it is determined that the pose of the target limb is the preset pose.
In an exemplary case, the electronic device obtains the current time and determines the current time to be the morning when the target limb is determined to be the hand-held gesture. Further, the electronic device determines a first virtual prop corresponding to the morning from a third preset mapping relation table based on the morning.
In an exemplary case, the electronic device obtains the current time and determines the current time as afternoon when determining that the target limb is in the hand-held posture. Further, the electronic device determines a first virtual prop corresponding to afternoon from a second preset mapping relation table based on afternoon.
It should be noted that the second preset mapping relationship table and the third preset mapping relationship table are preset in the electronic device for the operation and maintenance personnel.
It can be appreciated that, in the case where the gesture of the target limb is detected to be the preset gesture, the electronic device configures the first virtual prop for the target limb and presents the first virtual prop to the user. Therefore, under the condition that the intention of user interaction is detected, the electronic equipment configures the first virtual prop for the target limb and displays the first virtual prop, so that the interestingness of video content is improved, and the interestingness of video shooting is improved.
In one design, in order to enhance the display effect of video content, in the method for displaying virtual props provided by the embodiment of the application, the movement result of the first virtual prop in the stereoscopic space meets the preset condition, and the method comprises the step that the first virtual prop collides with a target object in the stereoscopic space.
The target object comprises a preset plane, a preset position or a preset object.
In some embodiments, the preset plane may be a ground or a wall surface in the three-dimensional space, and may also be a sky or a slope, the preset position may be any position in the three-dimensional space, for example, a middle position of the three-dimensional space, the preset position may be adjusted according to different three-dimensional spaces, and the preset object may include an object or a living being in the three-dimensional space. In the embodiment of the application, the preset plane, the preset object and the preset position are not limited.
In the case where the preset plane is included in the stereoscopic space, the preset plane is exemplified as the ground. Under the condition that the first virtual prop moves to the ground in the three-dimensional space, the electronic equipment determines that the movement result of the first virtual prop meets the preset condition. Subsequently, the electronic equipment updates the display effect of the first virtual prop at the collision point of the first virtual prop and the ground in the three-dimensional space.
In the case where the preset plane is included in the stereoscopic space, the preset plane is exemplified as a wall surface. Under the condition that the first virtual prop moves to the wall surface in the three-dimensional space, the electronic equipment determines that the movement result of the first virtual prop meets the preset condition. Subsequently, the electronic equipment updates the display effect of the first virtual prop at the collision point of the first virtual prop and the ground in the three-dimensional space.
In the case where the preset position is included in the stereoscopic space, the preset position is exemplified as the center position of the stereoscopic space. Under the condition that the first virtual prop moves to the central position, the electronic equipment determines that the movement result of the first virtual prop meets the preset condition.
In the case where the preset object is included in the stereoscopic space, the preset object is exemplified as a mountain. Under the condition that the first virtual prop hits the mountain in the three-dimensional space, the electronic equipment determines that the movement result of the first virtual prop meets the preset condition.
In the case where the stereoscopic space includes a preset plane and a preset position, the preset plane is exemplified as the sky and the preset position is exemplified as the intermediate position of the stereoscopic space. The electronic equipment determines a motion trail of the first virtual prop and determines a motion end point of the first virtual prop. If the first virtual prop moves to the sky in the three-dimensional space first, determining that the movement result of the first virtual prop meets the preset condition. If the first virtual prop moves to the middle position of the three-dimensional space, determining that the movement result of the first virtual prop meets the preset condition.
The target object is preset by the electronic device according to the content in the stereoscopic space after the stereoscopic space is generated. The preset object may be a stationary object (e.g. a stone, a hill or a table) as well as a moving object (e.g. a flying bird or a moving stone).
It can be appreciated that the first virtual prop only updates its display effect if it moves to a target position in the stereoscopic space. In this way, the display effect of the video content can be enhanced.
In one design, in order to improve the interest of video content, the embodiment of the application provides S205, which specifically includes S2051-S2053.
S2051, the electronic equipment replaces the first virtual prop with the second virtual prop.
As one possible implementation manner, the electronic device replaces the first virtual prop with the second virtual prop under the condition that the movement result of the first virtual prop in the stereoscopic space meets the preset condition.
Illustratively, the first virtual prop is a bone and the second virtual prop is a dog. And the electronic equipment replaces the bone with the dog under the condition that the movement result of the first virtual prop in the three-dimensional space meets the preset condition.
Illustratively, the first virtual prop is a kitten and the second virtual prop is a lion. And the electronic equipment replaces the kitten with the lion under the condition that the movement result of the first virtual prop in the three-dimensional space meets the preset condition.
S2052, the electronic device updates the current gesture of the first virtual prop to the target gesture.
As one possible implementation manner, the electronic device determines a target gesture of the first virtual prop and updates a current gesture of the first virtual prop to the target gesture when it is determined that a motion result of the first virtual prop in the stereoscopic space meets a preset condition.
For example, taking a first virtual prop as a kitten, the current posture is a lateral posture, and the target posture is a standing posture. And the electronic equipment replaces the cat lying on one side with the cat standing under the condition that the movement result of the cat in the three-dimensional space meets the preset condition.
By way of example, taking a first virtual prop as a flower, a current gesture as a closed gesture, and a target gesture as a blooming gesture as an example. And the electronic equipment replaces the closed flower with the blossom flower under the condition that the movement result of the flower in the three-dimensional space meets the preset condition.
S2053, after updating the current gesture of the first virtual prop to the target gesture for a preset duration, the electronic device replaces the first virtual prop with the second virtual prop.
As one possible implementation manner, the electronic device replaces the first virtual prop with the second virtual prop after updating the current posture of the first virtual prop to the target posture for a preset duration under the condition that the movement result of the first virtual prop in the three-dimensional space meets the preset condition.
Illustratively, taking a first virtual prop as a flower, a current gesture as a closed gesture, a target gesture as a blooming gesture, and a second virtual prop as an example of a cat. And the electronic equipment replaces the closed flowers with flowers which blossom under the condition that the movement result of the flowers in the three-dimensional space meets the preset condition, and replaces the flowers which blossom with cats after displaying the flowers which blossom for 5 seconds.
Illustratively, taking the first virtual prop as a cat, the current posture as a lateral posture, the target posture as a standing posture, and the second virtual prop as an example. And the electronic equipment replaces the lying cat with the standing cat under the condition that the movement result of the cat in the three-dimensional space meets the preset condition, and replaces the standing cat with the lion after displaying the standing cat that is blooming for 3 seconds.
It should be noted that, in the embodiment of the present application, S2051, S2052, and S2053 are not arranged in order, but implemented in different manners.
It can be understood that the electronic device can replace the first virtual prop with the second virtual prop, update the current posture of the first virtual prop with the target posture, or update the current posture of the first virtual prop with the target posture for a preset duration after determining that the movement result of the first virtual prop in the stereoscopic space meets the preset condition. Therefore, different display effects can be presented for the user, and the interestingness of the video content is improved.
In one design, in order to improve the interest of video content, in the method for displaying a virtual prop provided by the embodiment of the application, the target gesture or the gesture of the second virtual prop corresponds to the target object where the first virtual prop collides.
As one possible implementation manner, when determining that the collision position of the first virtual prop is a preset position, the electronic device determines, based on the collision position and the fourth preset mapping relation table, a target gesture of the first virtual prop or a gesture of the second virtual prop.
Illustratively, the first virtual prop is a cat on the trunk at the impact location. And under the condition that the electronic equipment determines to collide with the trunk, searching a target gesture corresponding to the position on the trunk from a fourth preset mapping relation table based on the position on the trunk.
Illustratively, the collision position is taken as a middle position of the three-dimensional space, and the first virtual prop is taken as an example. And the electronic equipment searches the target gesture corresponding to the picture middle position from a fourth preset mapping relation table based on the picture middle position under the condition that the electronic equipment determines that the electronic equipment collides with the middle position of the stereoscopic space.
Thus, the electronic device determines different target attitudes of the first virtual prop or attitudes of the second virtual prop based on different preset positions of collision of the first virtual prop.
As one possible implementation manner, in the case of determining that the first virtual prop collides to the preset plane, the electronic device determines a target gesture of the first virtual prop or a gesture of the second virtual prop based on a type of the preset plane and a fifth preset mapping relationship table.
Illustratively, taking the type of the preset plane as the plane, the second virtual prop is a cat, and the posture of the second virtual prop is a standing posture as an example. And under the condition that the cat is determined to collide on the plane, the electronic equipment searches the target gesture corresponding to the plane from a fifth preset mapping relation table based on the plane, namely, the standing gesture.
Illustratively, taking the type of the preset plane as an inclined plane, the first virtual prop is a cat, and the gesture of the second virtual prop is a running gesture as an example. And under the condition that the cat collides with the inclined plane, the electronic equipment searches the target gesture corresponding to the picture middle position from a fifth preset mapping relation table based on the picture middle position, namely the running gesture.
In this way, the electronic device determines the target gesture of the different first virtual prop or the gesture of the second virtual prop based on the difference of the planes on which the first virtual prop collides.
As one possible implementation manner, in the case of determining that the first virtual prop collides with the preset object, the electronic device determines a target gesture of the first virtual prop or a gesture of the second virtual prop based on a type of the preset object and a sixth preset mapping relationship table.
Illustratively, taking the type of the preset object as a hillside, the second virtual prop is a bird, and the posture of the second virtual prop is a standing posture as an example. And under the condition that the bird collides with the hills, the electronic equipment searches the target gesture corresponding to the plane from a sixth preset mapping relation table based on the plane, namely, the standing gesture.
For example, taking the type of the preset object as a house, the first virtual prop is a cat, and the posture of the second virtual prop is a lateral posture as an example. And the electronic equipment searches a target posture corresponding to the picture middle position from a sixth preset mapping relation table based on the picture middle position under the condition that the cat collides with the house, wherein the target posture is a lateral posture.
In this way, the electronic device collides with different preset objects at the first virtual prop, and determines the target gesture of the different first virtual prop or the gesture of the second virtual prop based on the different preset objects.
As one possible implementation manner, in the case of determining the pose of the collision object of the first virtual prop and the collision position of the first virtual prop, the electronic device determines the target pose of the first virtual prop or the pose of the second virtual prop based on the pose of the collision object, the collision position and the seventh preset mapping relationship table.
For example, taking the second virtual prop as a dog, the pose of the collision object as the ground, the collision position as the middle area of the ground, the pose of the second virtual prop as a standing pose as an example. The electronic device determines the posture of the dog as a standing posture in a case where it is determined that the dog collides with the middle region on the ground.
For example, taking the second virtual prop as a dog, the pose of the collision object as the ground, the collision position as the left area of the ground, the pose of the second virtual prop as the twisting pose as an example. And under the condition that the electronic equipment determines that the dog collides with the left area on the ground, searching from a seventh preset mapping relation table, and obtaining that the posture of the dog is a twisting posture.
Specifically, in some embodiments, when the first virtual prop collides with the target object, the electronic device determines, according to the target object that the first virtual prop collides with, a gesture corresponding to the target object from the first mapping relationship. The first mapping relationship comprises a plurality of objects and a gesture corresponding to each object, and the plurality of objects comprise target objects. And replacing the first virtual prop with the second virtual prop according to the gesture of the target object. The gesture of the second virtual prop is the gesture corresponding to the target object.
In other embodiments, the electronic device determines, in a case where the first virtual prop collides with the target object, a target pose corresponding to the target object from the first mapping relationship according to the target object on which the first virtual prop collides. And updating the current gesture of the first virtual prop to be the target gesture.
In other embodiments, the electronic device determines, in a case where the first virtual prop collides with the target object, a target pose corresponding to the target object from the first mapping relationship according to the target object on which the first virtual prop collides. And updating the current gesture of the first virtual prop to be the target gesture. Further, the electronic device determines a second virtual prop corresponding to the target object and a target posture of the second virtual prop according to the target object from the third mapping relation, and replaces the first virtual prop with the second virtual prop after updating the current posture of the first virtual prop to the target posture for a preset duration. The gesture of the second virtual prop is a target gesture.
It should be noted that the fourth preset mapping relationship table, the fifth preset mapping relationship table, the sixth preset mapping relationship table and the seventh preset mapping relationship table are preset in the electronic device by the operation and maintenance personnel. The fourth preset mapping relationship table, the fifth preset mapping relationship table and the sixth preset mapping relationship may be the same mapping relationship table or may be different mapping relationship tables, which is not limited in this embodiment of the present application.
It is understood that the pose of the first virtual prop at the collision point or the pose of the second virtual prop at the collision point can be determined based on the target object at which the first virtual prop collides. Therefore, the first virtual prop can collide with different target objects, and the virtual props with different postures are presented for the user, so that the interestingness of the video content is improved.
In one design, the method further comprises S209 after S205 of the embodiment of the application for improving the display effect of augmented reality.
S209, after the electronic equipment displays the second virtual prop, displaying a special effect corresponding to the second virtual prop.
As a possible implementation manner, after the first virtual prop is replaced by the second virtual prop, the electronic device determines a special effect corresponding to the second virtual prop according to a preset special effect mapping table, and displays the special effect corresponding to the second virtual prop at a preset position in the shooting picture.
In some embodiments, the electronic device displays the special effect over the second virtual prop.
In other embodiments, the electronic device displays the special effects underneath the second virtual prop.
The embodiment of the application is not particularly limited to the preset position.
As another possible implementation manner, after the first virtual prop is replaced by the second virtual prop, the electronic device randomly selects one special effect from the plurality of special effects, and displays the special effect at a preset position in the shooting picture.
In another case, the electronic device displays the special effect corresponding to the first virtual prop under the condition that the current gesture of the first virtual prop is updated to the target gesture.
It can be understood that after the display effect of the first virtual prop is updated, a special effect picture corresponding to the first virtual prop or the second virtual prop is displayed in the shooting picture, so that the display effect of augmented reality is improved, and the interestingness of the video content is increased.
In one design, in order to increase the interaction effect and increase the interest of the video, as shown in fig. 5, the method for displaying the virtual prop provided by the embodiment of the application further comprises S210-S211.
S210, the electronic equipment detects whether the action of the target limb is a preset interaction action.
As one possible implementation manner, the electronic device detects, in real time or periodically, whether the action of the target limb is a preset interaction action after updating the display effect of the first virtual prop.
Specifically, the electronic device acquires the interaction speed and the interaction gesture of the target limb in the three-dimensional space within a preset time period. Further, the electronic device detects whether the action of the target limb is a preset interaction action according to the interaction speed and the interaction gesture.
In some embodiments, the electronic device obtains a plurality of interaction gestures, and detects whether the action of the target limb is a preset interaction action according to the plurality of interaction gestures.
The preset interaction action may be, for example, up-shaking a finger, left-right-shaking a finger, or left-right-shaking, and the preset interaction action may also be other interaction actions, which is not specifically limited in the embodiment of the present application.
S211, the electronic equipment responds to the action of the target limb to control the second virtual prop to move under the condition that the action of the target limb is detected to be the preset interaction action.
As one possible implementation manner, the electronic device determines that the detected action of the target limb is a preset interaction action when it is determined that the interaction speed is greater than or equal to a second preset speed and the interaction gesture matches the preset interaction gesture. Further, the electronic device controls the second virtual prop to follow the movement of the target limb in response to the movement of the target limb.
In some embodiments, the electronic device determines that the detected motion of the target limb is an interaction motion if it is determined that the motion of the target limb matches a preset interaction gesture. Further, the electronic device controls the second virtual prop to follow the movement of the target limb in response to the interaction of the target limb.
Illustratively, the target limb is taken as a hand, and the interaction is preset as a finger swing motion. The electronic equipment acquires a plurality of hand gestures, and determines that the hand motion is a finger swing motion under the condition that the hand gestures are determined to be matched with preset hand gestures. Further, the electronic device controls the second virtual prop to follow the finger swing.
Illustratively, the target limb is taken as a head, and the interaction is preset as a head shaking motion. The electronic equipment acquires a plurality of head gestures, and determines that the head action is a head shaking action under the condition that the head gestures are matched with the preset head gestures. Further, the electronic device controls the first virtual prop to swing.
As one possible implementation manner, the electronic device determines that the detected action of the target limb is a preset interaction action when it is determined that the interaction speed is greater than or equal to a second preset speed and the interaction gesture matches the preset interaction gesture. Further, the electronic device responds to the action of the target limb, determines the movement mode of the second virtual prop according to the action of the target limb, and controls the movement mode of the second virtual prop to move along with the target limb.
For example, taking a target limb as a hand, presetting interaction as a hand pushing action, and taking a second virtual prop as an example. Under the condition that the hand action is determined to be the hand action, the electronic equipment determines that the movement mode of the lion is running according to the hand action and a preset interaction mapping relation table. Further, the electronic device controls the lion to run.
It should be noted that, the following target limb movement may be the second virtual prop, or may be a part of the second virtual prop, which is not limited in the embodiment of the present application. By way of example, with the second virtual prop as a horse, the electronic device may control the horse to follow the movement of the target limb, and may also control the eyes of the horse to follow the movement of the target limb.
It can be appreciated that the electronic device controls the second virtual prop to move according to the interaction of the target limb according to the action of the target limb, so that the interaction effect is enhanced, and the interestingness of the video content is increased.
In one design, in order to enhance a display effect, in the display method of the virtual prop provided by the embodiment of the application, a motion track generated by the first virtual prop based on a target action in a stereoscopic space comprises a motion track of the first virtual prop in the stereoscopic space after the first virtual prop leaves a target limb in response to the target action.
Illustratively, with the target limb as a hand, the first virtual prop is a stone and the target motion is exemplified by a parabolic motion. The motion trail generated by the stone based on the target action is the parabolic motion trail of the stone leaving the hand.
Illustratively, taking the target limb as a hand, the first virtual prop as a bone, and the target action as an example of a throwing action. The movement trace of the stone generated based on the target action is the throwing movement trace of the stone away from the hand.
It can be understood that the motion trail of the first virtual prop is displayed independently, so that the sense of reality of the interactive picture is enhanced, and the display effect is enhanced.
In one design, the S204 provided by the embodiment of the application comprises S2041, wherein the target motion is a throwing motion for enhancing the display effect.
S2041, when the action of the target limb is a throwing action, the electronic device displays a parabolic motion track generated by the first virtual prop based on the throwing action in the three-dimensional space.
As one possible implementation, after determining that the motion of the target limb is a throwing motion, the electronic device determines a parabolic motion trajectory of the first virtual prop in the stereoscopic space based on the throwing motion, and displays the first virtual prop based on the parabolic motion trajectory.
It is to be appreciated that where the first motion is a throwing motion, the electronic device simulates a parabolic motion trajectory based on the throwing motion and displays the first virtual prop based on the parabolic motion trajectory. Thus, the reality of the interactive picture is enhanced, and the display effect is enhanced.
In one design, in order to enhance the display effect, the motion trail is obtained by superposing and rendering the first virtual prop in the stereoscopic space corresponding to the shot picture.
As one possible implementation manner, when determining that the motion of the target limb is the target motion, the electronic device superimposes the first virtual prop in the stereoscopic space constructed based on the photographed picture and renders to obtain the motion trail of the first virtual prop.
It can be appreciated that a stereoscopic space is constructed based on the photographed picture, thereby determining a motion trajectory of the first virtual prop in the stereoscopic space. Thus, the motion trail presented to the user is more realistic, thereby enhancing the display effect.
In one design, in order to accurately determine the motion of the target limb, as shown in fig. 6, S203 provided by the embodiment of the present application specifically includes S2031-S2032.
S2031, the electronic equipment acquires movement characteristic data of the target limb in a shooting picture.
Wherein the motion characteristic data includes a motion velocity and a motion gesture.
As a possible implementation manner, the electronic device acquires shooting pictures of the target limb at different moments, and determines different positions of the target limb in the three-dimensional space, the moment corresponding to each position of the target limb and the movement posture of the target limb according to the shooting pictures. Further, the electronic device determines the movement speed of the target limb according to different positions of the target limb in the three-dimensional space and the corresponding time of each position of the target limb. Subsequently, the electronic device inputs the movement speed and the movement gesture of the target limb to a preset movement detection neural network, and detects whether the movement of the target limb is a target movement.
The electronic device obtains a first shot image at a first time T1 and a second shot image at a second time T2, and calculates a first position of the target limb in the first shot image and a second position of the target limb in the second shot image according to a preset position algorithm. Further, the electronic device calculates the movement distance of the target limb according to the first position and the second position, and calculates the movement time of the target limb according to T1 and T2. Subsequently, the electronic equipment calculates the movement speed of the target limb according to the movement distance and the movement time, and obtains the movement gesture of the target limb according to the first shooting picture and the second shooting picture.
In some embodiments, the time interval between the first time T1 and the second time T2 is less than or equal to the first time threshold.
For example, the first time threshold may be 3 seconds(s) or 2s, which is not limited in this embodiment of the present application.
S2032, the electronic equipment inputs the movement characteristic data to a preset movement detection neural network to detect whether the movement of the target limb is a target movement.
As a possible implementation manner, the electronic device inputs the motion feature data to a preset motion detection neural network, outputs a motion result, and detects whether the motion of the target limb is a target motion according to the output motion result.
Illustratively, the target action is taken as a manual throwing action. Under the condition that a hand throwing action result is output by a preset action detection neural network, the electronic equipment detects the action of the target limb as a target action.
In another case, the electronic device acquires a movement speed of the target limb and a movement posture of the target limb, and detects whether the movement of the target limb is a target movement according to the movement speed and the movement posture.
Specifically, the electronic device determines whether the motion speed is greater than or equal to a first preset threshold, and whether the motion gesture is a motion gesture corresponding to the target motion. Further, if the movement speed of the electronic device is greater than or equal to the first preset threshold, and the movement gesture is a movement gesture corresponding to the target movement, the electronic device detects that the movement of the target limb is the target movement.
It can be understood that the electronic device detects whether the movement of the target limb is the first movement according to the movement speed and the movement gesture of the target limb in the three-dimensional space, so that the misjudgment of the movement of the target limb is avoided, and the detection accuracy is improved.
In one design, in order to accurately display the motion trail of the first virtual prop, as shown in fig. 7, the embodiment of the application provides S204, which specifically includes S2042-S2044.
S2042, the electronic equipment acquires current motion parameters of the target limb in the three-dimensional space.
Wherein the current motion parameters include a current speed, a current position, and a current time.
As one possible implementation manner, the electronic device acquires the current speed, the current position and the current time of the target limb in the three-dimensional space when detecting that the motion of the target limb is the target motion.
In some embodiments, the electronic device obtains the motion parameters of the target limb (each motion parameter includes speed, position and time) in real time or periodically under the condition that the motion of the target limb is detected as the target motion, so as to obtain a plurality of motion parameters. Further, the electronic device determines the motion parameter corresponding to the maximum speed as the current motion parameter under the condition that the speed of the target limb is detected to be reduced.
In other embodiments, the electronic device determines the motion parameter corresponding to the highest position as the current motion parameter after detecting that the position of the target limb in the stereoscopic space begins to fall.
S2043, the electronic equipment inputs the current motion parameters into a preset motion equation, and a motion trail is determined.
As a possible implementation manner, the electronic device inputs the current speed, the current position and the current time into a preset motion equation to obtain different positions of the first virtual prop in the three-dimensional space at different moments, obtain a plurality of positions, and obtain a motion trail according to the plurality of positions.
Illustratively, the target limb is a hand and the target action is a hand throwing action. The predetermined equation of motion is shown in equation one below.
Where s is the position of the first virtual prop at time t, a is the acceleration of the first virtual prop (a equals the gravitational acceleration in case of neglecting the air resistance), t is ts after the current time, v 0 is the current speed, and s 0 is the current position.
It should be noted that the preset equation of motion is also different for different target actions. The preset motion equation is obtained according to motion training in a real scene, and can simulate the motion trail of the first virtual prop after the target limb makes the target motion.
S2044, the electronic device displays the motion trail of the first virtual prop.
As one possible implementation, the electronic device displays the first virtual prop at different positions in sequence according to the time sequence.
It can be understood that the electronic device obtains the speed, the position and the time of the target limb in the three-dimensional space, obtains the current speed, the current position and the current time of the first virtual prop leaving the target limb, and obtains the motion trail of the first virtual prop according to the current speed, the current position and the current time and a preset motion equation. Further, the electronic equipment displays the first virtual prop according to the motion trail, so that the motion trail of the first virtual prop can be accurately displayed, the reality of interaction is enhanced, and the interestingness of video content is improved.
In one design, in order to improve the display effect of augmented reality, as shown in fig. 8, the method for displaying virtual props provided by the embodiment of the application further includes S212-S215.
S212, the electronic equipment acquires a current shooting picture.
As one possible implementation, the electronic device obtains a current shot through the camera in response to the user clicking a target button in the target application.
As another possible implementation manner, the electronic device obtains the current shooting picture through the camera under the condition of starting the target special effect function.
S213, the electronic equipment inputs the current shooting picture into a preset enhancement algorithm, and a stereoscopic space corresponding to the shooting picture is generated.
As a possible implementation manner, the electronic device inputs the current shooting picture into a preset enhancement algorithm, and generates a stereoscopic space corresponding to the shooting picture.
Wherein the three-dimensional space comprises a preset plane and/or a preset position. The preset plane may be a ground, a wall surface, a slope or a sky, and the preset position may be a middle point in the three-dimensional space, which is not limited in the embodiment of the present application.
S214, under the condition that the current shooting picture comprises the target limb, the electronic equipment inputs the current shooting picture into a preset limb algorithm and outputs depth parameter information of the target limb.
The depth parameter information comprises plane coordinates of the target limb in the current shooting picture and depth information of the target limb.
As one possible implementation manner, after the electronic device includes the target limb in the current shooting picture, the current shooting picture is input into a preset limb algorithm, and a plurality of depth parameter information of the target limb is output.
It should be noted that the preset limb algorithm is a trained model algorithm and is preset in the electronic device by the operation and maintenance personnel.
S215, the electronic equipment determines the target space coordinates of the target limb based on the depth parameter information and the reference space coordinates corresponding to the three-dimensional space.
As one possible implementation, the electronic device uses the position of the camera as a reference space coordinate in the stereoscopic space. The electronic device determines a plurality of target space coordinates of the target limb according to the plurality of depth parameter information and the reference space coordinates, and determines the position of the target limb in the three-dimensional space based on the plurality of space coordinates. Further, the electronic device determines a photographed picture including the target limb based on the stereoscopic space, and displays the photographed picture.
It can be understood that the electronic device calculates the position of the target limb simulation limb in the three-dimensional space according to different algorithms and displays the position, so that the display effect of augmented reality is improved.
The foregoing description of the solution provided by the embodiments of the present application has been mainly presented in terms of a method. In order to realize the functions, the display device or the electronic device of the virtual prop comprises a hardware structure and/or a software module for executing the functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
According to the method, the display device or the electronic device of the virtual prop can be divided into the functional modules, for example, the display device or the electronic device of the virtual prop can comprise each functional module corresponding to each functional division, and two or more functions can be integrated into one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
For example, the embodiment of the application also provides a display device of the virtual prop.
The embodiment of the application provides a display device 30 of a virtual prop, as shown in fig. 9, the display device 30 comprises a display unit 301, a processing unit 302, a detection unit 303 and an updating unit 304.
A display unit 301 for displaying a photographed screen.
The processing unit 302 is configured to render a first virtual prop in a stereoscopic space corresponding to the photographed picture in response to detecting the target limb in the photographed picture. The first virtual prop follows the target limb.
A detection unit 303 for detecting the motion of the target limb in the photographed picture.
The display unit 301 is further configured to display a motion trajectory of the first virtual prop generated based on the target motion in the stereoscopic space when the motion of the target limb is the target motion.
And the updating unit 304 is configured to update a display effect of the first virtual prop when a movement result of the first virtual prop in the stereoscopic space meets a preset condition.
In a possible implementation, the detection unit 303 is further configured to detect a gesture of the target limb in the photographed image. The display unit is also used for displaying the first virtual prop under the condition that the gesture of the target limb is a preset gesture.
In one possible implementation, the movement result of the first virtual prop in the three-dimensional space meets the preset condition, and the method comprises the step that the first virtual prop collides with the target object in the three-dimensional space. The target object includes a preset plane, a preset position, or a preset object.
In a possible implementation, the updating unit 304 is specifically configured to replace the first virtual prop with the second virtual prop. Or updating the current gesture of the first virtual prop to be the target gesture. Or after updating the current gesture of the first virtual prop to the target gesture for a preset duration, replacing the first virtual prop with the second virtual prop.
In a possible implementation manner, the updating unit 304 is specifically configured to determine, from a first mapping relationship, a gesture corresponding to the target object according to the target object where the first virtual prop collides, where the first mapping relationship includes a plurality of objects and a gesture corresponding to each object, where the plurality of objects include the target object, replace the first virtual prop with the second virtual prop according to the gesture of the target object, and where the gesture of the second virtual prop is the gesture corresponding to the target object.
In a possible implementation manner, the updating unit 304 is specifically configured to determine, from a first mapping relationship, a target pose corresponding to the target object according to the target object impacted by the first virtual prop, where the first mapping relationship includes a plurality of objects and poses corresponding to each object, where the plurality of objects include the target object, and update the current pose to the target pose.
In a possible implementation manner, the display unit 301 is further configured to display, after displaying the second virtual prop, a special effect corresponding to the second virtual prop.
In a possible embodiment, as shown in fig. 9, the display device 30 further comprises a control unit 305. The control unit 305 is configured to control the second virtual track or the first virtual prop to follow the movement of the target limb in response to the movement of the target limb if the movement of the target limb is a preset interaction movement.
In one possible embodiment, the motion trajectory generated by the first virtual prop in the stereoscopic space based on the target motion includes a motion trajectory of the first virtual prop in the stereoscopic space after leaving the target limb in response to the target motion.
In one possible implementation, the target motion is a throwing motion, and the display unit 301 is specifically configured to display, when the motion of the target limb is a throwing motion, a parabolic motion track generated by the first virtual prop based on the throwing motion in the stereoscopic space.
In a possible implementation manner, the detection unit 303 is specifically configured to acquire motion characteristic data of the target limb in the photographed picture, where the motion characteristic data includes a motion speed and a motion gesture. And inputting the motion characteristic data into a preset motion detection neural network to detect the motion of a target limb in a shooting picture.
In a possible implementation, the display unit 301 is specifically configured to obtain a current motion parameter of a target limb in the stereoscopic space, where the current motion parameter includes a current speed, a current position, and a current time. The current motion parameters are input into a preset motion equation, a motion track is determined, and the motion track of the first virtual prop in the three-dimensional space is displayed.
In the case of implementing the functions of the integrated modules in the form of hardware, the embodiment of the present application provides a possible structural schematic diagram of the electronic device involved in the above embodiment. As shown in fig. 10, the electronic device 40 includes a processor 401, a memory 402, and a bus 403. The processor 401 and the memory 402 may be connected by a bus 403.
The processor 401 is a control center of the communication device, and may be one processor or a collective term of a plurality of processing elements. For example, the processor 401 may be a general-purpose central processing unit (central processing unit, CPU), or may be other general-purpose processors. Wherein the general purpose processor may be a microprocessor or any conventional processor or the like.
As one example, processor 401 may include one or more CPUs, such as CPU 0 and CPU 1 shown in fig. 10.
Memory 402 may be, but is not limited to, read-only memory (ROM) or other type of static storage device that can store static information and instructions, random access memory (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, or electrically erasable programmable read-only memory (EEPROM), magnetic disk storage or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
As a possible implementation, the memory 402 may exist separately from the processor 401, and the memory 402 may be connected to the processor 401 through the bus 403, for storing instructions or program codes. The processor 401, when calling and executing instructions or program code stored in the memory 402, can implement the sensor determining method provided by the embodiment of the present application.
In another possible implementation, the memory 402 may also be integrated with the processor 401.
Bus 403 may be an industry standard architecture (Industry Standard Architecture, ISA) bus, a peripheral component interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 10, but not only one bus or one type of bus.
It should be noted that the structure shown in fig. 10 does not constitute a limitation of the electronic device 40. The electronic device 40 may include more or less components than those shown in fig. 10, or may combine certain components, or may have a different arrangement of components.
Optionally, the electronic device 40 provided by the embodiment of the present application may further include a communication interface 404.
A communication interface 404 for connecting with other devices via a communication network. The communication network may be an ethernet, a radio access network, a wireless local area network (wireless local area networks, WLAN), etc. The communication interface 404 may include a receiving unit for receiving data and a transmitting unit for transmitting data.
In one design, the communication interface may also be integrated into the processor in the electronic device 40 provided by embodiments of the present application.
In another hardware structure of the server provided by the embodiment of the present application, the electronic device may include a processor and a communication interface. The processor is coupled to the communication interface.
The function of the processor may be as described above with reference to the processor. The processor also has a memory function, which can be referred to as the memory.
The communication interface is for providing data to the processor. The communication interface may be an internal interface of the communication device or an external interface of the communication device.
It should be noted that the above-described alternative hardware configuration does not constitute a limitation of the server, and the server may include more or less components, or may combine some components, or may be a different arrangement of components, in addition to the above-described alternative hardware components.
In the case of implementing the functions of the integrated modules in the form of hardware, the structural schematic diagrams of the middleware related to the embodiments of the present application may refer to the structural schematic diagrams of the execution machine.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores instructions, and when the computer executes the instructions, the computer executes each step in the flow of the virtual prop display method shown in the embodiment of the method.
The embodiment of the application also provides a computer program product containing instructions, which when run on a computer, cause the computer to execute the method for displaying the virtual prop in the method embodiment.
The computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include an electrical connection having one or more wires, a portable computer diskette, and a hard disk. Random access Memory (Random Access Memory, RAM), read-Only Memory (ROM), erasable programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), registers, hard disk, optical fiber, portable compact disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any other form of computer-readable storage medium suitable for use by a person or persons of skill in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an Application SPECIFIC INTEGRATED Circuit (ASIC). In embodiments of the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
Since the server, the user equipment, the computer readable storage medium, and the computer program product in the embodiments of the present application can be applied to the above-mentioned method, the technical effects that can be obtained by the method can also refer to the above-mentioned method embodiments, and the embodiments of the present application are not described herein again.
The present application is not limited to the above embodiments, and any changes or substitutions within the technical scope of the present application should be covered by the scope of the present application.