CN114598824A - Method, device and equipment for generating special effect video and storage medium - Google Patents

Method, device and equipment for generating special effect video and storage medium Download PDF

Info

Publication number
CN114598824A
CN114598824A CN202210226270.9A CN202210226270A CN114598824A CN 114598824 A CN114598824 A CN 114598824A CN 202210226270 A CN202210226270 A CN 202210226270A CN 114598824 A CN114598824 A CN 114598824A
Authority
CN
China
Prior art keywords
virtual
video
fluid
force field
dimensional space
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
CN202210226270.9A
Other languages
Chinese (zh)
Other versions
CN114598824B (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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology 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 Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202210226270.9A priority Critical patent/CN114598824B/en
Publication of CN114598824A publication Critical patent/CN114598824A/en
Application granted granted Critical
Publication of CN114598824B publication Critical patent/CN114598824B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • G06T17/205Re-meshing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the disclosure discloses a method, a device, equipment and a storage medium for generating a special effect video. Carrying out camera reverse solving on an original video to obtain a three-dimensional space corresponding to the original video; determining a virtual force field in the three-dimensional space; performing fluid calculation on the virtual fluid based on the virtual force field to obtain the motion state of the virtual fluid; carrying out voxel gridding on the plurality of virtual particles to obtain a grid curved surface of the virtual fluid; rendering the mesh curved surface to obtain a flowing video of the virtual fluid; and overlapping the flowing video and the original video to obtain a target special effect video. According to the method for generating the special effect video, the flow video corresponding to the virtual fluid is overlapped with the original video to obtain the target special effect video, so that the special effect of virtual fluid flow can be added into the video, and the interestingness of the video is increased.

Description

Method, device and equipment for generating special effect video and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of image processing, and in particular, to a method, an apparatus, a device and a storage medium for generating a special effect video.
Background
With the increasing trend of information fragmentation, short videos become the best carrier of quick contact information in a new media form, and with the maturity of the 5G technology, the application scenes of the short videos are greatly enriched. In order to increase the interest of the short video, adding a virtual special effect to the short video is more and more favored by users.
Disclosure of Invention
The embodiment of the disclosure provides a method, a device and equipment for generating a special effect video and a storage medium, so as to add a special effect of virtual fluid flow in the video and increase the interestingness of the video.
In a first aspect, an embodiment of the present disclosure provides a method for generating a special effect video, including:
carrying out camera reverse solving on an original video to obtain a three-dimensional space corresponding to the original video;
determining a virtual force field in the three-dimensional space;
performing fluid calculation on the virtual fluid based on the virtual force field to obtain the motion state of the virtual fluid; wherein the virtual fluid is composed of a plurality of virtual particles; the motion state comprises motion speed, motion direction and position;
carrying out voxel gridding on the plurality of virtual particles to obtain a grid curved surface of the virtual fluid;
rendering the mesh curved surface to obtain a flowing video of the virtual fluid;
and overlapping the flowing video and the original video to obtain a target special effect video.
In a second aspect, an embodiment of the present disclosure further provides an apparatus for generating a special effect video, including:
the three-dimensional space acquisition module is used for performing camera back-solving on an original video to obtain a three-dimensional space corresponding to the original video;
a virtual force field determination module to determine a virtual force field in the three-dimensional space;
the motion state determination module is used for carrying out fluid calculation on the virtual fluid based on the virtual force field to obtain the motion state of the virtual fluid; wherein the virtual fluid is composed of a plurality of virtual particles; the motion state comprises motion speed, motion direction and position;
a mesh curved surface obtaining module, configured to perform voxel meshing on the multiple virtual particles to obtain a mesh curved surface of the virtual fluid;
the flow video acquisition module is used for rendering the mesh curved surface to acquire a flow video of the virtual fluid;
and the target special-effect video acquisition module is used for overlapping the flowing video and the original video to acquire a target special-effect video.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes:
one or more processing devices;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement the generation method of the special effects video according to the embodiment of the present disclosure.
In a fourth aspect, the disclosed embodiments also provide a computer readable medium, on which a computer program is stored, where the computer program, when executed by a processing device, implements the method for generating a special effect video according to the disclosed embodiments
The embodiment of the disclosure discloses a method, a device, equipment and a storage medium for generating a special effect video. Performing camera back-solving on the original video to obtain a three-dimensional space corresponding to the original video; determining a virtual force field in three-dimensional space; performing fluid calculation on the virtual fluid based on the virtual force field to obtain the motion state of the virtual fluid; carrying out voxel gridding on the plurality of virtual particles to obtain a grid curved surface of the virtual fluid; rendering the mesh curved surface to obtain a flow video of the virtual fluid; and overlapping the flowing video and the original video to obtain a target special effect video. According to the method for generating the special effect video, the flow video corresponding to the virtual fluid is overlapped with the original video to obtain the target special effect video, so that the special effect of virtual fluid flow can be added into the video, and the interestingness of the video is increased.
Drawings
Fig. 1 is a flow chart of a method of generating a special effects video in an embodiment of the present disclosure;
FIG. 2 is an exemplary diagram of a virtual force field in an embodiment of the present disclosure;
FIG. 3 is a schematic flow diagram of water in an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a special effect video generation apparatus in an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device in the embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Fig. 1 is a flowchart of a method for generating a special effect video according to an embodiment of the present disclosure, where the embodiment is applicable to a situation of generating a special effect video, and the method may be executed by a device for generating a special effect video, where the device may be composed of hardware and/or software, and may be generally integrated in a device having a function of generating a special effect video, where the device may be an electronic device such as a server, a mobile terminal, or a server cluster. As shown in fig. 1, the method specifically includes the following steps:
and S110, performing camera back-solving on the original video to obtain a three-dimensional space corresponding to the original video.
The original video can be obtained by shooting through a mobile terminal or a camera device by a user. The three-dimensional space includes three-dimensional coordinates and depth information of each pixel point. The reverse calculation of the camera can be understood as the restoration of camera parameters and three-dimensional space information, and the principle can be that the motion track of key pixel points in continuous frames of an original video is tracked by analyzing the continuous frames, and the space track of the current camera is calculated by utilizing the perspective principle, so that the three-dimensional space corresponding to the original video is obtained. The key pixel points can be special mark points or points selected by a user in a shooting scene. In this embodiment, the reverse calculation of the camera may be implemented by using an existing Digital camcoder (DCC) algorithm or a Simultaneous Localization and Mapping (SLAM) algorithm, which is not limited herein.
And S120, determining a virtual force field in the three-dimensional space.
The virtual force field has a size and a direction, and can push the virtual fluid to move according to a preset track in a three-dimensional space. The virtual force field can be arranged in a three-dimensional space according to special effect requirements by a user.
Specifically, the manner of determining the virtual force field in the three-dimensional space may be: adding curved and/or polygonal objects in a three-dimensional space; a virtual force field is generated based on curved and/or polygonal objects.
The curve may be a curve with a certain track, and may be randomly added in a three-dimensional space by a user or drawn according to a certain track. The polygonal object can be added according to special effect requirements, and can be a polygonal object composed of artistic characters or object forms, for example: the artistic words "love" or polygonal objects corresponding to animal shapes.
The virtual force field may be generated based on a curve by using the curve as an axis, using a tubular space surrounded by a set size as a radius as a force field space, and using a trajectory direction of the curve as a force field direction.
The manner of generating the virtual force field based on the polygonal object may be: and determining a virtual force Field corresponding to the polygonal object based on a directed Distance Field (SDF) algorithm. The principle of the SDF algorithm may be to set the force field of the surface of the polygonal object to 0, the force field inside the polygonal object to be a negative value, and the force field outside the polygonal object to be a positive value.
Optionally, the manner of adding the curve in the three-dimensional space may be: determining a starting point and an end point in a three-dimensional space; generating a first initial curve between the starting point and the ending point; and adding random noise to the first initial curve to obtain a first target curve.
The starting point can be randomly selected by a user or any pixel point of a target object in an original video is taken as the starting point. For example: assuming that a 'cup' exists in the original video, any pixel point in the outlet of the 'cup' can be used as a starting point. The termination point may be randomly selected by the user, or any pixel point of the target object in the original video is used as the termination point, or any pixel point in the added polygonal object is used as the termination point. After the starting point and the ending point are determined, a curve of an arbitrary track is drawn between the starting point and the ending point to obtain a first initial curve, and then random noise is added to the first initial curve to perform some offset processing on points in the initial curve to obtain a first target curve.
Optionally, the manner of adding the curve in the three-dimensional space may also be: if a human body is detected in the original video, detecting the motion track of the human body set skeleton key point in a three-dimensional space; generating a second initial curve based on the motion trail; and smoothing the second initial curve to obtain a second target curve.
Wherein, the set skeleton key points can be human hand key points. The method for detecting the motion track of the human body set bone key point in the three-dimensional space can be as follows: detecting the set bone key points of each video frame in the original video to obtain the position points of the set bone key points in each video frame, connecting the position points in each video frame to obtain the motion track of the set bone key points in the three-dimensional space. Generating the second initial curve based on the motion trajectory may be taking the motion trajectory directly as the second initial curve. The smoothing of the second initial curve may be performed by using an existing curve smoothing algorithm, for example: a quadratic exponential smoothing method, a least square method, or a 5-point 3-time smoothing method, etc., which are not limited herein.
Optionally, the manner of generating the virtual force field based on the curve may be: for each point of the curve, a sphere with the set length as the radius by taking the current point as the center is used as the force field space of the current point; and determining the tangential direction of the current point as the direction of the force field in the force field space to obtain a virtual force field.
The set length may be set by a user, and is not limited herein. A force field space is understood to be a space in which a force field is present. In this embodiment, the force field space corresponding to the curve is a tubular space with the curve as an axis and the set length as a radius. The corresponding force field direction of each point on the curve is the tangential direction of the point on the curve. Illustratively, fig. 2 is an exemplary diagram of a virtual force field in the present embodiment.
And S130, performing fluid calculation on the virtual fluid based on the virtual force field to obtain the motion state of the virtual fluid.
Wherein the virtual fluid is composed of a plurality of virtual particles; the motion state comprises the motion speed, the motion direction and the motion position. A virtual fluid may be understood as an object that can flow, for example: liquid, boring, rope, etc.
Performing a fluid solution on a virtual fluid based on a virtual force field may be understood as performing a fluid solution on each virtual particle in a virtual fluid based on a virtual force field. The motion state may be a motion state of the virtual fluid at various times, which may correspond to points in time of video frames of the original video. In this embodiment, an initial velocity is given to each virtual particle of the virtual fluid at the starting point of the virtual force field, and then each virtual particle moves to the ending point of the virtual force field according to the corresponding trajectory of the virtual force field under the pushing of the virtual force field, so as to form the special effect of the virtual fluid flow.
Optionally, fluid calculation is performed on the virtual fluid based on the virtual force field, and the manner of obtaining the motion state of the virtual fluid may be: acquiring the motion state of each virtual particle of the virtual fluid at the previous moment; and respectively carrying out fluid calculation on each virtual particle according to the virtual force field and the motion state at the previous moment to obtain the motion state of each virtual particle at the current moment.
The fluid solution may be implemented according to an existing fluid solution (flip) algorithm, which is not limited herein. And determining the motion state of each virtual particle of the virtual fluid at each moment, so as to obtain the motion mode of the virtual fluid.
And S140, carrying out voxel gridding on the plurality of virtual particles to obtain a grid curved surface of the virtual fluid.
In this embodiment, for the virtual fluid at each time, a plurality of virtual particles of the virtual fluid at the current time are first converted into a voxel grid (mesh), and then the voxel grid is processed by using a level set method to obtain a grid curved surface. The mesh surface is the surface mesh of the virtual fluid.
And S150, rendering the mesh curved surface to obtain a flow video of the virtual fluid.
The mesh surface rendering can be understood as firstly determining the color value and the brightness of each pixel point of the mesh surface, and then rendering each pixel point based on the color value and the brightness.
Optionally, rendering the mesh surface to obtain the flow video of the virtual fluid may be: acquiring brightness information and color information of each pixel point; and rendering each pixel point of the mesh curved surface based on the brightness information and the color information to obtain a flowing video of the virtual fluid.
The brightness information can be understood as illumination information and is determined by light reflected by the pixel points. I.e., Image-Based Lighting (IBL) information, a Normal Map (Normal Map) or a Height Map (Height Map) may be used: the Bump Map (Bump Map), the disparity Map (paralax Map), and the Displacement Map (Displacement Map), and the like, and the method is not limited herein. The color information may be the actual color of the virtual fluid.
In this embodiment, the mesh curved surface of the virtual fluid at each time is rendered to obtain an image of the virtual fluid at the current time, and the images of the virtual fluid rendered at each time are combined in a time sequence to obtain a flow video of the virtual fluid. Exemplarily, taking "water" as an example, fig. 3 is a schematic flow diagram of water in the present embodiment, and as shown in fig. 3, is a diagram of the flow state of water at several times of extraction.
And S160, overlapping the flowing video and the original video to obtain a target special effect video.
Specifically, the manner of overlaying the streaming video and the original video may be: the method comprises the steps of aligning the flowing video frames with the original video frames one by one, overlapping every two aligned video frames to obtain special effect video frames, and splicing the special effect video frames according to a time sequence to obtain a target special effect video.
According to the technical scheme of the embodiment, the original video is subjected to reverse camera solving to obtain a three-dimensional space corresponding to the original video; determining a virtual force field in three-dimensional space; performing fluid calculation on the virtual fluid based on the virtual force field to obtain the motion state of the virtual fluid; carrying out voxel gridding on the plurality of virtual particles to obtain a grid curved surface of the virtual fluid; rendering the mesh curved surface to obtain a flow video of the virtual fluid; and overlapping the flowing video and the original video to obtain a target special effect video. According to the method for generating the special effect video, the flow video corresponding to the virtual fluid is overlapped with the original video to obtain the target special effect video, so that the special effect of virtual fluid flow can be added into the video, and the interestingness of the video is increased.
Fig. 4 is a schematic structural diagram of an apparatus for generating a special effect video according to an embodiment of the present disclosure, and as shown in fig. 4, the apparatus includes:
the three-dimensional space obtaining module 210 is configured to perform a camera inversion on the original video to obtain a three-dimensional space corresponding to the original video;
a virtual force field determination module 220 for determining a virtual force field in three-dimensional space;
the motion state determination module 230 is configured to perform fluid calculation on the virtual fluid based on the virtual force field to obtain a motion state of the virtual fluid; wherein the virtual fluid is composed of a plurality of virtual particles; the motion state comprises motion speed, motion direction and position;
a mesh curved surface obtaining module 240, configured to perform voxel meshing on the multiple virtual particles to obtain a mesh curved surface of the virtual fluid;
a flow video obtaining module 250, configured to render the mesh curved surface, and obtain a flow video of the virtual fluid;
and the target special-effect video obtaining module 260 is configured to superimpose the streaming video and the original video to obtain a target special-effect video.
Optionally, the virtual force field determining module 220 is further configured to:
adding curved and/or polygonal objects in a three-dimensional space;
a virtual force field is generated based on curved and/or polygonal objects.
Optionally, the virtual force field determining module 220 is further configured to:
determining a starting point and an end point in a three-dimensional space;
generating a first initial curve between the starting point and the ending point;
and adding random noise to the first initial curve to obtain a first target curve.
Optionally, the virtual force field determining module 220 is further configured to:
if a human body is detected in the original video, detecting the motion track of the human body set bone key point in the three-dimensional space;
generating a second initial curve based on the motion trail;
and smoothing the second initial curve to obtain a second target curve.
Optionally, the virtual force field determining module 220 is further configured to:
for each point of the curve, a sphere with the set length as the radius by taking the current point as the center is used as the force field space of the current point;
and determining the tangential direction of the current point as the direction of the force field in the force field space to obtain a virtual force field.
Optionally, the virtual force field determining module 220 is further configured to:
and determining a virtual force field corresponding to the polygonal object based on the directed distance field SDF algorithm.
Optionally, the motion state determining module 230 is further configured to:
acquiring the motion state of each virtual particle of the virtual fluid at the previous moment;
and respectively carrying out fluid calculation on each virtual particle according to the virtual force field and the motion state at the previous moment to obtain the motion state of each virtual particle at the current moment.
Optionally, the streaming video obtaining module 250 is further configured to:
acquiring brightness information and color information of each pixel point;
and rendering each pixel point of the mesh curved surface based on the brightness information and the color information to obtain a flowing video of the virtual fluid.
The device can execute the methods provided by all the embodiments of the disclosure, and has corresponding functional modules and beneficial effects for executing the methods. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the disclosure.
Referring now to FIG. 5, a block diagram of an electronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like, or various forms of servers such as a stand-alone server or a server cluster. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, electronic device 300 may include a processing means (e.g., central processing unit, graphics processor, etc.) 301 that may perform various appropriate actions and processes in accordance with a program stored in a read-only memory device (ROM)302 or a program loaded from a storage device 305 into a random access memory device (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device 300 to communicate wirelessly or by wire with other devices to exchange data. While fig. 5 illustrates an electronic device 300 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be alternatively implemented or provided.
In particular, the processes described above with reference to the flow diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program containing program code for performing a method for recommending words. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 305, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can 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 electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: carrying out camera reverse solving on an original video to obtain a three-dimensional space corresponding to the original video; determining a virtual force field in the three-dimensional space; performing fluid calculation on the virtual fluid based on the virtual force field to obtain the motion state of the virtual fluid; wherein the virtual fluid is composed of a plurality of virtual particles; the motion state comprises motion speed, motion direction and position; carrying out voxel gridding on the plurality of virtual particles to obtain a grid curved surface of the virtual fluid; rendering the mesh curved surface to obtain a flowing video of the virtual fluid; and overlapping the flowing video and the original video to obtain a target special effect video.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, a method for generating a special effect video is disclosed in the present disclosure, including:
carrying out camera reverse solving on an original video to obtain a three-dimensional space corresponding to the original video;
determining a virtual force field in the three-dimensional space;
performing fluid calculation on the virtual fluid based on the virtual force field to obtain the motion state of the virtual fluid; wherein the virtual fluid is composed of a plurality of virtual particles; the motion state comprises motion speed, motion direction and position;
carrying out voxel gridding on the plurality of virtual particles to obtain a grid curved surface of the virtual fluid;
rendering the mesh curved surface to obtain a flowing video of the virtual fluid;
and overlapping the flowing video and the original video to obtain a target special effect video.
Further, determining a virtual force field in the three-dimensional space comprises:
adding curved and/or polygonal objects in the three-dimensional space;
generating a virtual force field based on the curved and/or polygonal object.
Further, adding a curve in the three-dimensional space includes:
determining a starting point and an end point in the three-dimensional space;
generating a first initial curve between the starting point and the ending point;
and adding random noise to the first initial curve to obtain a first target curve.
Further, adding a curve in the three-dimensional space includes:
if a human body is detected in the original video, detecting a motion track of the human body set bone key point in the three-dimensional space;
generating a second initial curve based on the motion trail;
and smoothing the second initial curve to obtain a second target curve.
Further, generating a virtual force field based on the curve, comprising:
for each point of the curve, a sphere with the set length as the radius by taking the current point as the center is taken as the force field space of the current point;
and determining the tangential direction of the current point as the direction of the force field in the force field space to obtain a virtual force field.
Further, generating a virtual force field based on the polygonal object, comprising:
and determining a virtual force field corresponding to the polygonal object based on a directed distance field (SDF) algorithm.
Further, performing fluid calculation on a virtual fluid based on the virtual force field to obtain a motion state of the virtual fluid, including:
acquiring the motion state of each virtual particle of the virtual fluid at the previous moment;
and respectively carrying out fluid calculation on each virtual particle according to the virtual force field and the motion state at the previous moment to obtain the motion state of each virtual particle at the current moment.
Further, rendering the mesh surface to obtain a flow video of the virtual fluid, including:
acquiring brightness information and color information of each pixel point;
and rendering each pixel point of the mesh curved surface based on the brightness information and the color information to obtain a flowing video of the virtual fluid.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will appreciate that the present disclosure is not limited to the particular embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the present disclosure. Therefore, although the present disclosure has been described in greater detail with reference to the above embodiments, the present disclosure is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present disclosure, the scope of which is determined by the scope of the appended claims.

Claims (11)

1. A method for generating a special effect video, comprising:
carrying out camera reverse solving on an original video to obtain a three-dimensional space corresponding to the original video;
determining a virtual force field in the three-dimensional space;
performing fluid calculation on the virtual fluid based on the virtual force field to obtain the motion state of the virtual fluid; wherein the virtual fluid is composed of a plurality of virtual particles; the motion state comprises motion speed, motion direction and position;
carrying out voxel gridding on the plurality of virtual particles to obtain a grid curved surface of the virtual fluid;
rendering the mesh curved surface to obtain a flowing video of the virtual fluid;
and overlapping the flowing video and the original video to obtain a target special effect video.
2. The method of claim 1, wherein determining the virtual force field in the three-dimensional space comprises:
adding curved and/or polygonal objects in the three-dimensional space;
generating a virtual force field based on the curved and/or polygonal object.
3. The method of claim 2, wherein adding curves in the three-dimensional space comprises:
determining a starting point and an end point in the three-dimensional space;
generating a first initial curve between the starting point and the ending point;
and adding random noise to the first initial curve to obtain a first target curve.
4. The method of claim 2, wherein adding curves in the three-dimensional space comprises:
if a human body is detected in the original video, detecting a motion track of a human body set skeleton key point in the three-dimensional space;
generating a second initial curve based on the motion trail;
and smoothing the second initial curve to obtain a second target curve.
5. The method of claim 2, wherein generating a virtual force field based on the curve comprises:
for each point of the curve, a sphere with the set length as the radius by taking the current point as the center is taken as the force field space of the current point;
and determining the tangential direction of the current point as the direction of the force field in the force field space to obtain a virtual force field.
6. The method of claim 2, wherein generating a virtual force field based on the polygonal object comprises:
and determining a virtual force field corresponding to the polygonal object based on a directed distance field (SDF) algorithm.
7. The method of claim 1, wherein performing a fluid solution on a virtual fluid based on the virtual force field to obtain a motion state of the virtual fluid comprises:
acquiring the motion state of each virtual particle of the virtual fluid at the previous moment;
and respectively carrying out fluid calculation on each virtual particle according to the virtual force field and the motion state at the previous moment to obtain the motion state of each virtual particle at the current moment.
8. The method of claim 1, wherein rendering the mesh surface to obtain a flow video of the virtual fluid comprises:
acquiring brightness information and color information of each pixel point;
and rendering each pixel point of the mesh curved surface based on the brightness information and the color information to obtain a flowing video of the virtual fluid.
9. An apparatus for generating a special effect video, comprising:
the three-dimensional space acquisition module is used for carrying out camera reverse solving on an original video to obtain a three-dimensional space corresponding to the original video;
a virtual force field determination module to determine a virtual force field in the three-dimensional space;
the motion state determination module is used for carrying out fluid calculation on the virtual fluid based on the virtual force field to obtain the motion state of the virtual fluid; wherein the virtual fluid is composed of a plurality of virtual particles; the motion state comprises motion speed, motion direction and position;
a mesh curved surface obtaining module, configured to perform voxel meshing on the multiple virtual particles to obtain a mesh curved surface of the virtual fluid;
the flow video acquisition module is used for rendering the mesh curved surface to acquire a flow video of the virtual fluid;
and the target special-effect video acquisition module is used for overlapping the flowing video and the original video to acquire a target special-effect video.
10. An electronic device, characterized in that the electronic device comprises:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the method of generating a special effects video of any of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, which program, when being executed by processing means, carries out the method of generating a special effects video according to any one of claims 1 to 8.
CN202210226270.9A 2022-03-09 2022-03-09 Method, device, equipment and storage medium for generating special effect video Active CN114598824B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210226270.9A CN114598824B (en) 2022-03-09 2022-03-09 Method, device, equipment and storage medium for generating special effect video

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210226270.9A CN114598824B (en) 2022-03-09 2022-03-09 Method, device, equipment and storage medium for generating special effect video

Publications (2)

Publication Number Publication Date
CN114598824A true CN114598824A (en) 2022-06-07
CN114598824B CN114598824B (en) 2024-03-19

Family

ID=81808110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210226270.9A Active CN114598824B (en) 2022-03-09 2022-03-09 Method, device, equipment and storage medium for generating special effect video

Country Status (1)

Country Link
CN (1) CN114598824B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024051756A1 (en) * 2022-09-08 2024-03-14 北京字跳网络技术有限公司 Special effect image drawing method and apparatus, device, and medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002092639A (en) * 2000-09-20 2002-03-29 Sony Corp Method and device for forming animation representing particle behavior
JP2002222434A (en) * 2001-01-29 2002-08-09 Namco Ltd Game system, program, and information storage medium
US20050253854A1 (en) * 2004-05-14 2005-11-17 Yissum Research Development Company Of The Hebrew University Of Jerusalem Method and system for performing computer graphic simulation of a fluid using target-driven control
JP2010029697A (en) * 2009-11-09 2010-02-12 Namco Bandai Games Inc Information storage medium and game apparatus
CN104899913A (en) * 2015-05-13 2015-09-09 中国科学院自动化研究所 Realistic fluid effect production method in virtual stage environment
US20170239574A1 (en) * 2016-02-24 2017-08-24 Capcom Co., Ltd. Non transitory computer-readable storage medium and method of controlling a computer
CN112308955A (en) * 2020-10-30 2021-02-02 北京字跳网络技术有限公司 Texture filling method, device and equipment based on image and storage medium
CN112598769A (en) * 2020-12-18 2021-04-02 北京达佳互联信息技术有限公司 Special effect rendering method and device, electronic equipment and computer readable storage medium
CN112929627A (en) * 2021-02-22 2021-06-08 广州博冠信息科技有限公司 Virtual reality scene implementation method and device, storage medium and electronic equipment
CN113516742A (en) * 2021-05-14 2021-10-19 网易(杭州)网络有限公司 Model special effect manufacturing method and device, storage medium and electronic equipment
CN113538696A (en) * 2021-07-20 2021-10-22 广州博冠信息科技有限公司 Special effect generation method and device, storage medium and electronic equipment
WO2022033444A1 (en) * 2020-08-10 2022-02-17 北京字节跳动网络技术有限公司 Dynamic fluid effect processing method and apparatus, and electronic device and readable medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002092639A (en) * 2000-09-20 2002-03-29 Sony Corp Method and device for forming animation representing particle behavior
JP2002222434A (en) * 2001-01-29 2002-08-09 Namco Ltd Game system, program, and information storage medium
US20050253854A1 (en) * 2004-05-14 2005-11-17 Yissum Research Development Company Of The Hebrew University Of Jerusalem Method and system for performing computer graphic simulation of a fluid using target-driven control
JP2010029697A (en) * 2009-11-09 2010-02-12 Namco Bandai Games Inc Information storage medium and game apparatus
CN104899913A (en) * 2015-05-13 2015-09-09 中国科学院自动化研究所 Realistic fluid effect production method in virtual stage environment
US20170239574A1 (en) * 2016-02-24 2017-08-24 Capcom Co., Ltd. Non transitory computer-readable storage medium and method of controlling a computer
WO2022033444A1 (en) * 2020-08-10 2022-02-17 北京字节跳动网络技术有限公司 Dynamic fluid effect processing method and apparatus, and electronic device and readable medium
CN112308955A (en) * 2020-10-30 2021-02-02 北京字跳网络技术有限公司 Texture filling method, device and equipment based on image and storage medium
CN112598769A (en) * 2020-12-18 2021-04-02 北京达佳互联信息技术有限公司 Special effect rendering method and device, electronic equipment and computer readable storage medium
CN112929627A (en) * 2021-02-22 2021-06-08 广州博冠信息科技有限公司 Virtual reality scene implementation method and device, storage medium and electronic equipment
CN113516742A (en) * 2021-05-14 2021-10-19 网易(杭州)网络有限公司 Model special effect manufacturing method and device, storage medium and electronic equipment
CN113538696A (en) * 2021-07-20 2021-10-22 广州博冠信息科技有限公司 Special effect generation method and device, storage medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024051756A1 (en) * 2022-09-08 2024-03-14 北京字跳网络技术有限公司 Special effect image drawing method and apparatus, device, and medium

Also Published As

Publication number Publication date
CN114598824B (en) 2024-03-19

Similar Documents

Publication Publication Date Title
CN112184738A (en) Image segmentation method, device, equipment and storage medium
CN110728622B (en) Fisheye image processing method, device, electronic equipment and computer readable medium
CN113411642A (en) Screen projection method and device, electronic equipment and storage medium
CN112351222B (en) Image special effect processing method and device, electronic equipment and computer readable storage medium
CN112965780B (en) Image display method, device, equipment and medium
CN112237739A (en) Game role rendering method and device, electronic equipment and computer readable medium
CN113055611A (en) Image processing method and device
WO2023125365A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN112348748A (en) Image special effect processing method and device, electronic equipment and computer readable storage medium
CN111246196B (en) Video processing method and device, electronic equipment and computer readable storage medium
CN115761090A (en) Special effect rendering method, device, equipment, computer readable storage medium and product
CN114598824B (en) Method, device, equipment and storage medium for generating special effect video
CN114170342A (en) Image processing method, device, equipment and storage medium
CN111862349A (en) Virtual brush implementation method and device and computer readable storage medium
CN111833459B (en) Image processing method and device, electronic equipment and storage medium
CN109816791B (en) Method and apparatus for generating information
CN114422698B (en) Video generation method, device, equipment and storage medium
CN114419298A (en) Virtual object generation method, device, equipment and storage medium
CN114332224A (en) Method, device and equipment for generating 3D target detection sample and storage medium
CN115272060A (en) Transition special effect diagram generation method, device, equipment and storage medium
CN111586295B (en) Image generation method and device and electronic equipment
CN114663553A (en) Special effect video generation method, device and equipment and storage medium
CN114723600A (en) Method, device, equipment, storage medium and program product for generating cosmetic special effect
CN112070903A (en) Virtual object display method and device, electronic equipment and computer storage medium
CN112492230A (en) Video processing method and device, readable medium 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