Video processing method, device, equipment and medium
By identifying and mapping the position movement trajectory of the control object, generating rendering masks and rendering areas, the limitations of users' interactions within the fixed screen range are solved, and flexible graffiti display of the video target area is achieved, which improves the interactive experience.
Patent Information
- Application Number
- CN202210369833.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-04-08
AI Technical Summary
In the existing video processing technology, users can only perform graffiti interaction within a fixed screen range, and their flexibility and interactivity are weak, and they cannot effectively display the video target area by actions.
By identifying the position movement trajectory of the control object, obtain the display position movement trajectory mapped into the video target area, generate a rendering mask, and determine the rendering area based on the preset sticker base map and rendering mask, and display the sticker content in the rendering area. Realize the graffiti effect display of the action on the target area of the video.
It improves the flexibility and intensity of interaction, enhances the user experience, and the actions are no longer limited to the screen range, achieving flexible operation and rich interaction of the video target area.
Smart Images

Figure CN114742856B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of video processing technology, and in particular to a video processing method, device, equipment and medium. Background Art
[0002] With the rapid development of Internet technology and smart devices, the interaction between users and smart devices is becoming more and more diverse.
[0003] Smart devices can provide users with an interactive way of graffiti stickers to attract users, but currently this method is usually screen graffiti. Users are supported to graffiti on the screen, and then the drawing is displayed on the screen or as a sticker of a certain object. In this way, users can only graffiti in a fixed screen range, which has low flexibility and weak interactivity. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a video processing method, device, equipment and medium.
[0005] The present disclosure provides a video processing method, the method comprising:
[0006] Based on the position movement trajectory of the control object, obtaining the display position movement trajectory mapped into the original video target area;
[0007] Generate a rendering mask according to the display position movement trajectory;
[0008] Determine a rendering area according to the sticker base map pre-set on the target area and the rendering mask;
[0009] The target video is generated by displaying the sticker content in the sticker base map in the rendering area.
[0010] The present disclosure also provides a video processing device, the device comprising:
[0011] A trajectory module, used for obtaining a display position movement trajectory mapped into a target area of an original video based on a position movement trajectory of a control object;
[0012] A mask module, used for generating a rendering mask according to the display position movement trajectory;
[0013] An area module, used for determining a rendering area according to a sticker base map pre-set on the target area and the rendering mask;
[0014] A video module is used to generate a target video by displaying the sticker content in the sticker base map in the rendering area.
[0015] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the video processing method provided by the embodiment of the present disclosure.
[0016] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the video processing method provided by the embodiment of the present disclosure.
[0017] Compared with the prior art, the technical solution provided by the embodiment of the present disclosure has the following advantages: the video processing solution provided by the embodiment of the present disclosure obtains the display position movement trajectory mapped to the target area of the original video based on the position movement trajectory of the control object; generates a rendering mask according to the display position movement trajectory; determines the rendering area according to the sticker base map and the rendering mask pre-set on the target area; and displays the sticker content in the sticker base map in the rendering area to generate the target video. By adopting the above technical solution, by identifying the position movement trajectory of the control object, when the control object is mapped to the target area of the original video, the corresponding display position movement trajectory can be obtained, and the rendering area can be determined based on the rendering mask and the sticker base map generated by the display position movement trajectory, and the target video can be obtained by displaying the sticker base map in the rendering area of the original video, so that when the action of the control object acts on the target area of the video, the area corresponding to the action will realize the display of the graffiti effect, and the action is not limited to the screen range, which improves the flexibility and intensity of the interaction, thereby improving the richness and fun of the interaction, and improving the user's interactive experience effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0019] Figure 1 A schematic diagram of a flow chart of a video processing method provided by an embodiment of the present disclosure;
[0020] Figure 2 A schematic diagram of a target area provided in an embodiment of the present disclosure;
[0021] Figure 3 A flowchart of another video processing method provided by an embodiment of the present disclosure;
[0022] Figure 4 A schematic diagram of a rendering mask provided in an embodiment of the present disclosure;
[0023] Figure 5 A schematic diagram of a sticker base provided in an embodiment of the present disclosure;
[0024] Figure 6 A schematic diagram of a target video provided by an embodiment of the present disclosure;
[0025] Figure 7 A schematic diagram of another target video provided by an embodiment of the present disclosure;
[0026] Figure 8 A schematic diagram of video processing provided by an embodiment of the present disclosure;
[0027] Fig. 9 A schematic diagram of an updated target video provided by an embodiment of the present disclosure;
[0028] Fig.10 A schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure;
[0029] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] Embodiments of the present disclosure will be described in more detail below 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 being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0031] 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.
[0032] The term "including" and its variations used herein are open inclusions, 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"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0033] It should be noted that the concepts such as "first" and "second" mentioned in the present 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.
[0034] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0035] 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.
[0036] Figure 1 The flowchart of a video processing method provided by an embodiment of the present disclosure is shown in FIG. 1 , which can be executed by a video processing device, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method includes:
[0037] Step 101: Based on the position movement trajectory of the control object, obtain the display position movement trajectory mapped into the original video target area.
[0038] The control object may be a pre-set body part of the user, for example, the control object may include the user's fingers, nose, eyes, mouth, etc., which may be determined according to actual conditions. The position movement trajectory may be a movement trajectory obtained by connecting the positions of the above-mentioned control objects at each moment. The original video may be a real-time video including part or all of the user's body parts collected by the current device, and the original video may include the user and background, etc., without limitation.
[0039] In some embodiments, before step 101, the video processing method may further include: setting a target area in the original video, wherein the target area includes: a face area, a neck area, a clothing area, or a hair area. The target area may be an area of interactive focus in the original video or an area for interactive interaction with the user. The target area may be an area of a regular shape, such as a rectangular area. The target area is not limited in the embodiments of the present disclosure. For example, the target area may include but is not limited to a face area, a neck area, a clothing area, a hair area, and a limb area. The target area can be set according to demand, which improves the flexibility of the interactive area, thereby improving the richness and fun of subsequent interactions.
[0040] For example, Figure 2 A schematic diagram of a target area provided in an embodiment of the present disclosure, such as Figure 2 As shown, the figure shows a video frame 200 of an original video, and the video frame 200 includes a target area 201. The target area 201 in the figure refers to the face area, which is only an example.
[0041] The displayed position movement trajectory may be a trajectory of the position movement trajectory of the control object in space mapped onto the display screen. Since the original video is displayed on the display screen, the trajectory may be mapped into the target area of the original video. In the disclosed embodiment, the displayed position movement trajectory may be all positions of the target area, or the displayed position movement trajectory may be part of the target area, without limitation.
[0042] For example, Figure 3 A flowchart of another video processing method provided by an embodiment of the present disclosure is shown in FIG. Figure 3 As shown, in a feasible implementation manner, when the target area is a face area and the controlled object is a target finger, the above step 101 may include the following steps:
[0043] Step 301: Detect the coordinates of the current face area in the original video according to the face recognition algorithm.
[0044] The face recognition algorithm may be any algorithm capable of recognizing a face region in an image, without limitation. In the disclosed embodiment, the face region is taken as an example as a rectangular region including a face, the current face region may be a rectangular region including the current face, and the coordinates of the current face region may include the width, height, and lower left corner coordinates of the current face region relative to the screen.
[0045] Specifically, after capturing the original video, the client may use a face recognition algorithm to perform recognition processing on the real-time images in the original video, and may determine the coordinates of the current face area in each real-time image in the original video.
[0046] Step 302: Detect the current position coordinates of the target finger relative to the current face area according to a preset hand key point recognition algorithm.
[0047] The target finger may be one of the user's multiple fingers, without limitation, for example, the target finger may be the left index finger. The hand key point recognition algorithm may be an algorithm for recognizing preset hand key points based on an image, and the number of hand key points may be set according to actual conditions.
[0048] Specifically, the client uses a hand key point recognition algorithm to identify the real-time image including the target finger in the original video, and can determine the coordinates of the hand key point corresponding to the target finger with the lower left corner of the current face area as the coordinate origin as the current position coordinates of the target finger.
[0049] Step 303: Obtain display position coordinates mapped to the current face area according to the current position coordinates of the target finger and the coordinates of the current face area.
[0050] After determining the current position coordinates of the target finger relative to the current face area and the coordinates of the current face area relative to the screen, the client can map the current position coordinates of the target finger to the screen and determine the display position coordinates of the target finger mapped to the current face area, that is, the display position coordinates of the target finger relative to the screen.
[0051] In some embodiments, based on the current position coordinates of the target finger and the coordinates of the current face area, the display position coordinates mapped to the current face area are obtained, including: determining the coordinate ratio value of the target finger in the current face area based on the current position coordinates of the target finger and the coordinates of the current face area; determining whether the current position coordinates of the target finger are mapped within the current face area based on the coordinate ratio value and a preset mapping relationship; if it is determined that the coordinates are mapped within the current face area, obtaining the display position coordinates mapped to the current face area based on the coordinate ratio value.
[0052] The coordinate ratio of the target finger in the current face area may include the coordinate ratio of the x-axis and the coordinate ratio of the y-axis. The preset mapping relationship may indicate the positive and negative coordinate ratio of the target finger in the current face area. When the coordinate ratio is greater than or equal to zero, it indicates that the target finger is in the current face area; otherwise, it indicates that the target finger is not outside the current face area.
[0053] Since the current position coordinates of the target finger take the lower left corner of the current face area as the coordinate origin, assuming that the lower left corner coordinates of the current face area are (x2, y2), the width is w1, and the height is h1, the lower left corner coordinates are (x2, y2) as the origin, and the current position coordinates of the target finger are (x1, y1). Then, the coordinate ratio of the x-axis in the coordinate ratio of the target finger in the current face area is x1 / w1, and the coordinate ratio of the y-axis is y1 / h1; then the client can determine the positive and negative of the coordinate ratio. When the target finger is not in the current face area, x1 and / or y1 is Negative value, there is a negative value in the coordinate ratio value, and when the target finger is in the current face area, x1 and y1 are both positive values, and the coordinate ratio values are also positive values; when it is determined that the coordinate ratio values are all positive values, it is determined that the current position coordinates of the target finger are mapped in the current face area. At this time, the current position coordinates of the target finger can be proportionally enlarged to the screen according to the coordinate ratio value to obtain the corresponding display position coordinates. Assuming that the width of the screen is w2 and the height is h2, the display position coordinates of the target finger are expressed as (x3, y3), x3=w2*x1 / w1, y3=h2*y1 / h1.
[0054] In the above scheme, when determining the display position coordinates of the target finger mapped to the current face area, the face area can be used as a reduced screen, and the current position coordinates of the target finger relative to the current face area can be proportionally enlarged to the screen to determine the display position coordinates, so as to quickly determine the display position coordinates of the target finger.
[0055] In other embodiments, the client may also directly obtain the display position coordinates of the target finger corresponding to the screen, and determine whether the target finger is in the current face area based on the coordinates of the current face area relative to the screen. If so, subsequent steps may be directly executed.
[0056] Step 304: Generate a display position movement trajectory according to all display position coordinates in the current face area.
[0057] Specifically, after determining all display position coordinates of the target finger in the current face area for the original video, the client can string all the display position coordinates together as a display position movement trajectory.
[0058] Step 102: Generate a rendering mask according to the display position movement trajectory.
[0059] The rendering mask may be understood as a carrier object of the graffiti effect generated according to the action of the user's control object.
[0060] In some embodiments, generating a rendering mask based on the display position movement trajectory may include: calling a preset circular image to draw a plurality of dots at each display position coordinate in the display position movement trajectory; calling a preset rectangular image to fill and draw the gaps between adjacent dots in the plurality of dots, thereby generating a rendering mask.
[0061] Since the original video may include multiple image frames, each image frame corresponds to a display position coordinate, and the display position movement trajectory is composed of the display position coordinates of multiple image frames, when the client generates a rendering mask according to the display position movement trajectory, it can use a preset circular image to draw dots on each display position coordinate one by one, and each time the dots are drawn, the historically drawn dots can be retained, thereby forming multiple continuous dots, and there are gaps between adjacent dots; then the client can calculate the gap distance for the gaps between adjacent dots in the multiple dots, and use a preset rectangular image to fill and draw each gap with a constant width and a length scaled to the gap distance to form a path, and finally render the drawn dots and the rectangular filling path between adjacent dots in a transparent canvas to obtain a rendering mask.
[0062] For example, Figure 4 A schematic diagram of a rendering mask provided by an embodiment of the present disclosure, such as Figure 4As shown, a rendering mask 400 is shown in the figure. The rendering mask 400 may include a plurality of dots corresponding to the display position movement trajectory and a rectangular filling path between adjacent dots. The figure is only an example and not a limitation.
[0063] Step 103: Determine the rendering area according to the sticker base map and rendering mask pre-set on the target area.
[0064] Among them, the sticker base image can be an image with a preset material, preset color and / or preset texture that is pre-set for the target area. The size of the sticker base image can be the same as the target area. The material or color of the sticker base image can be set according to actual needs. The embodiment of the present disclosure does not limit this. For example, when the target area is the human face area, the sticker base image can be an image with a mask material and a pink color.
[0065] In some embodiments, when the target area is a face area, determining the rendering area based on a sticker base map and a rendering mask pre-set on the target area can include: determining a face grid corresponding to the face area based on a face key point algorithm, and setting the sticker base map above the face grid; calculating the corresponding positions of the sticker base map and the rendering mask, filtering out the positions where the sticker base map overlaps with the rendering mask based on the calculation results, and using the overlapping positions as the rendering area.
[0066] Specifically, taking the target area as the face area as an example, the client can use the face key point recognition algorithm to identify and perform three-dimensional reconstruction on the real-time image in the original video, obtain the face mesh corresponding to the face area, and set the pre-set sticker base map on the face mesh. The size of the sticker base map is the same as the face grid, but the sticker base map is not displayed; then the rendering mask determined in the above steps can be added to the sticker base map, and the overlapping position is determined according to the coordinates of the sticker base map and the coordinates of the moving trajectory of the display position in the rendering mask, and the overlapping position is used as the rendering area.
[0067] For example, Figure 5 A schematic diagram of a sticker base provided in an embodiment of the present disclosure, such as Figure 5 As shown in the figure, when the target area is a face area, the sticker base is similar to a mask and the color is set to black. This is just an example.
[0068] Step 104: Display the sticker content in the sticker base image in the rendering area to generate a target video.
[0069] The rendering area may be understood as an area where graffiti effects are displayed.
[0070] In the disclosed embodiment, after determining the rendering area, in each real-time image of the original video, the part of the rendering area can be displayed with the sticker content of the sticker base map, while the part of the non-rendering area remains in its original state to obtain the target video.
[0071] Since the rendering area displays the sticker content corresponding to the moving trajectory of the display position of the above-mentioned control object, when the action of the control object acts on the target area in the space, the preset sticker content can be displayed following the action trajectory of the control object, that is, the graffiti effect can be displayed in the space, which improves the flexibility and intensity of interaction.
[0072] For example, Figure 6 A schematic diagram of a target video provided by an embodiment of the present disclosure, such as Figure 6 As shown, the figure shows an image frame 600 of a target video, in which the image frame 600 can show the face area Figure 4 The sticker content corresponding to the display position movement track shown in the figure is a partial position of the face area, and the sticker content at this time is filled with black. Figure 7 A schematic diagram of another target video provided by an embodiment of the present disclosure, such as Figure 7 As shown, the figure shows an image frame 700 of a target video, and the position movement trajectory displayed in the image frame 700 is the entire position of the face area, so the entire area of the face area is the rendering area, and the black-filled sticker base map is fully displayed. Figure 6 and Figure 7 This is for illustration only and is not intended to be limiting.
[0073] For example, Figure 8 A schematic diagram of video processing provided by an embodiment of the present disclosure is shown in FIG. Figure 8As shown in the figure, a complete process of video processing is shown. Taking the target area as the face area and the control object as the index finger as an example, the specific process may include: the client may collect the original video, which includes multiple image frames, and the captured image in the figure may be an image frame; for each image frame, a face recognition algorithm is used to obtain the coordinate face of the current face area, which may include the width, height and lower left corner coordinates, and a hand key point recognition algorithm is used to obtain the current position coordinate hand of the index finger relative to the position of the current face area; when the hand is in the current face area, the coordinate ratio of the hand in the current face area and the screen coordinate screenrect can be used to map to a display position coordinate screen. The current face area can be regarded as a reduced screen. By enlarging the hand proportionally to screenrect as screen, the screen coordinates may include the width and height of the screen; a display position movement trajectory is generated according to the display position coordinates, and then a rendering mask (render) is obtained by drawing with a preset circular image and a rectangular image. texture); using the face recognition algorithm and the face key point algorithm at the same time, the face grid can be determined, and the sticker base map of the preset face area can be added to the face grid; the rendering mask is assigned to the sticker base map as a mask, and the overlapping area of the rendering mask and the sticker base map is determined as the rendering area, and the sticker content of the sticker base map in the rendering area is displayed. The rendering area is the part graffitied by the index finger. The final effect is that when the user's index finger acts on the face, the face area where the index finger acts will be graffitied as the preset sticker content.
[0074] The video processing scheme provided by the disclosed embodiment obtains the display position movement trajectory mapped to the target area of the original video based on the position movement trajectory of the control object; generates a rendering mask according to the display position movement trajectory; determines the rendering area according to the sticker base map and the rendering mask pre-set on the target area; and generates the target video by displaying the sticker content in the sticker base map in the rendering area. By adopting the above technical scheme, by identifying the position movement trajectory of the control object, when the control object is mapped to the target area of the original video, the corresponding display position movement trajectory can be obtained, and the rendering area can be determined based on the rendering mask and the sticker base map generated by the display position movement trajectory. The target video can be obtained by displaying the sticker base map in the rendering area of the original video, which realizes that when the action of the control object acts on the target area of the video, the area corresponding to the action will realize the display of graffiti effect, and the action is not limited to the screen range, which improves the flexibility and intensity of the interaction, thereby improving the richness and fun of the interaction, and improving the user's interactive experience effect.
[0075] In some embodiments, after the sticker content in the sticker base image is displayed in the rendering area to generate the target video, the video processing method may also include: in response to the first scene feature satisfying a preset sticker display end condition, displaying the original video content in the rendering area.
[0076] The first scene feature may be scene information of the current preset type, such as display duration, current location, etc. The sticker display end condition may be an end condition set based on the first scene feature, which may be set according to actual conditions. For example, the sticker display end condition may be that the display duration reaches a preset time, the current location is a preset location, etc.
[0077] Specifically, the client can obtain the current first scene feature and determine whether the first scene feature meets the sticker display end condition. If so, the sticker content displayed in the rendering area can be closed and the original video content can be displayed in the rendering area.
[0078] In the above solution, under certain scenario conditions, the display of graffiti effects can be turned off, which is more in line with the user's actual application scenario and further improves the flexibility of special effect display.
[0079] In some embodiments, after the sticker content in the sticker base map is displayed in the rendering area to generate a target video, the video processing method may also include: in response to the second scene feature satisfying a preset sticker movement condition, displaying the original video content in the rendering area; and determining an updated rendering area after the movement on the original video according to the second scene feature, and displaying the sticker content in the sticker base map in the updated rendering area to generate an updated target video.
[0080] Among them, the second scene feature may be a scene information different from the above-mentioned first scene feature, for example, it may include the user's current trigger operation. The sticker movement condition may be a condition set based on the second scene feature that requires the sticker content display position to be moved, and it may be set specifically according to actual conditions. For example, the sticker movement condition may be that the current trigger operation is a preset trigger operation, etc. The preset trigger operation may include a gesture control operation, a voice control operation, or an expression control operation, etc., which are not limited to specific ones. For example, the preset trigger operation may be the above-mentioned control object movement or a blowing operation on the mouth area. The updated rendering area may be the area where the sticker content is about to be displayed, determined based on the second scene feature.
[0081] Specifically, the client can obtain the current second scene feature and determine whether the second scene feature meets the sticker movement condition. If so, the sticker content displayed in the rendering area can be closed, and the content of the original video can be displayed in the rendering area; and based on the second scene feature, an updated rendering area on the original video is determined, and the sticker content in the sticker base map is displayed in the updated rendering area to obtain a target video in which the sticker content display position has changed.
[0082] Exemplarily, when the second scene feature is the movement of a controlled object, determining the updated rendering area on the original video based on the second scene feature may include: determining the moving distance and moving direction of the controlled object, and determining the area after the rendering area moves the moving distance along the moving direction as the updated rendering area.
[0083] For example, Fig. 9 A schematic diagram of an updated target video provided by an embodiment of the present disclosure, such as Fig. 9 As shown, the figure shows an image frame 900 of an updated target video, compared to Figure 7 , the rendering area in the image frame 900 is updated relative to Figure 7 The rendering area in the figure moves to the right and is not in the face area. The black-filled sticker content is displayed in the updated rendering area.
[0084] In the above solution, in a specific scenario, the rendering area can be moved according to user needs, providing more interaction methods and further improving the interaction flexibility.
[0085] Fig.10 FIG. 1 is a schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device. Fig.10 As shown, the device comprises:
[0086] The trajectory module 1001 is used to obtain the display position movement trajectory mapped into the original video target area based on the position movement trajectory of the control object;
[0087] A mask module 1002, used for generating a rendering mask according to the display position movement trajectory;
[0088] The area module 1003 is used to determine the rendering area according to the sticker base map pre-set on the target area and the rendering mask;
[0089] The video module 1004 is used to display the sticker content in the sticker base map in the rendering area to generate a target video.
[0090] Optionally, the device further includes a region setting module, configured to:
[0091] The target area is set in the original video, wherein the target area includes: a face area, a neck area, a clothing area, or a hair area.
[0092] Optionally, the displayed position movement trajectory is all positions of the target area, or the displayed position movement trajectory is part of the position of the target area.
[0093] Optionally, when the target area is a face area and the controlled object is a target finger, the trajectory module 1001 includes:
[0094] A face unit, used to detect the coordinates of the current face area in the original video according to a face recognition algorithm;
[0095] A finger unit, used for detecting the current position coordinates of the target finger relative to the current face area according to a preset hand key point recognition algorithm;
[0096] A coordinate unit, used to obtain display position coordinates mapped into the current face area according to the current position coordinates of the target finger and the coordinates of the current face area;
[0097] A determination unit is used to generate the display position movement trajectory according to all display position coordinates in the current face area.
[0098] Optionally, the coordinate unit is used for:
[0099] Determine a coordinate ratio of the target finger in the current face area according to the current position coordinates of the target finger and the coordinates of the current face area;
[0100] Determining whether the current position coordinates of the target finger are mapped within the current face area according to the coordinate ratio value and a preset mapping relationship;
[0101] If it is determined that the mapping is within the current face area, the display position coordinates mapped within the current face area are obtained according to the coordinate ratio value.
[0102] Optionally, the mask module 1002 is used to:
[0103] At each display position coordinate in the display position movement track, calling a preset circular picture to draw a plurality of dots;
[0104] A preset rectangular image is called to fill and draw the gaps between adjacent dots in the plurality of dots, thereby generating the rendering mask.
[0105] Optionally, when the target area is a face area, the area module 1003 is used to:
[0106] Determine a face grid corresponding to the face area according to a face key point algorithm, and set the sticker base map on the face grid;
[0107] The corresponding positions of the sticker base image and the rendering mask are calculated, and the positions where the sticker base image and the rendering mask overlap are screened out according to the calculation results, and the overlapping positions are used as the rendering area.
[0108] Optionally, the device further comprises an ending module, which is used to: after the rendering area displays the sticker content in the sticker base map to generate a target video,
[0109] In response to the first scene feature satisfying a preset sticker display end condition, the original video content is displayed in the rendering area.
[0110] Optionally, the device further comprises a moving module, which is used to: after the sticker content in the sticker base map is displayed in the rendering area to generate a target video,
[0111] In response to the second scene feature satisfying a preset sticker movement condition, displaying the original video content in the rendering area; and
[0112] An updated rendering area after the move on the original video is determined according to the second scene feature, and the sticker content in the sticker base map is displayed in the updated rendering area to generate an updated target video.
[0113] The video processing device provided in the embodiments of the present disclosure can execute the video processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0114] The embodiments of the present disclosure further provide a computer program product, including a computer program / instruction, which implements the video processing method provided by any embodiment of the present disclosure when executed by a processor.
[0115] Fig.11 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Fig.11 , which shows a schematic diagram of the structure of an electronic device 1100 suitable for implementing the embodiment of the present disclosure. The electronic device 1100 in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0116] like Fig.11 As shown, the electronic device 1100 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage device 1108 to a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the electronic device 1100 are also stored. The processing device 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0117] Typically, the following devices may be connected to the I / O interface 1105: an input device 1106 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1108 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1109. The communication device 1109 may allow the electronic device 1100 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.11 The electronic device 1100 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0118] 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 contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1109, or installed from a storage device 1108, or installed from a ROM 1102. When the computer program is executed by the processing device 1101, the above-mentioned functions defined in the video processing method of the embodiment of the present disclosure are executed.
[0119] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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 containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit 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 of the above.
[0120] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may 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.
[0121] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0122] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains the display position movement trajectory mapped to the original video target area based on the position movement trajectory of the controlled object; generates a rendering mask according to the display position movement trajectory; determines the rendering area according to the sticker base map pre-set on the target area and the rendering mask; and displays the sticker content in the sticker base map in the rendering area to generate the target video.
[0123] 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 separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving 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).
[0124] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart 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.
[0125] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0126] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, 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 chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0127] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may 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 may 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.
[0128] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. 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 a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0129] 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 are 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.
[0130] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A video processing method, characterized in that: include: Based on the position movement trajectory of the control object, obtaining the display position movement trajectory mapped to the target area of the original video; wherein the original video includes the control object; Generate a rendering mask according to the display position movement trajectory; Determine a rendering area according to the sticker base map pre-set on the target area and the rendering mask; The target video is generated by displaying the sticker content in the sticker base map in the rendering area; wherein the sticker content is the sticker content corresponding to the moving trajectory of the display position.
2. The method according to claim 1, characterized in that Also includes: The target area is set in the original video, wherein the target area includes: a face area, a neck area, a clothing area, or a hair area.
3. The method according to claim 1, characterized in that: The display position movement trajectory includes all positions of the target area, or the display position movement trajectory includes part of the positions of the target area.
4. The method according to claim 1, characterized in that: When the target area is a human face area and the controlled object is a target finger, The step of obtaining the display position movement trajectory mapped to the original video target area based on the position movement trajectory of the control object includes: Detecting the coordinates of the current face area in the original video according to a face recognition algorithm; Detecting the current position coordinates of the target finger relative to the current face area according to a preset hand key point recognition algorithm; According to the current position coordinates of the target finger and the coordinates of the current face area, acquiring the display position coordinates mapped into the current face area; The display position movement trajectory is generated according to all display position coordinates in the current face area.
5. The method according to claim 4, characterized in that The acquiring, according to the current position coordinates of the target finger and the coordinates of the current face area, the display position coordinates mapped into the current face area comprises: Determine a coordinate ratio of the target finger in the current face area according to the current position coordinates of the target finger and the coordinates of the current face area; Determining whether the current position coordinates of the target finger are mapped within the current face area according to the coordinate ratio value and a preset mapping relationship; If it is determined that the mapping is within the current face area, the display position coordinates mapped within the current face area are obtained according to the coordinate ratio value.
6. The method according to claim 1, characterized in that The step of generating a rendering mask according to the display position movement trajectory includes: At each display position coordinate in the display position movement track, calling a preset circular picture to draw a plurality of dots; A preset rectangular image is called to fill and draw the gaps between adjacent dots in the plurality of dots, thereby generating the rendering mask.
7. The method according to claim 1, characterized in that In the case where the target area is a face area, determining the rendering area according to the sticker base map pre-set on the target area and the rendering mask includes: Determine a face grid corresponding to the face area according to a face key point algorithm, and set the sticker base map on the face grid; The corresponding positions of the sticker base image and the rendering mask are calculated, and the positions where the sticker base image and the rendering mask overlap are screened out according to the calculation results, and the overlapping positions are used as the rendering area.
8. The method according to any one of claims 1 to 7, characterized in that: After the rendering area displays the sticker content in the sticker base map to generate the target video, the method further includes: In response to the first scene feature satisfying a preset sticker display end condition, the original video content is displayed in the rendering area.
9. The method according to any one of claims 1 to 7, characterized in that: After the rendering area displays the sticker content in the sticker base map to generate the target video, the method further includes: In response to the second scene feature satisfying a preset sticker movement condition, displaying the original video content in the rendering area; and An updated rendering area after the move on the original video is determined according to the second scene feature, and the sticker content in the sticker base map is displayed in the updated rendering area to generate an updated target video.
10. A video processing device, characterized in that: include: A trajectory module, used for acquiring a display position movement trajectory mapped to a target area of an original video based on a position movement trajectory of a control object; wherein the original video includes the control object; A mask module, used for generating a rendering mask according to the display position movement trajectory; An area module, used for determining a rendering area according to a sticker base map pre-set on the target area and the rendering mask; A video module is used to generate a target video by displaying the sticker content in the sticker base map in the rendering area; wherein the sticker content is the sticker content corresponding to the moving trajectory of the display position.
11. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the video processing method described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the video processing method described in any one of claims 1 to 9.
