Video processing method and apparatus, and electronic device
Through the video processing method, the video frame image is obtained and the display position of the target object is determined, which solves the problem of high cost of shooting videos in the prior art, and realizes the effect of using mirrors without auxiliary equipment, reducing the cost and difficulty.
Patent Information
- Application Number
- PCT/CN2024/109000
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-31
- Filing Date
- 2024-07-31
- Publication Date
- 2025-02-06
AI Technical Summary
In the prior art, the cost of using a mirror to shoot video is high, mainly because the auxiliary shooting equipment is needed, and these equipment is not easy to carry and has a high cost.
Through a video processing method, the video frame image is obtained, the display position of the target object is determined, and the video frame is edited and processed according to the position to generate a video with the mirror effect, avoiding dependence on auxiliary shooting equipment.
It realizes videos that can obtain mirror-moving effects without auxiliary shooting equipment, reducing the difficulty and cost of obtaining mirror-moving videos.
Smart Images

Figure CN2024109000_06022025_PF_FP_ABST
Abstract
Description
Video processing method, device and electronic equipment
[0001] This application claims priority to the Chinese invention patent application entitled “Video processing method, device and electronic device” and application number 2023109527531, filed on July 31, 2023. The entire contents of that application are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present disclosure relate to the field of video processing technology, and more particularly to a video processing method, device, and electronic device. Background Art
[0003] Moving lens shooting can be a shooting method that moves the shooting lens so that the shooting object in the video is located at a fixed position on the screen. For example, by moving the lens, the shooting object can be always located at the center of the screen.
[0004] Currently, electronic devices can implement pan-and-tilt shooting using auxiliary shooting devices. For example, the auxiliary shooting device can be a smart selfie stick. After the user determines the subject in the video, if the subject moves, the electronic device can also control the smart selfie stick to move, so that the subject's position on the electronic device screen remains unchanged. However, this method requires the use of auxiliary shooting devices, which are not easy to carry and are relatively expensive, resulting in higher costs for pan-and-tilt shooting.
[0005] Summary of the Invention
[0006] In a first aspect, the present disclosure provides a video processing method, which includes: obtaining a first video frame image in a first video; determining a target object in the first video frame image; editing the video frame in the first video according to the display position of the target object in the first video frame image to obtain a second video; wherein the display position of the target object in the video frame image of the second video is the same as the display position of the target object in the first video frame image.
[0007] In a second aspect, the present disclosure provides a video processing device, which includes an acquisition module, a determination module and a processing module, wherein: the acquisition module is used to acquire a first video frame image in a first video; the determination module is used to determine a target object in the first video frame image; the processing module is used to edit the video frames in the first video according to the display position of the target object in the first video frame image to obtain a second video; wherein the display position of the target object in the video frame image of the second video is the same as the display position of the target object in the first video frame image.
[0008] In a third aspect, an embodiment of the present disclosure provides an electronic device comprising: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method as described in the first aspect and various possible aspects of the first aspect.
[0009] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the video processing method as described in the first aspect and various possible aspects of the first aspect are implemented.
[0010] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video processing method as described in the first aspect and various possible aspects of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0012] FIG1 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;
[0013] FIG2 is a flow chart of a video processing method provided by an embodiment of the present disclosure;
[0014] FIG3 is a schematic diagram of a process for determining a selection box according to an embodiment of the present disclosure;
[0015] FIG4 is a schematic diagram of a process for determining a target object according to an embodiment of the present disclosure;
[0016] FIG5 is a schematic diagram of determining a target subject provided by an embodiment of the present disclosure;
[0017] FIG6 is a schematic diagram of adding a key frame according to an embodiment of the present disclosure;
[0018] FIG7 is a schematic diagram of a method for determining a third video frame image provided by an embodiment of the present disclosure;
[0019] FIG8 is a schematic diagram of a target subject provided by an embodiment of the present disclosure;
[0020] FIG9 is a schematic diagram of a forward frame backtracking method provided by an embodiment of the present disclosure;
[0021] FIG10 is a schematic diagram of a video processing method according to an embodiment of the present disclosure;
[0022] FIG11 is a schematic structural diagram of a video processing device provided by an embodiment of the present disclosure;
[0023] FIG12 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] The present disclosure provides a video processing method, device and electronic device for solving the technical problem of high cost of shooting videos with camera movement in the prior art.
[0025] The present disclosure provides a video processing method, device and electronic device. The electronic device can obtain a first video frame image in a first video and determine a target object in the first video frame image. The electronic device can edit and process the video frame in the first video according to the display position of the target object in the first video frame image to obtain a second video. The display position of the target object in the video frame image of the second video is the same as the display position of the target object in the first video frame image. According to the above method, since the electronic device can process the video frame in the first video according to the video post-processing method, a second video with a camera movement effect is obtained. Therefore, the user does not need much camera movement experience to obtain a video with a camera movement effect, which reduces the difficulty of obtaining a camera movement video. In addition, in the process of obtaining the camera movement video, there is no need to install equipment to assist in shooting the camera movement video, thereby reducing the cost of obtaining the camera movement video.
[0026] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0027] To facilitate understanding, the concepts involved in the embodiments of the present disclosure are explained below.
[0028] Electronic device: is a device with wireless transceiver function. The electronic device can be deployed on land, including indoors or outdoors, handheld, wearable or vehicle-mounted; it can also be deployed on the water surface (such as ships, etc.). The electronic device can be a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, an on-board electronic device, a wireless terminal in self-driving, a wireless electronic device in remote medical care, a wireless electronic device in a smart grid, a wireless electronic device in transportation safety, a wireless electronic device in a smart city, a wireless electronic device in a smart home, a wearable electronic device, etc. The electronic device involved in the embodiments of the present disclosure can also be called a terminal, user equipment (UE), an access electronic device, a vehicle-mounted terminal, an industrial control terminal, a UE unit, a UE station, a mobile station, a mobile station, a remote station, a remote electronic device, a mobile device, a UE electronic device, a wireless communication device, a UE agent or a UE device, etc. Electronic devices may also be stationary or mobile.
[0029] In related art, electronic devices can achieve pan-and-tilt shooting using auxiliary shooting devices. For example, the electronic device is mounted on a smart selfie stick and connected to the stick. The electronic device can control the movement of the stick. After the electronic device determines the subject, if the subject moves to the left, the electronic device controls the stick to rotate to the left; if the subject moves to the right, the electronic device controls the stick to rotate to the right. In this way, when playing pan-and-tilt videos, the subject's position on the electronic device's screen remains unchanged. However, this pan-and-tilt shooting requires the use of auxiliary shooting devices. Auxiliary shooting devices are difficult to carry and relatively expensive, which in turn leads to higher costs for pan-and-tilt shooting videos.
[0030] To address the problems in the related art, embodiments of the present disclosure provide a video processing method. An electronic device can capture a first video frame image from a first video and determine a target object in the first video frame image. Based on the display position of the target object in the first video frame image, the electronic device can crop and reposition a second video frame image from the first video to obtain a third video frame image from the second video, such that the display position of the target object in the third video frame image is the same as the display position of the target object in the first video frame image. A second video is then obtained based on the first video frame image and multiple third video frames. In this way, since the display position of the target object in the video frames of the second video is the same as the display position of the target object in the first video frame image, the electronic device can obtain a second video with a camera movement effect through video post-processing. This means that users can obtain a video with a camera movement effect without extensive camera movement experience, reducing the difficulty of obtaining a camera movement video. Furthermore, the process of obtaining the camera movement video does not require the installation of auxiliary equipment for capturing the camera movement video, thereby reducing the cost of obtaining the camera movement video.
[0031] The application scenario of the embodiment of the present disclosure is described below with reference to FIG1 .
[0032] FIG1 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure. Please refer to FIG1 , which includes: an electronic device. The electronic device can play a video. The video includes a user, and the target object can be the user's face. The electronic device can crop and move the video frame image of the second frame and the video frame image of the third frame in the video according to the display position of the user's face in the video frame image of the first frame, so that the relative position of the user's face in the video remains unchanged. In this way, when the electronic device obtains a video shot without camera movement, a video with a camera movement effect can be obtained by post-processing the video. A video with a camera movement effect can be obtained without installing an auxiliary shooting device, thereby reducing the cost of obtaining a video shot with camera movement.
[0033] It should be noted that FIG1 is only an illustrative illustration of the application scenario of the embodiment of the present disclosure, and does not limit the application scenario of the embodiment of the present disclosure.
[0034] The following detailed description of the technical solution of the present disclosure and how the technical solution of the present disclosure solves the above-mentioned technical problems is provided with specific embodiments. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present disclosure will be described below in conjunction with the accompanying drawings.
[0035] FIG2 is a flow chart of a video processing method provided by an embodiment of the present disclosure. Referring to FIG2 , the method may include:
[0036] S201: Acquire a first video frame image in a first video.
[0037] The execution subject of the embodiment of the present disclosure may be an electronic device, or a video processing device provided in the electronic device. The video processing device may be implemented by software, or by a combination of software and hardware, which is not limited in the embodiment of the present disclosure.
[0038] Optionally, the first video may be a video captured by the electronic device. For example, the electronic device may capture a video in real time to obtain the first video. Optionally, the first video may be a video pre-stored by the electronic device. For example, the electronic device may pre-store video A and video B. If the electronic device edits video A, the electronic device determines video A as the first video. If the electronic device edits video B, the electronic device determines video B as the first video.
[0039] Optionally, it should be noted that the first video may be a video obtained based on a camera-movement shooting method, or the first video may be a video obtained based on a non-camera-movement shooting method, and the embodiments of the present disclosure do not limit this.
[0040] Optionally, the first video frame image may be an image frame in the first video. For example, the first video frame image may be a video frame image of any frame in the first video, or the first image may be a video frame image of the current frame of the first video, which is not limited in the present embodiment.
[0041] Optionally, the electronic device may determine the first video frame image based on a user operation. For example, if the user touches the first video frame image in the first video, the electronic device may determine the first video frame image as the first video frame image. If the user touches the 10th video frame image in the first video, the electronic device may determine the 10th video frame image as the first video frame image.
[0042] It should be noted that the electronic device may also obtain the first video frame image in the first video based on any feasible implementation method, and the embodiment of the present disclosure is not limited to this.
[0043] S202: Determine a target object in the first video frame image.
[0044] The target object may be an object whose display position is to be fixed. For example, if the electronic device fixes the display position of a face in the first video frame, the electronic device may determine that the target object is the face in the first video frame. If the electronic device fixes the display position of the left hand in the first video frame, the electronic device may determine that the target object is the left hand in the first video frame. If the electronic device fixes the display position of the right leg in the first video frame, the electronic device may determine that the target object is the right leg in the first video frame.
[0045] The electronic device can determine the target object in the first video frame image according to the following feasible implementation method: detecting objects to be selected in the first video frame image and determining the position of each object to be selected in the first video frame image. Based on the position of each object to be selected in the first video frame image, a selection box corresponding to each object to be selected is generated in the first video frame image. In response to a touch operation on the selection box, the object to be selected corresponding to the selection box is determined as the target object.
[0046] Optionally, the electronic device detecting the objects to be selected in the first video frame image may specifically include: acquiring at least one subject to be selected in the first video frame image; responding to a touch operation on the at least one subject to be selected; determining a target subject in the at least one subject to be selected, and determining an object included in the target subject as the object to be selected.
[0047] The subject to be selected may be a user included in the first video frame image. For example, if the first video frame image includes user A and user B, the first video frame image may include two subjects to be selected. One subject to be selected is user A, and the other subject to be selected is user B. Optionally, the subject to be selected may include at least one object to be selected. For example, the subject to be selected may be a user, and the objects to be selected included in the subject to be selected may be the user's face, the user's body parts, etc., although this is not limited in the present embodiment.
[0048] Optionally, the target subject may be a candidate subject touched by the user. For example, the first video frame may include candidate subject A and candidate subject B. If the user touches candidate subject A, the electronic device may determine that the target subject is candidate subject A. If the user touches candidate subject B, the electronic device may determine that the target subject is candidate subject B.
[0049] Optionally, the electronic device can detect the objects included in the target subject and determine the objects included in the target subject as objects to be selected. For example, the electronic device can obtain the position of the target subject in the first video frame image and determine the objects to be selected included in the target subject through a face detection algorithm and a limb detection algorithm. For example, the electronic device can input the position of the target subject in the first video frame image and the first video frame image into the Bach algorithm. If the Bach algorithm can extract facial key points and limb key points in the first video frame image, the electronic device can determine that the objects to be selected include a face and a limb.
[0050] Optionally, when the electronic device determines the candidate objects in the first video frame, it can obtain the position of each candidate object in the first video frame. For example, if the electronic device extracts facial key points and limb key points in the first video frame based on the Bach algorithm, the electronic device can obtain the coordinates of the facial key points and limb key points in the first video frame based on the Bach algorithm. Furthermore, the position of the face and limb in the first video frame can be obtained.
[0051] It should be noted that in the embodiment of the present disclosure, the electronic device can identify 106 key points in the face through the face detection algorithm. After the electronic device detects a larger number of key points (such as 70 key points, 80 key points, etc., which are not limited in the embodiment of the present disclosure), it can determine the position of the face in the first video frame image. The electronic device can identify 18 key points in the limbs through the limb detection algorithm. For limb recognition, each key point corresponds to a limb (such as key point 1 corresponds to the left hand, key point 2 corresponds to the right hand, etc., which are not limited in the embodiment of the present disclosure). The electronic device can determine the position of each limb in the first video frame image based on the identified limb key points.
[0052] Optionally, the electronic device may generate a selection box corresponding to each object to be selected in the first video frame image based on the position of each object to be selected in the first video frame image. For example, after the electronic device determines the position of each object to be selected in the first video frame image, it may generate a selection box corresponding to each object to be selected based on the position. The image within the selection box range may include the object to be selected. The size of the selection box can be set arbitrarily, and the shape of the selection box can be circular or square, etc., which is not limited in the embodiments of the present disclosure.
[0053] The process of determining the selection box is described below with reference to FIG3 .
[0054] FIG3 is a schematic diagram of a process for determining a selection box provided by an embodiment of the present disclosure. Referring to FIG3 , an electronic device is included. The electronic device can display a first video frame image. The first video frame image includes a target subject. The electronic device can obtain the position of the target subject in the first video frame image and, based on a face detection algorithm, a limb detection algorithm, and the position of the target subject in the first video frame image, determine that the objects to be selected in the target subject are a face, a left hand, a right hand, a left foot, and a right foot.
[0055] Referring to FIG3 , the electronic device can determine the positions of a person's face, left hand, right hand, left foot, and right foot in a first video frame. Based on the positions of the person's face, left hand, right hand, left foot, and right foot in the first video frame, the electronic device can generate a selection box in the first video frame that includes a face image, a selection box that includes a left hand image, a selection box that includes a right hand image, a selection box that includes a left foot image, and a selection box that includes a right foot image.
[0056] Optionally, in response to a touch operation on a selection box, the selected object corresponding to the selection box is determined as the target object. For example, if the target subject in the first video frame image may include selection box 1 and selection box 2, if the user clicks selection box 1, the electronic device may determine the selected object included in selection box 1 as the target object. If the user clicks selection box 2, the electronic device may determine the selected object included in selection box 2 as the target object.
[0057] The process of determining the target object is described below with reference to FIG. 4 .
[0058] FIG4 is a schematic diagram of a process for determining a target object provided by an embodiment of the present disclosure. Referring to FIG4 , it includes: an electronic device. The electronic device can display a first video frame image. The objects to be selected included in the first video frame image can be the user's face, left hand, right hand, left foot, and right foot. The first video frame image also includes a selection box corresponding to the face, a selection box corresponding to the left hand, a selection box corresponding to the right hand, a selection box corresponding to the left foot, and a selection box corresponding to the right foot. If the user clicks the selection box corresponding to the face, the electronic device determines that the target object can be the face in the first video frame image.
[0059] It should be noted that if the area of the selection box is smaller than a preset threshold, the electronic device may delete the selection box and cancel the display of the selection box in the first video frame image, thereby improving the display effect of the selection box.
[0060] Optionally, if the first video frame image includes multiple subjects to be selected, the electronic device can determine the target subject based on the target object selected by the user. For example, in actual application, the first video frame image of the first video may include multiple subjects to be selected. The target subject may be the subject to be selected where the target object selected by the user is located. For example, the first video frame image may include subject A to be selected, subject B to be selected, and subject C to be selected, where subject A is on the left side of the first video frame image, subject B to be selected is in the middle of the first video frame image, and subject C to be selected is on the right side of the first video frame image. If the target object selected by the electronic device is the face of subject B to be selected, the electronic device can determine subject B to be selected as the target subject.
[0061] The following describes a process of determining a target subject based on a target object selected by a user when the first video frame image includes multiple subjects to be selected, with reference to FIG. 5 .
[0062] FIG5 is a schematic diagram of a method for determining a target subject provided by an embodiment of the present disclosure. Please refer to FIG5 , which includes: an electronic device. The electronic device can display a first video frame image. The first video frame image may include a subject to be selected 1 and a subject to be selected 2. The objects to be selected for each subject to be selected may include a face, a left hand, a right hand, a left foot, and a right foot, and the first video frame image may include a selection box corresponding to each subject to be selected. If the user clicks on the selection box corresponding to the face of the subject to be selected 2, the electronic device can determine that the target object in the first video frame image is a face, and further determine the subject to be selected 2 where the face is located as the target subject in the first video frame image.
[0063] It should be noted that in the embodiment shown in FIG5 , the first video frame image may include two subjects to be selected. Therefore, the sequence of subjects to be selected in the first video frame image is, from left to right, the first subject to be selected, then the second subject to be selected. When the electronic device determines that subject 2 is the target subject, the target subject is identified as the second subject to be selected.
[0064] S203 : Edit the video frames in the first video according to the display position of the target object in the first video frame image to obtain a second video.
[0065] Optionally, the electronic device may determine the display position of the target object in the first video frame image according to any feasible implementation method (e.g., key point detection, etc.). The display position may be the display position of the center of the target object in the first video frame image, etc. (e.g., the position of the center of the target object in the first video frame image may be the display position, the position of the target object's human eye in the first video frame image may be the display position, etc.), and the embodiments of the present disclosure are not limited to this.
[0066] Optionally, the video frame image of the first video may include a second video frame image. The second video frame image may be a video frame image other than the first video frame image in the first video. For example, the first video may include video frame image 1, video frame image 2, video frame image 3, and video frame image 4. If the electronic device determines that the first video frame image in the first video may be video frame image 3, the electronic device may determine that the second video frame image in the first video is video frame image 1, video frame image 2, and video frame image 4.
[0067] The electronic device can obtain the second video according to the following feasible implementation method: based on the display position of the target object in the first video frame image, the second video frame image is cropped and moved to obtain a third video frame image in the second video. The display position of the target object in the first video frame image is the same as the display position of the target object in the first video frame image. The second video is obtained based on the first video frame image and the plurality of third video frames.
[0068] Optionally, the second video may be a video with a camera movement effect. For example, the second video may be a video with a camera movement effect after the electronic device performs post-processing on the first video. The second video may include multiple third video frame images.
[0069] Optionally, the third video frame image can be a video frame image that is processed by cropping and moving the second video frame image. For example, if the electronic device crops the second video frame in the first video and moves the video frame obtained after the cropping process, the third video frame image is obtained. For example, the display position of the target object in the first video frame image is the center. If the display position of the target object in the second video frame image is on the upper side, the electronic device can crop the lower area of the second video frame image and move the cropped second video frame image downward to obtain the third video frame image. The display position of the target object in the third video frame image is the center of the third video frame image.
[0070] Optionally, the electronic device performs editing processing on the video frames in the first video, further comprising: scaling and / or rotating the second video frame image in the first video. For example, if the display position of the target object in a plurality of consecutive second video frame images is the same as the display position of the target object in the first video frame image (or is similar, that is, the difference between the two display positions is less than a preset threshold), the electronic device can scale and / or rotate the plurality of consecutive second video frame images. This can then result in obtaining a third video frame image in the second video, thereby improving the camera movement display effect of the second video.
[0071] Optionally, the electronic device may perform scaling and / or rotation processing on the second video frame image by inserting key frames. For example, for second video frame image 1, second video frame image 2, and second video frame image 3, the electronic device may insert a scaling key frame between second video frame image 1 and second video frame image 3. Then, when the electronic device plays second video frame image 1, second video frame image 2, and second video frame image 3, a zoomed camera display effect is achieved.
[0072] The process of adding key frames is described below with reference to FIG6 .
[0073] FIG6 is a schematic diagram of adding key frames provided by an embodiment of the present disclosure. Please refer to FIG6 , which includes the first frame image, the second frame image, and the third frame image, and each frame image includes a subject. The subject movements in the second frame image and the third frame image are the same. Key frames for zoom effects are added at the positions of the second frame image and the third frame image. When the video is played, the special effects between the second frame image and the third frame image are zoom effects. That is, starting from the second frame of the video, the subject gradually shrinks, and starting from the third frame of the video, the subject gradually enlarges until it reaches the size of the third frame image. In this way, even if the movement of the subject does not change between multiple image frames, animation effects can be added through key frames, thereby improving the playback effect of the video.
[0074] Optionally, after obtaining multiple third video frame images, the electronic device can splice the multiple third video frame images and the first video frame image to obtain a second video. For example, the first video includes video frame image 1, video frame image 2, and video frame image 3 (arranged in the order of playback). If the first video frame image is video frame image 2, the second video frame image can be video frame image 1 and video frame image 3. The electronic device can crop and move video frame image 1 based on the display position of the target object in video frame image 2 and the display position of the target object in video frame image 1 to obtain video frame image A (third video frame image 1). The electronic device can crop and move video frame image 3 based on the display position of the target object in video frame image 2 and the display position of the target object in video frame image 3 to obtain video frame image B (third video frame image 2). The electronic device can splice video frame image A, video frame image 2, and video frame image B to obtain a second video. The second video can have a camera movement effect, thereby reducing the difficulty and cost of obtaining a video with a camera movement effect.
[0075] The disclosed embodiments provide a video processing method. An electronic device can capture a first video frame image from a first video, detect selectable objects in the first video frame image, and determine the position of each selectable object in the first video frame image. Based on the position of each selectable object in the first video frame image, a selection box corresponding to each selectable object is generated in the first video frame image. In response to a touch operation on the selection box, the selectable object corresponding to the selection box is determined as a target object. The electronic device can crop and move the second video frame image based on the display position of the target object in the first video frame image to obtain a third video frame image from the second video, such that the display position of the target object in the third video frame image is the same as the display position of the target object in the first video frame image. A second video is then obtained based on the first video frame image and the plurality of third video frames. In this way, because the electronic device can generate a second video with a camera movement effect using video post-processing, users can obtain a video with a camera movement effect without extensive camera movement experience, reducing the difficulty of obtaining a camera movement video. Furthermore, the process of obtaining a camera movement video does not require the installation of auxiliary equipment for capturing the camera movement video, thereby reducing the cost of obtaining the camera movement video.
[0076] On the basis of the embodiment shown in FIG2 , in combination with FIG7 , a method for obtaining a third video frame image in the second video by cropping and moving the second video frame image according to the display position of the target object in the first video frame image in the above-mentioned video processing method is described in detail.
[0077] FIG7 is a schematic diagram of a method for determining a third video frame image provided by an embodiment of the present disclosure. Referring to FIG7 , the method flow includes:
[0078] S701: Determine cropping parameters and movement parameters corresponding to each second video frame image according to a display position of a target object in a first video frame image.
[0079] The cropping parameter may indicate an area to be cropped in the second video frame. For example, if the area indicated by the cropping parameter is the upper half of the second video frame, the area to be cropped in the second video frame may be the upper half. If the area indicated by the cropping parameter is the left half of the second video frame, the area to be cropped in the second video frame may be the left half.
[0080] The movement parameter may indicate the direction and distance of movement of the second video frame image. For example, if the movement parameter is to move 10 pixels to the right, the electronic device may determine that the movement direction of the second video frame image is rightward and the movement distance is 10 pixels. If the movement parameter is to move 20 pixels upward, the electronic device may determine that the movement direction of the second video frame image is upward and the movement distance is 20 pixels.
[0081] It should be noted that the movement parameters in the embodiment of the present disclosure may be movement parameters of the second video frame image, or movement parameters of a cropped image obtained after cropping the second video frame image, which is not limited in the embodiment of the present disclosure.
[0082] The electronic device determines cropping parameters and movement parameters corresponding to each second video frame image based on the display position of the target object in the first video frame image. Specifically, the electronic device may determine the display position of the target object in each second video frame image. Furthermore, the electronic device determines cropping parameters and movement parameters corresponding to the plurality of second video frames based on the display position of the target object in the first video frame image and the display positions of the target object in the plurality of second video frames.
[0083] The electronic device may determine the display position of the target object in each second video frame image according to the following feasible implementation method: for any second video frame image, determine the target object in the second video frame image, determine multiple key points corresponding to the target object, and determine the display position of the target object in the second video frame image based on the multiple key points.
[0084] For example, if the target object is a human face, the electronic device can process the second video frame image based on a face detection algorithm (and also process the cropped image including the face, which is not limited in the present embodiment). This can then obtain multiple facial key points corresponding to the face in the second video frame image, as well as the coordinates of each facial key point in the second video frame image. The electronic device can determine the display position of the target object in the second video frame image based on the coordinates of the multiple facial key points in the second video frame image.
[0085] For example, if the target object is a left hand, the electronic device can process the second video frame image based on the limb detection algorithm (and also process the cropped image including the left hand, which is not limited in the present embodiment). This can then obtain multiple limb key points corresponding to the left hand in the second video frame image, as well as the coordinates of each limb key point in the second video frame image. The electronic device can determine the display position of the target object in the second video frame image based on the coordinates of the multiple limb key points in the second video frame image.
[0086] It should be noted that the standard by which the electronic device determines the display position of the target object in the second video frame image is the same as the standard by which the electronic device determines the display position of the target object in the first video frame image. For example, if the electronic device determines the position of the center of the target object in the first video frame image as the display position of the target object in the first video frame image, then the electronic device can determine the position of the center of the target object in the second video frame image as the display position of the target object in the second video frame image. For example, if the target object is a human face, and the electronic device determines the position of the left eye of the human face in the first video frame image as the display position of the human face in the first video frame image, then the electronic device can determine the position of the left eye of the human face in the second video frame image as the display position of the human face in the second video frame image.
[0087] It should be noted that after the electronic device obtains the key points of the target object using the Bach algorithm, it can also use the Lens algorithm to fuse the positions of the key points of the target object and the position of the selection box of the target object. This can improve the stability of key point locking.
[0088] It should be noted that when the electronic device locks the position of the target object, it can start processing from the first video frame image in the first video. Therefore, the electronic device can obtain the target object in each video frame image in the first video.
[0089] The electronic device determines the target object in the second video frame image in the following two situations:
[0090] Case 1: the first video frame image is the first video frame image in the first video.
[0091] Optionally, if the first video frame image is the first video frame image in the first video, the electronic device may determine the target object in each second video frame image based on the target object and the target subject in which the target object is located. For example, if the image in the first video is the first frame image in the first video, the electronic device may sequentially determine the target object in the second video frame image based on the target object of the target subject determined by the user in the first video frame image.
[0092] Optionally, the first video frame image and the second video frame image may include at least one subject to be selected. The electronic device may determine the target subject in each second video frame image based on the identifier of the target subject where the target object in the first video frame image is located, and then determine the target object in each second video frame image. For example, if the first video includes 1 subject to be selected, the electronic device may determine that the target subject in the first video frame image and the second video frame image may be the subject to be selected. If the first video includes 3 subjects to be selected, and the target subject in the first video frame image is the second subject to be selected (the order may be from left to right or from right to left, which is not limited in the embodiment of the present disclosure), the electronic device may determine that the target subject in the second video frame image is also the second subject to be selected.
[0093] Optionally, after the electronic device determines the target subject in the second video frame image, it can detect the target object in the target subject. For example, if the target object in the first video frame image is the face of the target subject, the electronic device can determine that the target object in each second video frame image is the face of the target subject. For example, if the first video includes three subjects to be selected, the target subject in the first video frame image is the second subject to be selected, and the target object is the face of the second subject to be selected, then the electronic device can determine that the target object in each second video frame image can be the face of the second subject to be selected.
[0094] Optionally, the electronic device may detect the target object in the second video frame image. For example, the electronic device may process the second video frame image based on the Bach algorithm to obtain the target object in the second video frame image, which is not limited in the present embodiment.
[0095] It should be noted that the positions of multiple candidates can be swapped in the first video, but the position of the target subject will not change. For example, the first video frame image includes candidate subject 1 and candidate subject 2, and the target subject is the second candidate subject (candidate subject 2, candidate subject 2 is located to the right of candidate subject 1). If in any frame of the first video, candidate subject 2 moves to the left of candidate subject 1, then in that frame of the video, the target subject is the second candidate subject. However, the second candidate subject is candidate subject 1.
[0096] The target subject is described below with reference to FIG8 .
[0097] Figure 8 is a schematic diagram of a target subject provided by an embodiment of the present disclosure. Please refer to Figure 8, including an electronic device. The electronic device can display the third frame image in the first video. The third frame image includes subject 1 and subject 2. In the third frame image, subject 1 is the first subject, and subject 2 is the second subject. If the electronic device determines that the target subject of the first video frame image is the first subject, the electronic device determines that the target subject in the third frame image is subject 1. In the fourth frame image, subject 1 and subject 2 exchange positions, subject 2 becomes the first subject, and subject 1 becomes the second subject. Therefore, in the fourth frame image, the electronic device can determine that the target subject is subject 2.
[0098] It should be noted that, in actual application, if the target subject is the first subject, the electronic device only needs to detect any subject at the position of the first subject in the second video frame image, without determining whether the subject is the same as the target subject.
[0099] Case 2: the first video frame image is the Nth frame image in the first video.
[0100] If the first video frame image is the Nth frame image in the first video (N is an integer greater than 0), the electronic device can determine the target object in each second video frame image in the first N-1 frames based on the forward frame backtracking method. For example, if the first video frame image is the 5th video frame image, the electronic device has determined the target object in each second video frame image in the first 4 frames. Therefore, the electronic device can determine the target object in the second video frame image in the first 4 frames based on the forward frame backtracking method. For the second video frame image after the 5th frame, the electronic device can determine the target subject and target object in the second video frame image after the 5th frame based on the method in Case 1. The embodiments of the present disclosure are not limited to this.
[0101] In this case, the electronic device can determine the target object in each second video frame image from the previous N-1 frames by backtracking the forward frames. Therefore, when editing each video frame image in the first video, if the second video frame image is from the previous N-1 frames, the electronic device can directly determine the target object in that second video frame image. This saves system resources and improves the accuracy of target object determination.
[0102] It should be noted that the forward frame backtracking method can be specifically: the electronic device can perform inter-frame matching processing on the video frame images of the previous N-1 frames in sequence according to the target object of the first video frame image, and then obtain the target object in the video frame images of the previous N-1 frames.
[0103] It should be noted that if the first video frame image is the first frame image in the first video, the electronic device can detect the target object in each second video frame image based on the target object in the first video frame image. This embodiment of the present disclosure is not limited to this.
[0104] The following describes the scenario of forward frame backtracking with reference to FIG9 .
[0105] Figure 9 is a schematic diagram of a forward frame backtracking provided by an embodiment of the present disclosure. Please refer to Figure 9, which includes the first frame image, the second frame image, and the third frame image. Each frame image includes a subject, and the subject action in each frame image is different. If the user selects the target object as the subject's face in the third frame image, the electronic device (not shown in Figure 9) can perform inter-frame matching on the second frame image and the first frame image, and then determine the subject's face in the second frame image. After obtaining the face in the second frame image, the electronic device can perform inter-frame matching on the second frame image and the first frame image, and then determine the subject's face in the first frame image. Then, the target object of the first frame image and the second frame image is obtained.
[0106] According to the display position of the target object in the first video frame image and the display position of the target object in the plurality of second video frame images, the cropping parameters and movement parameters corresponding to the plurality of second video frame images are determined. Specifically, it can be: for any second video frame image, based on the image deformation algorithm, the display position of the target object in the first video frame image and the display position of the target object in the second video frame image are processed to obtain the cropping parameters and movement parameters corresponding to the second video frame image. For example, the electronic device can obtain the cropping parameters and movement parameters corresponding to the second video frame image by processing the display position of the target object in the second video frame image and the display position of the target object in the first video frame image according to the image warp algorithm. Then, the second video frame image can be cropped and moved based on the cropping parameters and movement parameters. And the electronic device can display the processed second video frame image (i.e., the third video frame image in the second video) so that the user can preview the processing results.
[0107] S702: Perform cropping and position movement processing on the plurality of second video frame images according to the plurality of cropping parameters and the plurality of movement parameters corresponding to the plurality of second video frame images to obtain a plurality of third video frame images in the second video.
[0108] The electronic device can obtain multiple third video frame images in the second video according to the following feasible implementation method: starting from the first frame of the multiple second video frame images, the multiple second video frame images are cropped and moved in sequence to obtain multiple third video frame images in the second video.
[0109] For example, when the electronic device locks the target object in the first video based on the Lens algorithm (that is, processes each video frame so that the obtained second video has the effect of locking the target object), the Lens algorithm needs to start processing from the first frame image of the first video. Therefore, the electronic device can process the second video frame image in sequence. For example, if the first video frame image is the first frame image in the first video, the electronic device can process the second frame image based on the cropping parameters and movement parameters corresponding to the second frame image (the second video frame image) to obtain a processed image corresponding to the second frame image (the third video frame image in the second video). The electronic device can process the third frame image based on the cropping parameters and movement parameters corresponding to the third frame image to obtain a processed image corresponding to the third frame image. Repeat the above steps until all the second video frame image processing is completed, and the electronic device can obtain the second video.
[0110] It should be noted that when the electronic device processes the second video frame image, each time the electronic device processes a second video frame image, it can display the third video frame image corresponding to the second video frame image. The electronic device can also display multiple third video frame images corresponding to multiple second video frame images after processing multiple second video frame images. The present disclosed embodiment is not limited to this. This can facilitate user preview and improve the user experience. In addition, the electronic device can use real-time trajectory anti-shake technology to smooth multiple key points of the locked target object and improve the stability of the video.
[0111] Optionally, after the electronic device obtains the second video, it can play the second video for the user to preview. The electronic device can adjust the second video based on the user's operation. For example, the user can rotate, scale, and offset each third video frame image of the second video. In response to the user's operation, the electronic device can re-lock the target object in the third video frame image through the Lens algorithm. For example, if the user rotates the first frame image in the second video, the electronic device can rotate the first frame image to obtain the rotated first frame image. It should be noted that after the user modifies the third video frame image, the electronic device smoothes and stabilizes the result of the user's modification, thereby improving the video effect.
[0112] Optionally, when the electronic device processes each second video frame using image warping, the electronic device can determine a cropping ratio, thereby constraining the warp matrix calculation to achieve the technical effect of adaptively removing black edges from the image frame, thereby improving the display quality of the second video. Optionally, when the electronic device locks on the target object, the locking scale of the target object in each image frame can remain unchanged, thereby improving the stability of the locking process.
[0113] It should be noted that the electronic device can determine the target object for each second video frame, as well as the corresponding cropping and movement parameters for each second video frame, frame by frame, and process the second video frames based on the cropping and movement parameters. For example, if a user selects a subject's face in frame 5 of the first video, the electronic device can backtrack through the forward frames to obtain the subject's face for frames 1 through 4. Based on the cropping and movement parameters for frames 1 through 4, the electronic device processes frames 1 through 4. When processing frame 6, the electronic device determines the location of the target object in frame 6 and determines the movement and cropping parameters for frame 6. The electronic device processes frame 6 based on the movement and cropping parameters for frame 6. When processing frame 6 is complete, the electronic device processes frame 7. In this way, in subsequent frames, after processing each frame, the electronic device processes the next frame. This provides real-time feedback on the processing results of each frame, thereby improving the quality of the second video.
[0114] The disclosed embodiment provides a method for determining a third video frame image, which determines the display position of a target object in each second video frame image. And according to the display position of the target object in the first video frame image and the display position of the target object in the plurality of second video frame images, the cropping parameters and movement parameters corresponding to the plurality of second video frame images are determined. Starting from the first frame in the plurality of second video frame images, the plurality of second video frame images are cropped and moved in sequence to obtain a plurality of third video frame images in the second video, and then obtain the second video. In this way, the electronic device can start the editing process from the first frame video frame image of the first video, and can promptly display the result of the editing process of each frame of the second video frame image, thereby improving the effect of the second video. Moreover, the electronic device can obtain a second video with a camera movement effect without installing an auxiliary shooting device, thereby reducing the cost of obtaining the camera movement video.
[0115] Based on any one of the above embodiments, the process of the above video processing method will be described below with reference to FIG10 .
[0116] FIG10 is a schematic diagram of a video processing method provided by an embodiment of the present disclosure. Referring to FIG10 , an electronic device is included. After receiving a first video, the electronic device may play the first video. When the first video plays to the third frame, the third frame may include a subject, a selection box for the subject's face, and selection boxes for the subject's left hand, right hand, left leg, and right leg.
[0117] Referring to FIG10 , when a user clicks the selection box for the subject's face, the electronic device determines that the target object is the subject's face. The electronic device can determine the position of the subject's face in the first image frame and the position of the subject's face in the second image frame by backtracking the forward frame. Based on the subject's face selected by the user, the electronic device determines the position of the subject's face in the fourth image frame and the position of the subject's face in the fifth image frame.
[0118] Please refer to Figure 10. The electronic device can determine the cropping parameters and movement parameters corresponding to each image frame, and process the first frame image based on the cropping parameters and movement parameters corresponding to the first frame image. The second frame image is processed based on the cropping parameters and movement parameters corresponding to the second frame image. The fourth frame image is processed based on the cropping parameters and movement parameters corresponding to the fourth frame image. The fifth frame image is processed based on the cropping parameters and movement parameters corresponding to the fifth frame image. Then, a second video is obtained. In this way, the display position of the face in each video frame image in the second video is the same, thereby achieving the effect of camera movement and reducing the difficulty of obtaining camera movement videos. In addition, there is no need to install auxiliary shooting equipment, which reduces the cost of obtaining camera movement videos.
[0119] FIG11 is a schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure. Referring to FIG11 , the video processing device 10 includes an acquisition module 11, a determination module 12, and a processing module 13, wherein: the acquisition module 11 is used to acquire a first video frame image in a first video; the determination module 12 is used to determine a target object in the first video frame image; the processing module 13 is used to edit the video frames in the first video according to the display position of the target object in the first video frame image to obtain a second video; the display position of the target object in the video frame image of the second video is the same as the display position of the target object in the first video frame image.
[0120] According to one or more embodiments of the present disclosure, the processing module 13 is specifically used to: perform cropping and position movement processing on the second video frame image according to the display position of the target object in the first video frame image to obtain a third video frame image in the second video, so that the display position of the target object in the third video frame image is the same as the display position of the target object in the first video frame image; and obtain the second video based on the first video frame image and multiple third video frame images.
[0121] According to one or more embodiments of the present disclosure, the processing module 13 is specifically configured to perform scaling and / or rotation processing on the second video frame image in the first video.
[0122] According to one or more embodiments of the present disclosure, the processing module 13 is specifically used to: determine the cropping parameters and movement parameters corresponding to each second video frame image according to the display position of the target object in the first video frame image; and perform cropping and position movement processing on the multiple second video frame images according to the multiple cropping parameters and multiple movement parameters corresponding to the multiple second video frame images to obtain multiple third video frame images in the second video.
[0123] According to one or more embodiments of the present disclosure, the processing module 13 is specifically used to: determine the display position of the target object in each of the second video frame images; determine the cropping parameters and movement parameters corresponding to the multiple second video frame images based on the display position of the target object in the first video frame image and the display position of the target object in the multiple second video frame images.
[0124] According to one or more embodiments of the present disclosure, the processing module 13 is specifically used to: for any one of the second video frame images; determine the target object in the second video frame image, and determine multiple key points corresponding to the target object; and determine the display position of the target object in the second video frame image based on the multiple key points.
[0125] According to one or more embodiments of the present disclosure, the processing module 13 is specifically configured to: start from the first frame of the plurality of second video frame images, and sequentially perform cropping processing and position movement processing on the plurality of second video frame images.
[0126] According to one or more embodiments of the present disclosure, the acquisition module 11 is specifically used to: detect the objects to be selected in the first video frame image, and determine the position of each object to be selected in the first video frame image; generate a selection box corresponding to each object to be selected in the first video frame image according to the position of each object to be selected in the first video frame image; in response to a touch operation on the selection box, determine the object to be selected corresponding to the selection box as the target object.
[0127] The video processing device provided in the embodiment of the present disclosure can be used to execute the technical solution of the above-mentioned method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.
[0128] FIG12 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. Please refer to FIG12 , which shows a schematic diagram of the structure of an electronic device 1200 suitable for implementing an embodiment of the present disclosure. The electronic device 1200 may be an electronic device or a server. The electronic device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG12 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0129] As shown in FIG12 , the electronic device 1200 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage device 1208 into a random access memory (RAM) 1203. Various programs and data required for the operation of the electronic device 1200 are also stored in the RAM 1203. The processing device 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0130] Typically, the following devices may be connected to the I / O interface 1205: an input device 1206 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1207 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1208 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1209. The communication device 1209 may allow the electronic device 1200 to communicate with other devices wirelessly or by wire to exchange data. Although FIG12 shows an electronic device 1200 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0131] 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 computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 1209, or installed from the storage device 1208, or installed from the ROM 1202. When the computer program is executed by the processing device 1201, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0132] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0133] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0134] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0135] Optionally, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method shown in the above embodiment is implemented.
[0136] Optionally, an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the method shown in the above embodiment when executed by a processor.
[0137] 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 object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on 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., via the Internet using an Internet Service Provider).
[0138] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0139] The units described in the embodiments of the present disclosure may be implemented in software or hardware. The name of a unit does not necessarily limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0140] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0141] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0142] It should be noted that the modifications of "one" and "multiple" 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, they should be understood as "one or more".
[0143] 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.
[0144] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0145] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the terminal device, application, server, or storage medium, that performs the operations of the disclosed technical solution, based on the prompt message.
[0146] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the terminal device.
[0147] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0148] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws and regulations. Data may include information, parameters and messages, such as flow switching indication information.
[0149] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0150] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0151] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
[0152] In a first aspect, one or more embodiments of the present disclosure provide a video processing method, the method comprising: acquiring a first video frame image in a first video; determining a target object in the first video frame image; editing the video frames in the first video according to the display position of the target object in the first video frame image to obtain a second video; wherein the display position of the target object in the video frame images of the second video is the same as the display position of the target object in the first video frame image.
[0153] According to one or more embodiments of the present disclosure, the video frame image of the first video includes a second video frame image; the editing process is performed on the video frame in the first video according to the display position of the target object in the first video frame image to obtain the second video, including: cropping and position moving the second video frame image according to the display position of the target object in the first video frame image to obtain a third video frame image in the second video, so that the display position of the target object in the third video frame image is the same as the display position of the target object in the first video frame image; the second video is obtained based on the first video frame image and multiple third video frame images.
[0154] According to one or more embodiments of the present disclosure, the editing of the video frames in the first video further includes: scaling and / or rotating the second video frame images in the first video.
[0155] According to one or more embodiments of the present disclosure, the cropping and position shifting processing is performed on the second video frame image according to the display position of the target object in the first video frame image to obtain a third video frame image in the second video, including: determining the cropping parameters and movement parameters corresponding to each second video frame image according to the display position of the target object in the first video frame image; and cropping and position shifting processing is performed on the multiple second video frame images according to the multiple cropping parameters and the multiple movement parameters corresponding to the multiple second video frame images to obtain multiple third video frame images in the second video.
[0156] According to one or more embodiments of the present disclosure, the cropping parameters and movement parameters corresponding to each second video frame image are determined according to the display position of the target object in the first video frame image, including: determining the display position of the target object in each second video frame image; and determining the cropping parameters and movement parameters corresponding to the multiple second video frame images according to the display position of the target object in the first video frame image and the display positions of the target objects in the multiple second video frame images.
[0157] According to one or more embodiments of the present disclosure, determining the display position of the target object in each of the second video frame images includes: for any one of the second video frame images; determining the target object in the second video frame image, and determining a plurality of key points corresponding to the target object; and determining the display position of the target object in the second video frame image based on the plurality of key points.
[0158] According to one or more embodiments of the present disclosure, the cropping and position movement processing is performed on the multiple second video frame images based on the multiple cropping parameters and the multiple movement parameters corresponding to the multiple second video frame images, including: starting from the first frame of the multiple second video frame images, the cropping and position movement processing is performed on the multiple second video frame images in sequence.
[0159] According to one or more embodiments of the present disclosure, determining the target object in the first video frame image includes: detecting objects to be selected in the first video frame image, and determining the position of each object to be selected in the first video frame image; generating a selection box corresponding to each object to be selected in the first video frame image according to the position of each object to be selected in the first video frame image; and in response to a touch operation on the selection box, determining the object to be selected corresponding to the selection box as the target object.
[0160] In a second aspect, one or more embodiments of the present disclosure provide a video processing device, which includes an acquisition module, a determination module and a processing module, wherein: the acquisition module is used to acquire a first video frame image in a first video; the determination module is used to determine a target object in the first video frame image; the processing module is used to edit the video frames in the first video according to the display position of the target object in the first video frame image to obtain a second video; wherein the display position of the target object in the video frame image of the second video is the same as the display position of the target object in the first video frame image.
[0161] According to one or more embodiments of the present disclosure, the processing module is specifically used to: perform cropping and position movement processing on the second video frame image according to the display position of the target object in the first video frame image to obtain a third video frame image in the second video, so that the display position of the target object in the third video frame image is the same as the display position of the target object in the first video frame image; and obtain the second video based on the first video frame image and multiple third video frame images.
[0162] According to one or more embodiments of the present disclosure, the processing module is specifically configured to perform scaling processing and / or rotation processing on the second video frame image in the first video.
[0163] According to one or more embodiments of the present disclosure, the processing module is specifically used to: determine the cropping parameters and movement parameters corresponding to each second video frame image based on the display position of the target object in the first video frame image; and perform cropping and position movement processing on the multiple second video frame images based on the multiple cropping parameters and multiple movement parameters corresponding to the multiple second video frame images to obtain multiple third video frame images in the second video.
[0164] According to one or more embodiments of the present disclosure, the processing module is specifically used to: determine the display position of the target object in each of the second video frame images; determine the cropping parameters and movement parameters corresponding to the multiple second video frame images based on the display position of the target object in the first video frame image and the display position of the target object in the multiple second video frame images.
[0165] According to one or more embodiments of the present disclosure, the processing module is specifically used to: for any one of the second video frame images; determine the target object in the second video frame image, and determine multiple key points corresponding to the target object; and determine the display position of the target object in the second video frame image based on the multiple key points.
[0166] According to one or more embodiments of the present disclosure, the processing module is specifically configured to: start from a first frame among the multiple second video frame images, and sequentially perform cropping processing and position movement processing on the multiple second video frame images.
[0167] According to one or more embodiments of the present disclosure, the acquisition module is specifically used to: detect the objects to be selected in the first video frame image, and determine the position of each object to be selected in the first video frame image; generate a selection box corresponding to each object to be selected in the first video frame image according to the position of each object to be selected in the first video frame image; and in response to a touch operation on the selection box, determine the object to be selected corresponding to the selection box as the target object.
[0168] In a third aspect, an embodiment of the present disclosure provides an electronic device comprising: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method as described in the first aspect and various possible aspects of the first aspect.
[0169] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the video processing method as described in the first aspect and various possible aspects of the first aspect are implemented.
[0170] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video processing method as described in the first aspect and various possible aspects of the first aspect.
[0171] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0172] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0173] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A video processing method, comprising: Acquire a first video frame image in a first video; Determining a target object in the first video frame image; According to the display position of the target object in the first video frame image, the video frames in the first video are edited to obtain a second video; wherein the display position of the target object in the video frame image of the second video is the same as the display position of the target object in the first video frame image.
2. The method according to claim 1, wherein the video frame image of the first video includes a second video frame image; The step of editing the video frames in the first video according to the display position of the target object in the first video frame image to obtain the second video includes: According to the display position of the target object in the first video frame image, the second video frame image is cropped and moved to obtain a third video frame image in the second video, so that the display position of the target object in the third video frame image is the same as the display position of the target object in the first video frame image; The second video is obtained according to the first video frame image and a plurality of third video frame images.
3. The method according to claim 2, wherein the editing of the video frames in the first video further comprises: The second video frame image in the first video is scaled and / or rotated.
4. The method according to claim 2, wherein the step of performing cropping and position movement processing on the second video frame image according to the display position of the target object in the first video frame image to obtain a third video frame image in the second video comprises: Determining a cropping parameter and a movement parameter corresponding to each of the second video frame images according to a display position of the target object in the first video frame image; According to the multiple cropping parameters and the multiple movement parameters corresponding to the multiple second video frame images, the multiple second video frame images are cropped and moved to obtain the multiple third video frame images in the second video.
5. The method according to claim 4, wherein determining the cropping parameters and movement parameters corresponding to each second video frame image according to the display position of the target object in the first video frame image comprises: Determining a display position of the target object in each second video frame image; According to the display position of the target object in the first video frame image and the display positions of the target objects in the plurality of second video frame images, cropping parameters and movement parameters corresponding to the plurality of second video frame images are determined.
6. The method according to claim 5, wherein determining the display position of the target object in each second video frame image comprises: For any one of the second video frame images; Determine the target object in the second video frame image, and determine a plurality of key points corresponding to the target object; A display position of the target object in the second video frame image is determined according to the multiple key points.
7. The method according to any one of claims 4 to 6, wherein the step of performing cropping and position movement processing on the plurality of second video frame images according to the plurality of cropping parameters and the plurality of movement parameters corresponding to the plurality of second video frame images comprises: Starting from the first frame of the plurality of second video frame images, the plurality of second video frame images are sequentially subjected to cropping processing and position movement processing.
8. The method according to any one of claims 1 to 5, wherein determining the target object in the first video frame image comprises: Detecting objects to be selected in the first video frame image, and determining a position of each object to be selected in the first video frame image; Generating a selection box corresponding to each to-be-selected object in the first video frame image according to the position of each to-be-selected object in the first video frame image; In response to a touch operation on the selection box, the to-be-selected object corresponding to the selection box is moved. Determined as the target object.
9. A video processing device, comprising an acquisition module, a determination module and a processing module, wherein: The acquisition module is used to acquire a first video frame image in a first video; The determination module is used to determine the target object in the first video frame image; The processing module is used to edit the video frames in the first video according to the display position of the target object in the first video frame image to obtain a second video; wherein the display position of the target object in the video frame image of the second video is the same as the display position of the target object in the first video frame image.
10. An electronic device comprising: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the video processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the video processing method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Video processing method and device and electronic equipment
CN119450191A
Video processing method and device, air vehicle, and system
CN108476289A
Video processing method and electronic equipment
CN113014793A
Video processing method and electronic equipment
CN115633255A
Method of generating a framed video system
US20160057446A1
