CN112954212A - Video generation method, device and equipment - Google Patents

Video generation method, device and equipment Download PDF

Info

Publication number
CN112954212A
CN112954212A CN202110172730.XA CN202110172730A CN112954212A CN 112954212 A CN112954212 A CN 112954212A CN 202110172730 A CN202110172730 A CN 202110172730A CN 112954212 A CN112954212 A CN 112954212A
Authority
CN
China
Prior art keywords
video
frame
video frame
target
frames
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110172730.XA
Other languages
Chinese (zh)
Other versions
CN112954212B (en
Inventor
王康康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202110172730.XA priority Critical patent/CN112954212B/en
Publication of CN112954212A publication Critical patent/CN112954212A/en
Application granted granted Critical
Publication of CN112954212B publication Critical patent/CN112954212B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Abstract

The application discloses a video generation method, a video generation device and video generation equipment, and belongs to the technical field of electronic equipment. The video generation method comprises the following steps: receiving a first input; responding to the first input, shooting a target scene to obtain at least two frames of video frames; determining a target area which meets a preset condition in a first video frame of the at least two video frames based on a second video frame of the at least two video frames, wherein the focal distance corresponding to the first video frame is smaller than the focal distance corresponding to the second video frame; blurring the target area; and synthesizing the first video frames after the at least two virtual target areas to obtain the target video. The video generation method, the video generation device and the video generation equipment can reduce power consumption of electronic equipment.

Description

Video generation method, device and equipment
Technical Field
The application belongs to the technical field of electronic equipment, and particularly relates to a video generation method, device and equipment.
Background
With the development of electronic devices, the electronic devices have been provided with many advanced image processing functions in the aspect of photographing, such as blurring photographing, beautifying and photographing, and the like.
The method for realizing the blurring in the related technology is to adopt a multi-camera blurring scheme, namely shooting the same scene through different cameras, and then blurring the image acquired based on the plurality of cameras.
However, in the course of implementing the present application, the inventors found that at least the following problems exist in the related art: the multi-camera virtualization scheme in the related art has high power consumption.
Disclosure of Invention
The embodiment of the application aims to provide a video generation method, a video generation device and video generation equipment, which can solve the problem of high power consumption.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides a video generation method, including:
receiving a first input;
responding to the first input, shooting a target scene to obtain at least two frames of video frames;
determining a target area which meets a preset condition in a first video frame of the at least two video frames based on a second video frame of the at least two video frames, wherein the focal distance corresponding to the first video frame is smaller than the focal distance corresponding to the second video frame;
blurring the target area;
and synthesizing the first video frames after the at least two virtual target areas to obtain the target video.
In a second aspect, an embodiment of the present application provides a video generating apparatus, including:
the first receiving module is used for receiving a first input;
the shooting module is used for responding to the first input and shooting a target scene to obtain at least two frames of video frames;
the first determining module is used for determining a target area which meets a preset condition in a first video frame of the at least two video frames based on a second video frame of the at least two video frames, wherein the focal distance corresponding to the first video frame is smaller than the focal distance corresponding to the second video frame;
a blurring module for blurring the target region;
and the generating module is used for synthesizing the first video frames after the at least two virtual target areas to obtain the target video.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the video generation method according to the first aspect.
In a fourth aspect, the present application provides a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the video generation method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the steps of the video generation method according to the first aspect.
In the embodiment of the application, a user can shoot a target scene by executing an input to obtain at least two frames of video frames, then, based on a second video frame, a target area which meets preset conditions in a first video frame is determined, the target area is further virtualized, and a target video is generated according to the first video frame after at least two virtualized target areas. Because the focus distance corresponding to the first video frame is smaller than the focus distance corresponding to the second video frame, the second video frame can be used to determine the background area in the first video frame, and further virtualize the background area in the first video frame. In addition, because the first video frame and the second video frame are video frames in video frames for shooting the target scene, the embodiment of the application can realize the virtualization of the recorded video by only using one camera to shoot the target scene, so that the video with the virtualization effect is obtained, and a plurality of cameras are not needed to shoot the target scene. Compared with a multi-camera virtualization mode in the prior art, the method and the device for processing the image data can reduce the power consumption and the cost of the device.
Drawings
Fig. 1 is a schematic flowchart of a video generation method provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a video generation apparatus provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
fig. 4 is a hardware configuration diagram of an electronic device implementing an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The video generation method, apparatus, device and medium provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Fig. 1 is a schematic flowchart of a video generation method according to an embodiment of the present application. The video generation method may include:
s101: receiving a first input;
s102: responding to the first input, shooting a target scene to obtain at least two frames of video frames;
s103: and determining a target area which meets a preset condition in a first video frame of the at least two video frames based on a second video frame of the at least two video frames, wherein the focus distance corresponding to the first video frame is smaller than the focus distance corresponding to the second video frame.
S104: blurring the target area;
s105: and synthesizing the first video frames after the at least two virtual target areas to obtain the target video.
Specific implementations of the above steps will be described in detail below.
In the embodiment of the application, a user can shoot a target scene by executing an input to obtain at least two frames of video frames, then, based on a second video frame, a target area which meets preset conditions in a first video frame is determined, the target area is further virtualized, and a target video is generated according to the first video frame after at least two virtualized target areas. Because the focus distance corresponding to the first video frame is smaller than the focus distance corresponding to the second video frame, the second video frame can be used to determine the background area in the first video frame, and further virtualize the background area in the first video frame. In addition, because the first video frame and the second video frame are video frames in video frames for shooting the target scene, the embodiment of the application can realize the virtualization of the recorded video by only using one camera to shoot the target scene, so that the video with the virtualization effect is obtained, and a plurality of cameras are not needed to shoot the target scene. Compared with a multi-camera virtualization mode in the prior art, the method and the device for processing the image data can reduce the power consumption and the cost of the device.
In some possible implementations of the embodiment of the present application, the first input in S101 may be a click input of a user clicking a "record" control displayed on a screen of the electronic device.
In some possible implementations of the embodiment of the present application, the target scene in S102 may be a scene for which shooting is performed.
In some possible implementations of the embodiments of the present application, S102 may include: after each frame of video frame which shoots a target scene at a first focusing distance is obtained, shooting the target scene at a second focusing distance to obtain a frame of video frame, wherein the first focusing distance is different from the second focusing distance; and after each frame of video frame which shoots the target scene at the second focusing distance is obtained, shooting the target scene at the first focusing distance to obtain a frame of video frame.
Illustratively, the target scene is first photographed at a focus distance X1 to obtain a 1 st frame of video frame, then photographed at a focus distance X2 to obtain a 2 nd frame of video frame, then photographed at a focus distance X1 to obtain a 3 rd frame of video frame, and then photographed at a focus distance X2 to obtain a 4 th frame of video frame … … until photographing is stopped. Wherein X1 is not equal to X2. It is understood that the focus distance corresponding to the ith frame video frame is X1, and the focus distance corresponding to the (i + 1) th frame video frame is X2, where i is an odd number.
In some possible implementations of the embodiment of the present application, capturing a target scene at the second focus distance to obtain a frame of video frame may include: and sending a first instruction to the camera so that the camera shoots a target scene according to the first instruction to obtain a frame of video frame, wherein the first instruction is used for instructing the camera to shoot the target scene at a second focusing distance. Shooting a target scene at a first focus distance to obtain a frame of video frame, which may include: and sending a second instruction to the camera so that the camera shoots a target scene according to the second instruction to obtain a frame of video frame, wherein the second instruction is used for instructing the camera to shoot the target scene at the first focusing distance.
Illustratively, the electronic device sends a first instruction to the camera instructing the camera to photograph the target scene at the second focus distance X2. After receiving the first instruction, the camera controls the motor to be at the position of the second focusing distance X2, and at this time, the camera captures a video frame at the second focusing distance X2, and then the camera sends the video frame to the electronic device through Image Signal Processing (ISP).
After receiving a frame of video frame collected by the camera at the second focusing distance X2, the electronic device sends a second instruction to the camera for instructing the camera to shoot the target scene at the first focusing distance X1. When the camera receives the second instruction, the motor of the camera is controlled to be at the position of the first focus distance X1, at this time, the camera acquires a frame of video frame at the first focus distance X1, and then the camera transmits the video frame to the electronic device through the ISP of the camera. After receiving a frame of video frame collected by the camera at the first focus distance X1, the electronic device sends a first instruction to the camera for instructing the camera to shoot a target scene at the second focus distance X2. And repeating the steps until the electronic equipment sends a video recording stopping instruction to the camera.
In some possible implementations of the embodiments of the present application, S102 may include: and sending a third instruction to the camera so that the camera shoots a target scene according to the third instruction to obtain at least two frames of video frames, wherein the third instruction is used for indicating the camera to shoot the target scene at a fourth focusing distance after shooting the target scene at the third focusing distance to obtain one frame of video frame, and shooting the target scene at the third focusing distance after shooting the target scene at the fourth focusing distance to obtain one frame of video frame, wherein the third focusing distance is different from the fourth focusing distance.
Illustratively, after a user clicks a "video recording" control displayed on a screen of the electronic device, the electronic device sends a video recording instruction to a camera (e.g., a camera), where the video recording instruction is used to instruct the camera to record a video of a target scene and instruct the camera to record the video in an alternating manner with two focusing distances during the video recording process, that is, the camera captures a frame of video frame with a third focusing distance X3, then captures a frame of video frame with a fourth focusing distance X4, then captures a frame of video frame with a third focusing distance X3, and then captures a frame of video frame with a fourth focusing distance X4, … …. After receiving the video recording command, the camera controls the motor to be at the position of the third focal distance X3, at this time, the camera captures a frame of video frame at the third focal distance X3, then the camera transmits the video frame to the electronic device through the ISP thereof, then the camera controls the motor to be at the position of the fourth focal distance X4, at this time, the camera captures a frame of video frame at the fourth focal distance X4, and then the camera transmits the video frame to the electronic device through the ISP thereof. And repeating the steps until the electronic equipment sends a video recording stopping instruction to the camera.
In some possible implementations of the embodiment of the present application, S103 may include: and determining a first area in the first video frame as a target area, wherein the definition of the first area is less than that of a second area corresponding to the first area in the second video frame.
Illustratively, the first video frame and the second video frame are divided according to the same region division manner, for example, the region division manner is 20 × 50, that is, the horizontal direction is divided into 20 regions on average, and the vertical direction is divided into 50 regions on average.
For the 1 st area in the first video frame, if the definition of the area is less than that of the 1 st area in the second video frame, determining the 1 st area in the first video frame as a target area, otherwise, not determining the 1 st area in the first video frame as the target area.
Similarly, it can be determined whether the other region except the 1 st region in the first video frame is the target region.
It can be understood that the target area determined by the embodiment of the present application is a background area in the video frame.
In this embodiment of the application, the background in the image that the camera shot with the great focus distance in two focus distances is more clear, and the main part object in the image that the camera shot with the less focus distance in above-mentioned two focus distances is more clear, consequently, can confirm the background region in the image that the camera shot with the less focus distance in above-mentioned two focus distances, and then carry out blurring to this background region. In addition, the embodiment of the application can obtain the video with the blurring effect by only one camera, so that the power consumption can be reduced.
In some possible implementations of the embodiment of the present application, after each first video frame after a blurring target area is obtained, the first video frame after the blurring target area may be added to the target video.
In some possible implementations of the embodiment of the application, after receiving the video recording stopping instruction (for example, the user clicks a "video recording" control displayed on the screen of the electronic device again), the first video frames after the plurality of virtual target areas are synthesized to obtain the target video.
In some possible implementations of the embodiment of the present application, the embodiment of the present application does not limit the blurring processing manner adopted for blurring the target region, and any available blurring processing manner may be applied to the embodiment of the present application.
In some possible implementations of the embodiment of the present application, in S102, the focus distances corresponding to any two adjacent video frames in the at least two video frames obtained by shooting the target scene are different.
In some possible implementations of the embodiment of the present application, the first video frame and the second video frame in S103 may be two adjacent video frames.
In some possible implementations of the embodiment of the present application, the two adjacent frames of video frames may include: a 2i frame video frame and a 2i-1 frame video frame, wherein i is a positive integer.
Illustratively, after clicking a "record" control displayed on a screen of the electronic device, a user shoots a scene to obtain a 10-second video including 240 video frames.
For the 1 st frame video frame and the 2 nd frame video frame, it is assumed that the focus distance corresponding to the 2 nd frame video frame is smaller than the focus distance corresponding to the 1 st frame video frame.
The 1 st frame video frame and the 2 nd frame video frame are divided according to the same region division mode, for example, the region division mode is 20 × 50, that is, the horizontal direction is divided into 20 regions on average, and the vertical direction is divided into 50 regions on average.
For the 1 st area in the 2 nd frame video frame, if the definition of the area is less than that of the 1 st area in the 1 st frame video frame, determining the 1 st area in the 2 nd frame video frame as a target area, otherwise, not determining the 1 st area in the 2 nd frame video frame as the target area.
Similarly, it can be determined whether the other region except for the 1 st region in the 2 nd frame video frame is the target region. And the target area in the 2 nd frame video frame can be blurred.
Similarly, the target areas in the 4 th frame video frame, the 6 th frame video frame, … … and the 240 th frame video frame can be determined. Further, the target areas in the 4 th frame video frame, the 6 th frame video frame, … …, and the 240 th frame video frame may be blurred.
When the target areas in the 2 nd frame video frame, the 4 th frame video frame, the 6 th frame video frame, … … and the 240 th frame video frame are blurred, the target video is generated according to the 2 nd frame video frame, the 4 th frame video frame, the 6 th frame video frame, … … and the 240 th frame video frame which are blurred. It is understood that, at this time, the target video includes 120 video frames.
In some possible implementations of embodiments of the present application, a shooting frame rate for shooting the target scene is 2 times a target video frame rate.
Illustratively, the frame rate of the target video is set in advance to 30 frames/second. The target scene is photographed at a photographing frame rate of 60 frames/second when photographing the target scene. Assuming that the time length for shooting the target scene is 4 seconds, 240 frames of video frames are obtained, wherein the focal distances of odd frames in the 240 frames of video frames are the same, the focal distances of even frames are the same, and the focal distances of the odd frames are smaller than the focal distances of the even frames.
A target area in the 1 st frame video frame based on the 2 nd frame video frame, a target area in the 3 rd frame video frame based on the 4 th frame video frame, … …, a target area in the 239 th frame video frame based on the 240 th frame video frame.
Blurring the target area in the 1 st frame video frame, the 3 rd frame video frame, … … and the 239 th frame video frame.
And generating a target video based on the 1 st frame video frame, the 3 rd frame video frame, … … and the 239 th frame video frame after the target area is blurred. In the case where the duration of the target video is the same as the shooting duration, the target video is 4 seconds including 120 frames of video, and the frame rate of the target video is 30 frames/second.
It can be understood that, when the shooting frame rate at which the target scene is shot is 2 times the target video frame rate and the shooting duration is the same as the duration of the target video, the number of video frames of the target video is half of the number of video frames of the video obtained by shooting.
In some possible implementations of embodiments of the present application, the shooting frame rate for shooting the target scene may be the same as the target video frame rate.
Illustratively, the frame rate of the target video is set in advance to 60 frames/second. The target scene is photographed at a photographing frame rate of 60 frames/second when photographing the target scene. Assuming that the time length for shooting the target scene is 4 seconds, 240 frames of video frames are obtained, wherein the focal distances of odd frames in the 240 frames of video frames are the same, the focal distances of even frames are the same, and the focal distances of the odd frames are smaller than the focal distances of the even frames.
A target area in the 1 st frame video frame based on the 2 nd frame video frame, a target area in the 3 rd frame video frame based on the 4 th frame video frame, … …, a target area in the 239 th frame video frame based on the 240 th frame video frame.
Blurring the target area in the 1 st frame video frame, the 3 rd frame video frame, … … and the 239 th frame video frame.
And generating a target video based on the 1 st frame video frame, the 3 rd frame video frame, … … and the 239 th frame video frame after the target area is blurred. In the case where the duration of the target video is half of the shooting duration, the target video is a 2-second video including 120 frames, and the frame rate of the target video is 60 frames/second.
It is understood that, when the photographing frame rate at which the target scene is photographed is the same as the target video frame rate and the photographing time is twice the time of the target video, the number of video frames obtained by photographing is twice the number of video frames of the target video.
In some possible implementations of the embodiment of the present application, before S101, the video generation method provided in the embodiment of the present application may further include: identifying a subject object in the preview image; and determining the focusing distance corresponding to the first video frame according to the object in the target scene corresponding to the main object.
For example, before S101, the electronic device displays a preview image corresponding to the target scene, identifies the preview image, identifies a subject object in the preview image, and determines a focus distance corresponding to the first video frame according to a position of an object corresponding to the subject object.
In this embodiment of the application, the focus distance corresponding to the second video frame may be the maximum focus distance of the camera.
The embodiment of the present application does not limit the manner in which the subject object is recognized from the image, and any available recognition manner may be applied to the example of the present application.
In some possible implementations of the embodiment of the present application, before S101, the video generation method provided in the embodiment of the present application may further include: receiving a second input to the preview image; in response to the second input, a focus distance corresponding to the first video frame is determined from objects in the target scene corresponding to the area of the second input in the preview image.
For example, before S101, when a user clicks a certain region in a preview image corresponding to a target scene displayed by the electronic device, an object included in the region is determined as a main object, and then a focusing distance corresponding to the first video frame is determined according to a position of an object corresponding to the main object.
In this embodiment of the application, the focus distance corresponding to the second video frame may be the maximum focus distance of the camera.
In some possible implementations of the embodiment of the present application, after S105, the video generating method provided in the embodiment of the present application may further include: and playing the target video.
In the embodiment of the application, the user can experience the video with the blurring effect through the played target video, and the user experience effect can be improved.
In some possible implementations of the embodiment of the present application, after S105, the video generating method provided in the embodiment of the present application may further include: the target video is stored.
It should be noted that, in the video generation method provided in the embodiments of the present application, the execution subject may be a video generation apparatus, or a control module in the video generation apparatus for executing the video generation method. The video generation apparatus provided in the embodiment of the present application will be described with reference to an example in which a video generation apparatus executes a video generation method.
Fig. 2 is a schematic structural diagram of a video generation apparatus according to an embodiment of the present application. The video generation apparatus 200 may include:
a first receiving module 201, configured to receive a first input;
a shooting module 202, configured to respond to a first input, shoot a target scene to obtain at least two video frames;
the first determining module 203 is configured to determine, based on a second video frame of the at least two video frames, a target region in a first video frame of the at least two video frames, where the target region meets a preset condition, and a focal distance corresponding to the first video frame is smaller than a focal distance corresponding to the second video frame;
a blurring module 204 for blurring the target region;
the generating module 205 is configured to synthesize the first video frames after the at least two blurring target areas to obtain a target video.
In the embodiment of the application, a user can shoot a target scene by executing an input to obtain at least two frames of video frames, then, based on a second video frame, a target area which meets preset conditions in a first video frame is determined, the target area is further virtualized, and a target video is generated according to the first video frame after at least two virtualized target areas. Because the focus distance corresponding to the first video frame is smaller than the focus distance corresponding to the second video frame, the second video frame can be used to determine the background area in the first video frame, and further virtualize the background area in the first video frame. In addition, because the first video frame and the second video frame are video frames in video frames for shooting the target scene, the embodiment of the application can realize the blurring of the recorded video by only using one camera, obtain the video with the blurring effect and does not need to use a plurality of cameras. Compared with a multi-camera virtualization mode in the prior art, the method and the device for processing the image data can reduce the power consumption and the cost of the device.
In some possible implementations of the embodiment of the present application, the shooting module 202 may be specifically configured to:
after each frame of video frame which shoots a target scene at a first focusing distance is obtained, shooting the target scene at a second focusing distance to obtain a frame of video frame, wherein the first focusing distance is different from the second focusing distance;
and after each frame of video frame which shoots the target scene at the second focusing distance is obtained, shooting the target scene at the first focusing distance to obtain a frame of video frame.
In some possible implementations of the embodiment of the present application, the first determining module 203 may be specifically configured to:
and determining a first area in the first video frame as a target area, wherein the definition of the first area is less than that of a second area corresponding to the first area in the second video frame.
In some possible implementations of the embodiment of the present application, the video generating apparatus 200 provided in the embodiment of the present application may further include:
the identification module is used for identifying a main body object in the preview image;
and the second determining module is used for determining the focusing distance corresponding to the first video frame according to the object in the target scene corresponding to the main body object.
In some possible implementations of the embodiment of the present application, the video generating apparatus 200 provided in the embodiment of the present application may further include:
the second receiving module is used for receiving a second input of the preview image;
and a third determining module, configured to determine, in response to the second input, a focus distance corresponding to the first video frame according to an object in the target scene corresponding to a region of the second input in the preview image.
In some possible implementations of embodiments of the present application, the focus distances corresponding to any two adjacent video frames of the at least two video frames are different.
In some possible implementations of embodiments of the present application, the first video frame and the second video frame are two adjacent video frames.
In some possible implementations of embodiments of the present application, the two adjacent frames of video frames include:
a 2i frame video frame and a 2i-1 frame video frame, wherein i is a positive integer.
In some possible implementations of embodiments of the present application, a shooting frame rate for shooting the target scene is 2 times a target video frame rate.
In some possible implementations of the embodiment of the present application, the video generating apparatus 200 provided in the embodiment of the present application may further include:
and the playing module is used for playing the target video.
In some possible implementations of the embodiment of the present application, the video generating apparatus 200 provided in the embodiment of the present application may further include:
and the storage module is used for storing the target video.
The video generation device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. Illustratively, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine, a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The video generation apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The video generation apparatus provided in the embodiment of the present application can implement each process in the video generation method embodiment of fig. 1, and is not described here again to avoid repetition.
Optionally, as shown in fig. 3, an electronic device 300 is further provided in this embodiment of the present application, and includes a processor 301, a memory 302, and a program or an instruction stored in the memory 302 and capable of being executed on the processor 301, where the program or the instruction is executed by the processor 301 to implement each process of the above-mentioned video generation method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
In some possible implementations of embodiments of the present Application, the processor 301 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of embodiments of the present Application.
In some possible implementations of embodiments of the present application, the Memory 302 may include Read-Only Memory (ROM), Random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash Memory devices, electrical, optical, or other physical/tangible Memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the video generation methods according to embodiments of the application.
Fig. 4 is a schematic hardware structure diagram of an electronic device implementing an embodiment of the present application. The electronic device 400 includes, but is not limited to: radio unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, and processor 410.
Those skilled in the art will appreciate that the electronic device 400 may further include a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 410 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 4 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The user input unit 407 is configured to receive a first input.
An input unit 404, configured to capture a target scene in response to a first input, resulting in at least two video frames.
The processor 410 is configured to determine, based on a second video frame of the at least two video frames, a target region in a first video frame of the at least two video frames, where the target region meets a preset condition, and a focus distance corresponding to the first video frame is smaller than a focus distance corresponding to the second video frame; blurring the target area; and synthesizing the first video frames after the at least two virtual target areas to obtain the target video.
In the embodiment of the application, a user can shoot a target scene by executing an input to obtain at least two frames of video frames, then, based on a second video frame, a target area which meets preset conditions in a first video frame is determined, the target area is further virtualized, and a target video is generated according to the first video frame after at least two virtualized target areas. Because the focus distance corresponding to the first video frame is smaller than the focus distance corresponding to the second video frame, the second video frame can be used to determine the background area in the first video frame, and further virtualize the background area in the first video frame. In addition, because the first video frame and the second video frame are video frames in video frames for shooting the target scene, the embodiment of the application can realize the blurring of the recorded video by only using one camera, obtain the video with the blurring effect and does not need to use a plurality of cameras. Compared with a multi-camera virtualization mode in the prior art, the method and the device for processing the image data can reduce the power consumption and the cost of the device.
In some possible implementations of the embodiment of the present application, the input unit 404 may be specifically configured to:
after each frame of video frame which shoots a target scene at a first focusing distance is obtained, shooting the target scene at a second focusing distance to obtain a frame of video frame, wherein the first focusing distance is different from the second focusing distance;
and after each frame of video frame which shoots the target scene at the second focusing distance is obtained, shooting the target scene at the first focusing distance to obtain a frame of video frame.
In some possible implementations of embodiments of the present application, the processor 410 may be specifically configured to:
and determining a first area in the first video frame as a target area, wherein the definition of the first area is less than that of a second area corresponding to the first area in the second video frame.
In some possible implementations of embodiments of the present application, the processor 410 may be further configured to:
identifying a subject object in the preview image;
and determining the focusing distance corresponding to the first video frame according to the object in the target scene corresponding to the main object.
In some possible implementations of embodiments of the present application, the user input unit 407 may be further configured to:
receiving a second input to the preview image;
accordingly, the processor 410 may be further configured to:
in response to the second input, a focus distance corresponding to the first video frame is determined from objects in the target scene corresponding to regions of the second input in the preview image.
In some possible implementations of embodiments of the present application, the display unit 406 may be configured to:
and playing the target video.
In some possible implementations of embodiments of the present application, the memory 409 may be used to:
the target video is stored.
It should be understood that in the embodiment of the present application, the input Unit 404 may include a Graphics Processing Unit (GPU) 4041 and a microphone 4042, and the Graphics processor 4041 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 407 includes a touch panel 4071 and other input devices 4072. A touch panel 4071, also referred to as a touch screen. The touch panel 4071 may include two parts, a touch detection device and a touch controller. Other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. The memory 409 may be used to store software programs as well as various data including, but not limited to, application programs and an operating system. The processor 410 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 410.
The embodiments of the present application further provide a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the video generation method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. Examples of the readable storage medium include non-transitory computer readable storage media such as ROM, RAM, magnetic or optical disks, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the above video generation method embodiment, and can achieve the same technical effect, and the details are not repeated here to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the video generation method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (11)

1. A method of video generation, the method comprising:
receiving a first input;
responding to the first input, shooting a target scene to obtain at least two frames of video frames;
determining a target area which meets a preset condition in a first video frame of the at least two video frames based on a second video frame of the at least two video frames, wherein a focus distance corresponding to the first video frame is smaller than a focus distance corresponding to the second video frame;
blurring the target area;
and synthesizing at least two first video frames after blurring the target area to obtain a target video.
2. The method of claim 1, wherein said capturing the target scene resulting in at least two video frames comprises:
after each frame of video frame which shoots the target scene at a first focusing distance is obtained, shooting the target scene at a second focusing distance to obtain a frame of video frame, wherein the first focusing distance is different from the second focusing distance;
and after each frame of video frame which is shot for the target scene by the second focusing distance is obtained, shooting the target scene by the first focusing distance to obtain a frame of video frame.
3. The method of claim 1, wherein the determining a target region in a first video frame of the at least two video frames that meets a preset condition based on a second video frame of the at least two video frames comprises:
and determining a first area in the first video frame as the target area, wherein the definition of the first area is smaller than that of a second area corresponding to the first area in the second video frame.
4. The method of claim 1, wherein prior to said receiving the first input, the method further comprises:
identifying a subject object in the preview image;
and determining the focusing distance corresponding to the first video frame according to the object in the target scene corresponding to the main body object.
5. The method of claim 1, wherein prior to said receiving the first input, the method further comprises:
receiving a second input to the preview image;
in response to the second input, determining a focus distance corresponding to the first video frame from an object in the target scene corresponding to a region of the second input in the preview image.
6. The method according to claim 1, wherein any two adjacent video frames of the at least two video frames have different focus distances.
7. The method of claim 1, wherein the first video frame and the second video frame are two adjacent video frames.
8. The method of claim 7, wherein the two adjacent frames of video frames comprise:
a 2i frame video frame and a 2i-1 frame video frame, wherein i is a positive integer.
9. The method of claim 1, wherein a frame rate of capturing the target scene is 2 times the target video frame rate.
10. A video generation apparatus, characterized in that the apparatus comprises:
the first receiving module is used for receiving a first input;
the shooting module is used for responding to the first input and shooting a target scene to obtain at least two frames of video frames;
a first determining module, configured to determine, based on a second video frame of the at least two video frames, a target region in a first video frame of the at least two video frames, where the target region meets a preset condition, and a focal distance corresponding to the first video frame is smaller than a focal distance corresponding to the second video frame;
a blurring module for blurring the target region;
and the synthesis module is used for synthesizing the at least two first video frames after the target area is virtualized to obtain a target video.
11. An electronic device, characterized in that the electronic device comprises: a processor, a memory and a program or instructions stored on the memory and executable on the processor, which when executed by the processor, implement the steps of the video generation method of any of claims 1 to 9.
CN202110172730.XA 2021-02-08 2021-02-08 Video generation method, device and equipment Active CN112954212B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110172730.XA CN112954212B (en) 2021-02-08 2021-02-08 Video generation method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110172730.XA CN112954212B (en) 2021-02-08 2021-02-08 Video generation method, device and equipment

Publications (2)

Publication Number Publication Date
CN112954212A true CN112954212A (en) 2021-06-11
CN112954212B CN112954212B (en) 2022-08-30

Family

ID=76244153

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110172730.XA Active CN112954212B (en) 2021-02-08 2021-02-08 Video generation method, device and equipment

Country Status (1)

Country Link
CN (1) CN112954212B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114253623A (en) * 2021-11-19 2022-03-29 惠州Tcl移动通信有限公司 Screen amplification processing method and device based on mobile terminal, terminal and medium
CN114584709A (en) * 2022-03-03 2022-06-03 北京字跳网络技术有限公司 Zoom special effect generation method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101465972A (en) * 2007-12-21 2009-06-24 三星Techwin株式会社 Apparatus and method for blurring image background in digital image processing device
JP2012085205A (en) * 2010-10-14 2012-04-26 Canon Inc Image processing apparatus, imaging device, image processing method, and image processing program
US20160381302A1 (en) * 2015-06-25 2016-12-29 Canon Kabushiki Kaisha Image-processing apparatus and image-processing method
CN107566741A (en) * 2017-10-26 2018-01-09 广东欧珀移动通信有限公司 Focusing method, device, computer-readable recording medium and computer equipment
CN109151329A (en) * 2018-11-22 2019-01-04 Oppo广东移动通信有限公司 Photographic method, device, terminal and computer readable storage medium
CN110505406A (en) * 2019-08-26 2019-11-26 宇龙计算机通信科技(深圳)有限公司 Background-blurring method, device, storage medium and terminal
CN111698553A (en) * 2020-05-29 2020-09-22 维沃移动通信有限公司 Video processing method and device, electronic equipment and readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101465972A (en) * 2007-12-21 2009-06-24 三星Techwin株式会社 Apparatus and method for blurring image background in digital image processing device
JP2012085205A (en) * 2010-10-14 2012-04-26 Canon Inc Image processing apparatus, imaging device, image processing method, and image processing program
US20160381302A1 (en) * 2015-06-25 2016-12-29 Canon Kabushiki Kaisha Image-processing apparatus and image-processing method
CN107566741A (en) * 2017-10-26 2018-01-09 广东欧珀移动通信有限公司 Focusing method, device, computer-readable recording medium and computer equipment
CN109151329A (en) * 2018-11-22 2019-01-04 Oppo广东移动通信有限公司 Photographic method, device, terminal and computer readable storage medium
CN110505406A (en) * 2019-08-26 2019-11-26 宇龙计算机通信科技(深圳)有限公司 Background-blurring method, device, storage medium and terminal
CN111698553A (en) * 2020-05-29 2020-09-22 维沃移动通信有限公司 Video processing method and device, electronic equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王昊等: "双摄手机时代已经来临 深度解析双摄技术为何能带来单反级摄影体验", 《数码影像时代》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114253623A (en) * 2021-11-19 2022-03-29 惠州Tcl移动通信有限公司 Screen amplification processing method and device based on mobile terminal, terminal and medium
CN114253623B (en) * 2021-11-19 2024-01-19 惠州Tcl移动通信有限公司 Screen amplification processing method and device based on mobile terminal, terminal and medium
CN114584709A (en) * 2022-03-03 2022-06-03 北京字跳网络技术有限公司 Zoom special effect generation method, device, equipment and storage medium
CN114584709B (en) * 2022-03-03 2024-02-09 北京字跳网络技术有限公司 Method, device, equipment and storage medium for generating zooming special effects

Also Published As

Publication number Publication date
CN112954212B (en) 2022-08-30

Similar Documents

Publication Publication Date Title
CN112153301B (en) Shooting method and electronic equipment
CN112714253B (en) Video recording method and device, electronic equipment and readable storage medium
CN112954212B (en) Video generation method, device and equipment
CN112135046A (en) Video shooting method, video shooting device and electronic equipment
CN112637500B (en) Image processing method and device
CN112333382B (en) Shooting method and device and electronic equipment
CN106331497A (en) Image processing method and terminal
CN113596294A (en) Shooting method and device and electronic equipment
CN112422798A (en) Photographing method and device, electronic equipment and storage medium
CN112511743B (en) Video shooting method and device
CN113709368A (en) Image display method, device and equipment
CN114390197A (en) Shooting method and device, electronic equipment and readable storage medium
CN112367486B (en) Video processing method and device
CN111586305A (en) Anti-shake method, anti-shake device and electronic equipment
CN114125297B (en) Video shooting method, device, electronic equipment and storage medium
CN112738398B (en) Image anti-shake method and device and electronic equipment
CN115499589A (en) Shooting method, shooting device, electronic equipment and medium
CN112383708B (en) Shooting method and device, electronic equipment and readable storage medium
CN112887605B (en) Image anti-shake method and device and electronic equipment
CN112153291B (en) Photographing method and electronic equipment
CN114339051A (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN114390206A (en) Shooting method and device and electronic equipment
CN113473012A (en) Virtualization processing method and device and electronic equipment
CN114125226A (en) Image shooting method and device, electronic equipment and readable storage medium
CN112367464A (en) Image output method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant