CN109461205A - A method of three-dimensional fireworks are rebuild from fireworks video - Google Patents

A method of three-dimensional fireworks are rebuild from fireworks video Download PDF

Info

Publication number
CN109461205A
CN109461205A CN201811146934.0A CN201811146934A CN109461205A CN 109461205 A CN109461205 A CN 109461205A CN 201811146934 A CN201811146934 A CN 201811146934A CN 109461205 A CN109461205 A CN 109461205A
Authority
CN
China
Prior art keywords
fireworks
firework
dimensional
particle
video
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.)
Pending
Application number
CN201811146934.0A
Other languages
Chinese (zh)
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.)
Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CN201811146934.0A priority Critical patent/CN109461205A/en
Publication of CN109461205A publication Critical patent/CN109461205A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects

Landscapes

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

Abstract

本发明涉及一种从烟花视频重建三维烟花的方法,包括以下步骤:构建一个三维的烟花渲染模型,该模型接受一定的参数作为输出,生成对应的三维烟花效果;构建一个随机化参数生成器,利用该模型生成一批视频作为训练集和验证集;从上述训练集和测试集中,利用神经网络去对视频的参数进行回归;利用上述的神经网络,对于给定的视频,学习相应参数并通过烟花渲染模型,得到重建结果。本发明借助目前深度学习的拟合能力,解决了由二维视频重建三维烟花效果的问题。

The invention relates to a method for reconstructing three-dimensional fireworks from fireworks videos, comprising the following steps: constructing a three-dimensional fireworks rendering model, the model accepts certain parameters as outputs, and generates corresponding three-dimensional fireworks effects; constructing a randomization parameter generator, Use this model to generate a batch of videos as training set and validation set; from the above training set and test set, use neural network to regress the parameters of the video; use the above neural network, for a given video, learn the corresponding parameters and pass Render the model of fireworks and get the reconstruction result. The present invention solves the problem of reconstructing three-dimensional fireworks effect from two-dimensional video by means of the fitting ability of current deep learning.

Description

A method of three-dimensional fireworks are rebuild from fireworks video
Technical field
The invention belongs to three-dimensional reconstruction fields, and in particular to a method of three-dimensional fireworks are rebuild from fireworks video.
Background technique
Three-dimensional grid model has obtained more and more extensive concern and application as an important carrier of three-dimensional media, Industrial manufacture, digital entertainment, Digital Cultural Heritage, intelligent city etc. played an important role.In recent years, with calculating The raising of machine processing capacity and the development of 3-D scanning technology and optical rehabilitation technology, the acquisition of three-dimensional grid model become more It is easy and quick to add.But usually there are various defects in the rough model initially obtained, be difficult to be directly used in various calculating, lead to It is often denoised, is repaired, the processing such as simplified and resampling is to meet application demand.
Aspect is arranged in current light source, and existing complex scene is essentially all artificially to remove setting light source.With acquisition The progress of equipment and geometrical Modeling Technology, three-dimensional scenic scale to be treated is increasing, and structure becomes increasingly complex, and light is arranged Source also increasingly wastes time.With the visible Deciding Algorithm of big quantity light source calculated based on constant time light-scene intersection For research, the recreation ground scene itself that we make has 1,200,000 triangle surfaces, several hundred a dynamic objects, 7600 light sources, And light source itself has 500,000 triangle surfaces.By tool as 3D max, 7600 light sources are arranged in fine arts personnel by hand The parameters such as position, color take the time more than two weeks, slightly adjust, and many light source positions and motion profile needs re-start Setting.So quickly, the algorithm for efficiently constructing light source true to nature is badly in need of research.
The technology that the simulation of current fireworks uses is particIe system.More than 20 years hairs are passed through in the research of particIe system Exhibition, is applied, Reeves W.T is put forward for the first time the concept of particIe system in nineteen eighty-three, and is simulated with it in all fields Flame, explosion and other effects, also successfully simulate film " Star Trek 2:The Wrath ofKhan)) in a series of spies Skill camera lens.1992, Loke et al. proposed the particIe system rendering algorithm of red-letter day fireworks, stored grain using linked list data structure Sub-information devises particIe system drawing engine (particle system rendering engine), derived from particle The track of method performance fireworks particle and the special-effect for realizing a variety of fireworks.ParticIe system by more than 20 years research with Development, forms many feasible algorithms and theory, application are also increasingly extensive.Tonnesen summarizes the work of forefathers, will ParticIe system is divided into independent particle system, has the particIe system of the particIe system and Dynamic Coupling that are fixedly connected these three types of.Wherein Independent particle system refers to that the power acted on particle is independent from each other, does not have influential particIe system to each other.Fireworks can To be simulated with independent particle system.
In terms of fireworks drafting, current fireworks model is all the explosion equation that fireworks are estimated according to priori knowledge, Then some parameters are artificially set, by adjusting repeatedly, so as to appear like natural fireworks the same for model;Also have one Part research is intended to improve the novel degree of fireworks pattern, shows the fireworks of the no special shape of nature, such as number Fireworks, or heart-shaped fireworks.Rarely having model is by reading in video, the transformation of analysis video the inside fireworks and presentation mode, so After reconstruct fireworks similar with video.Fireworks are rendered mostly using particIe system, but current method is all production One (multiple) basic particle cell, the physics law movement for then allowing these particle cells to go to explode according to fireworks.In this way The benefit done is simple, and draws speed and be exceedingly fast, and disadvantage is exactly that the result drawn and true fireworks have a certain distance, cigarette Colored particle not can be carried out any deformation, give a kind of false feeling of people.
Convolutional neural networks are widely used in image procossing, and CNN is used for Handwritten Digit Recognition earliest by Yann Lecun, and Obtain huge success.The difference of convolutional neural networks and general neural network is that convolutional neural networks contain one The feature extractor being made of convolutional layer and sub-sampling layer.In a convolutional layer of CNN, it is flat to generally comprise several features Face, each characteristic plane are made of the neuron of some rectangular arrangeds, and the neuron of same characteristic plane shares weight, here altogether The weight enjoyed is exactly convolution kernel.Convolution kernel initializes generally in the form of random decimal matrix, rolls up in the training process of network Study is obtained reasonable weight by product core.The shared direct benefit of weight (convolution kernel) bring is the company reduced between each layer of network It connects, while reducing the risk of over-fitting again.Sub-sampling is also referred to as pond, usually there is mean value sub-sampling and maximum value sub-sampling two Kind form.Sub-sampling is considered as a kind of special convolution process.Convolution sum sub-sampling enormously simplifies model complexity, reduces The parameter of model.
Recognition with Recurrent Neural Network is widely used in voice and video etc. and has in the information processing of temporal aspect.RNN is one The neural network that kind models sequence data, the i.e. output of a sequence current output and front are also related.Specific performance Form is that network can remember the information of front and be applied in the calculating currently exported, i.e., the node between hidden layer is not It is connectionless again but have connection, and not only the output including input layer further includes last moment hidden layer for the input of hidden layer Output.LSTM is a kind of type that RNN is special, is a kind of time recurrent neural network.The main distinction of it and RNN are it It joined " processor " judged whether information is useful in the algorithm, the structure of this processor effect is referred to as cell. It has been placed three fan doors in one cell, has been called input gate respectively, forgets door and out gate.One information enters the net of LSTM It, can be according to rule to determine whether useful in network.The information for only meeting algorithm certification can just leave, and the information not being inconsistent is then It is passed into silence by forgeing door.Therefore it can learn long-term Dependency Specification.It is suitable for being spaced and prolonging in processing and predicted time sequence Critical event relatively long late
Summary of the invention
The technical problem to be solved by the present invention is overcoming the insufficient defect of conventional method abstract ability, neural network is utilized Powerful nonlinear capability of fitting trains position feature of the deep learning model for the extraction fireworks from video, Color characteristic and motion feature, to render fireworks model similar with original video according to given fireworks video.This method The three-dimensional firework effect come is rendered, has very high similarity with original video.
The technical solution of present invention solution above-mentioned technical problem are as follows: a method of three-dimensional fireworks are rebuild from fireworks video, Include the following steps:
(1) rending model of the three-dimensional fireworks based on OPENGL and particIe system is constructed using particIe system, it is described Rending model receives the speed, acceleration in all directions of one group of expression three-dimensional fireworks, and three-dimensional fireworks color and size The parameter for changing over time situation renders three-dimensional fireworks;Construct the rending model of a three-dimensional fireworks based on particIe system, three After the rending model simulation fireworks explosion for tieing up fireworks, several fireworks particles scatter from explosion center.On the standard three-dimensional space right side Under hand coordinate system, it is assumed that be horizontally to the right y-axis, be straight up z-axis, in rending model, give three-dimensional fireworks section Fireworks number of particles calculate each section fireworks particle first according to the section of input (yz axial section) fireworks number of particles N With the angle theta in vertical direction (z-axis), horizontal plane (the xy axis under the angle is then obtained according to N2=sin (theta) Plane) number of particles N2, the angle gamma of each fireworks particle and y-axis is calculated according to N2, according to theta and gamma two The direction of fireworks particle is converted under spherical coordinate system by angle, and the final direction dir=(sin of particle is obtained after unitization (theta) * sin (gamma), cos (theta), sin (theta) * cos (gamma)) be fireworks particle direction.It is right later In each frame, the size and color of the ashes of the i-th frame generation are found out, is calculated on fireworks Particles Moving track by the method for interpolation The color and size of every bit;The rending model of the three-dimensional fireworks is with the centrifugation initial velocity of fireworks particle, acceleration;Three-dimensional fireworks The molecular particIe system of all grains initial velocity under external force and acceleration and fireworks particle color and size with Parameter of the attenuation ratio of time change as model.In order to obtain more true effect, the rending model joined several Random perturbation factor gives each fireworks including the initial velocity and acceleration one random coefficient of addition to each fireworks particle The color and size of particle also add a random coefficient, can thus make the position of the fireworks particle on different directions It sets, color and size slightly have difference, so that rendering effect is truer.
(2) parameter generators, speed, acceleration in random initializtion all directions, and three-dimensional fireworks are provided with Color and size change over time the parameter of situation, and generate several three-dimensional firework effects based on rending model in step (1), It is projected to along random angles and generates video in video camera, the video will generate corresponding three-dimensional as training set and verifying collection Label of the parameter of fuming effect as training data in training set constructs a neural network;A convolution mind is constructed first Through network (CNN) model, the model used here is the last softmax layer of removal and a full articulamentum is added InceptionV3 model.This model is the circle for being fitted an outer ring to each frame, that is, obtains the circle of the corresponding circle of each frame The heart and radius are as assisted tag.Implementation process for being fitted the circle of each frame of video is as follows: being divided using entirety-isolation method Video is analysed, since the centrifugal speed of fireworks particle is almost the same, so the outmost turns fireworks particle of each frame is approximate in video On a circle, therefore each frame fireworks of round approximate fits can be used.The center of circle of the circle represents all grains of three-dimensional fireworks The change in location situation of molecular particIe system, and radius represent each frame outer ring fireworks particle relative to whole system Center, i.e., with the position of the fireworks explosion center after whole system movement.The fireworks of some videos can be complete after a certain frame It totally disappeared mistake, for these videos, need all to be set to 0 without the assisted tag of the frame of any image, to improve the standard of training Exactness.Next one LSTM layers of building is as the relationship between Recognition with Recurrent Neural Network model analysis frame and frame, by above-mentioned convolution Full articulamentum before neural network model output layer is as input, the relationship being input between LSTM layer analysis frame and frame.Make The assisted tag for using above-mentioned CNN model to obtain can effectively reduce trained data volume as the training data of LSTM, improve Trained efficiency.For each video, conduct in entire neural network model is passed to using former frame and poor frame as input respectively Then two different branches are merged Liang Ge branch by a full articulamentum, the full articulamentum of the last layer is for returning Parameter required for step (1), each parameter construct the neural network model of a multi-task learning as a task. The loss function that entire neural network is used to return required parameter is defined as the mean square error function of Weight.By to data set Training, obtain a network.Give a video, the network can return out described in step 1 description fireworks each Speed, acceleration and fireworks color and size change over time the parameter of situation on a direction.
(3) using given video to be verified as input, nonlinear fitting point is carried out by step (2) neural network Analysis, obtain one group described in description flower speed, acceleration in all directions and fireworks color and size change over time Then the parameter of situation will arrive the three-dimensional after rebuilding in rending model described in the obtained parameter input step (1) Fireworks.
The principle of the present invention:
(1) video is analyzed using entirety-isolation method, it is every using circle approximate fits using each frame fireworks of circle approximate fits One frame fireworks.
With entirety-isolation method analysis fireworks flare system, as a whole, whole system has an initial velocity, also There is a downward acceleration of gravity, while other external force are influenced by wind-force etc.;And keep apart from the point of view of partially, particle from Explosion center is scattered with certain centrifugal speed and unique angle.Therefore each moment, the fireworks particle of outmost turns are all approximate Ground is present on a spherical surface, and projecting on video is on outmost turns particle is approximatively justified at one, it is possible to circle The situation of change in the center of circle is fitted the situation of change of entire fireworks particIe system position under the effect of external force, with round radius Change to be fitted the centrifugation situation of particle.
(2) it goes to return required parameter using neural network
It is difficult to reconstruct three-dimensional effect from the two-dimentional fireworks video at single visual angle using traditional method, does not also have at present There is any document there are associated solutions.And neural network has powerful nonlinear fitting ability, it can be from a large amount of data Learning law in collection and corresponding label, to establish the relationship of video Yu its parameter.Convolutional neural networks can be accurate and high Effect ground extracts the feature of picture, therefore selects convolutional neural networks to analyze each frame of video, fits each frame The corresponding center of circle and radius;The center of circle for using fitting and radius can significantly reduce data scale as intermediate result, from And accelerate training speed.Carry out the relationship between analysis frame using LSTM circulation layer later, to return out the corresponding parameter of video.
The advantages of present invention is compared with method before is: the present invention can be while ensuring quality quickly from giving Three-dimensional fireworks model is constructed in fixed fireworks video.The present invention mainly has a two o'clock contribution: first, utilize the round center of circle and radius Calculation amount is greatly reduced in the position for removing to represent each frame particle, accelerates calculating speed.Second, using neural network from number According to focusing study rule, carries out video and be fitted to nonlinearity in parameters.
Detailed description of the invention
Fig. 1 is the method for the present invention overall flow figure;
Fig. 2 is the algorithm that particle direction is calculated in the present invention;(a) algorithm pattern in direction is calculated;(b) direction is in spherical coordinate system Under schematic diagram;
Fig. 3 is the schematic diagram that fireworks particle tail method is sought in the present invention;(a) ash that the particle that each moment generates leaves Cinder schematic diagram, (b) effect diagram after interpolation;
Fig. 4 is that the frame differential of fireworks video in the present invention is intended to;(a) the i-th frame, (b) i+1 frame, (c) frame difference result;
Fig. 5 is the schematic diagram of fitting circle in the present invention;(a) frame original image fitting circle, (b) the poor frame fitting circle that frame difference method acquires
Fig. 6 is LSTM schematic network structure;
Fig. 7 is the firework effect figure after rebuilding in the present invention.
Specific embodiment
With reference to the accompanying drawing and a specific embodiment of the invention further illustrates the present invention.
For the algorithm for reconstructing of the three-dimensional fireworks, input of the invention is the fireworks video of a removal background, and entire Algorithm for reconstructing includes the following steps as shown in Figure 1:
Step (1) constructs a fireworks model using opengl, after model approximation simulation fireworks explosion, if dry granular Son scatters from explosion center.
With the flare system of entirety-isolation method analysis fireworks, as a whole, whole system has an approximation upward Initial velocity, there are one downward acceleration of gravity, while other external force are influenced by wind-force etc., have first in horizontal direction Velocity and acceleration;And keep apart from the point of view of partially, particle is from explosion center with certain centrifugal speed and unique angle It scatters, also there is approximately uniform centrifugation initial velocity and acceleration.And particle is during the motion, due to constantly burning, Size and color are all decaying in certain proportion.During the motion due to particle, ashes can be left to burn away, be embodied in It is visually exactly that fireworks can leave a tail.
In a model, the number of particles for giving fireworks section, as shown in Fig. 2 (a) and (b), first according to the section of input (yz axial section) fireworks number of particles N, calculates the angle theta in each section fireworks particle and vertical direction (z-axis), and i-th Then angle thetai=2 π/N*i of a section fireworks particle obtains the horizontal plane under the angle according to N2=sin (theta) The fireworks number of particles N2=max (N*sin (theta), 1) of (xy axial plane), calculates each fireworks particle and y-axis according to N2 Angle gamma, angle thetai=2 π/N2*i of i-th of section fireworks particle.According to two angles of theta and gamma, The direction of particle is converted under spherical coordinate system, the final direction dir=of unitization particle (sin (theta) * sin (gamma), Cos (theta), sin (theta) * cos (gamma)) be particle direction.2 (b) left figures illustrate section fireworks particle Direction, right figure illustrate after three-dimensional is converted to and seeks coordinate system, the direction of fireworks particle.It is calculated by the algorithm of Fig. 2 whole The number of particles of the molecular system of a all grains of fireworks and the direction of each particle.Assuming that present frame is i, for the i-th frame Each frame later finds out the size and color of the newly-generated ashes of the i-th frame, calculates Particles Moving track by the method for interpolation The color and size of upper every bit.
The ashes that Fig. 3 left figure (a) generates for some fireworks particle before interpolation in each frame, right figure (b) are interpolation Tail shape later, it can be seen that if intensive enough, after filling edge, so that it may for simulating various shape. The present invention is with the centrifugation initial velocity of fireworks particle, acceleration;The molecular particIe system of all grains of three-dimensional fireworks is in outer masterpiece Ginseng of the attenuation ratio that initial velocity and acceleration and fireworks particle color and size under change over time as model Number.
Step (2) acquires the newly-generated image of each frame using frame difference method, i.e., the fireworks particle after three-dimensional fireworks explosion exists The position that this frame moves to (b) is i+1 frame image, (c) is i+1 frame figure as shown in figure 4, (a) is the i-th frame image Result after picture and the i-th frame frames differencing.Regard entire fireworks particIe system as an entirety, under the effect of external force, this A entirety will move in the same way.Therefore, at any one moment, all fireworks particles can be similar in the same spherical surface On.This characteristics exhibit is exactly that the fireworks particle of outer ring is similar on the same circle on video.Round label can be by most First parameter is calculated.The image and original image obtained via these frame difference methods passes through convolutional neural networks model, structure respectively Build out two same structures but the neural network of different weights, fit respectively for characterize system motion situation and particle from The circle of heart motion conditions, the result fitted as shown in figure 5,5 (a) circles illustrated in 4 (b) situation above, 5 (b) The circle illustrated is in 4 (c) situation above.The convolutional neural networks model used in this step is removal end Softmax layers and add full articulamentum inceptionV3 network.The fireworks of some videos can disappear completely after a certain frame It loses, for these videos, needs all to be set to 0 without the assisted tag of the frame of any image, to improve the accuracy of training.
Image after original image and frame difference is passed through each frame of all videos in step (2) by step (3) respectively Convolutional neural networks model is acquired, corresponding circle is calculated, using the center of circle of the circle and radius as intermediate result, is participated in next step Training.Use intermediate result obtained above as the training data of next step, can effectively reduce trained data volume, Improve the efficiency of training.
The intermediate result that step (4) obtains step (3) will own with the relationship between LSTM layer analysis frame and frame Parameter to be asked carries out multitask recurrence as label, by neural network.Loss function is defined as the mean square error letter of weighting Number, after wherein the size of weight is according to the certain round of training, the error of each parameter is adjusted: error is bigger, then weight It is higher.In addition to this, as shown in fig. 6, each frame of original video is passed through mutually isostructural mould with the poor frame that frame difference obtains respectively Type.The bottom ConvNet of each model is exactly the inceptionV3 model to frame fit characteristic circle, and the model is by each frame Characteristic circle is extracted, to reduce the scale of input, freezen layer indicates that this layer is trained in advance, then connects down Carry out its parameter in the training process of upper layer lstm and full articulamentum to remain unchanged.Then the pass between analysis frame is gone to by LSTM layers System.Each submodel does a prediction using a full articulamentum (Dense), as supplemental training task.Two submodels By fused layer (Fusion Layer) connection connected entirely, chief training officer is gone to be engaged in.The label of subtask and main task is step Suddenly parameter required for fireworks rending model in (1).By the way that supplemental training task is added, and two tasks are closed with full articulamentum And such Recognition with Recurrent Neural Network is the fitting for carrying out each autoregressive parameter, and the full articulamentum for merging task is for carrying out pair The error correction of frame difference image and original image regression result.
Step (5) obtains intermediate result by step (3), then pass through step using given video to be verified as input (4) neural network model obtains one group of parameter after returning.By this group of parameter, it is passed to three-dimensional rendering described in step (1) The three-dimensional firework effect after rebuilding has been arrived in model.
The software platform that realization of the invention uses are as follows: (1) platform that three-dimensional rendering model uses is Microsoft Visual studio 2013 and OpenGL has used CUDA to accelerate the computational efficiency of parallel algorithm;(2) neural network model The platform used is JetBrains PyCharm 2018.1.2 and TensorFlow.Hardware platform is 4.0GHz Inter (R) Core (TM) i7-7700 CPU, 8GB memory and NVIDIA GeForce GTX1060 GPU.Method effect picture such as Fig. 7 institute Show.It is directed to three different videos in Fig. 7, illustrates two different angles of reconstructed results.The training set of this method has 10000 videos, cross validation collection have 2000 videos, train convolutional neural networks time-consuming about 1 week for being fitted middle circle, By all training videos via trained convolutional neural networks generate middle circle the center of circle and radius time-consuming about 22 hours, by Intermediate result training Recognition with Recurrent Neural Network is fitted about 14 hours of the corresponding parameter time-consuming of video, by the parameter that generates via cigarette Flower rending model, the three-dimensional firework effect of rendering one for 4 seconds are 4 seconds time-consuming.
Above embodiments are provided just for the sake of the description purpose of the present invention, and are not intended to limit the scope of the invention.This The range of invention is defined by the following claims.It does not depart from spirit and principles of the present invention and the various equivalent replacements made and repairs Change, should all cover within the scope of the present invention.

Claims (5)

1.一种从烟花视频重建三维烟花的方法,其特征在于:包括以下步骤:1. a method for reconstructing three-dimensional fireworks from fireworks video, is characterized in that: comprise the following steps: (1)利用粒子系统构建一个基于OPENGL和粒子系统的三维烟花的渲染模型,所述渲染模型接受一组表示三维烟花的在各个方向上速度、加速度,以及三维烟花颜色和尺寸随时间变化情况的参数,渲染出三维烟花;(1) Use the particle system to build a 3D firework rendering model based on OPENGL and the particle system. The rendering model accepts a set of 3D fireworks velocity and acceleration in all directions, as well as the color and size of the 3D fireworks change with time. parameters to render three-dimensional fireworks; (2)设置了一个参数生成器,随机初始化各个方向上速度、加速度,以及三维烟花颜色和尺寸随时间变化情况的参数,并基于步骤(1)中渲染模型生成若干个三维烟花效果,沿随机角度投影到摄像机内生成视频,所述视频作为训练集和验证集,将生成对应的三维烟化效果的参数作为训练集中训练数据的标签,构建神经网络;神经网络用于回归所需参数的损失函数定义为带权重的均方误差函数;通过对数据集的训练,得到一个训练好的神经网络;给定一个视频,该训练好的神经网络回归出步骤(1)中所述的描述三维烟花的在各个方向上速度、加速度,以及烟花颜色和尺寸随时间变化情况的参数;(2) A parameter generator is set up to randomly initialize the parameters of the speed, acceleration in all directions, and the time-dependent changes of the color and size of the three-dimensional fireworks, and generate several three-dimensional fireworks effects based on the rendering model in step (1). The angle is projected into the camera to generate a video, the video is used as a training set and a verification set, and the parameters that generate the corresponding 3D smoke effect are used as the label of the training data in the training set, and a neural network is constructed; the neural network is used to return the loss of the required parameters The function is defined as a weighted mean square error function; a trained neural network is obtained by training the dataset; given a video, the trained neural network returns the description of the three-dimensional fireworks described in step (1). parameters of velocity, acceleration, and firework color and size over time in all directions; 所述神经网络构建如下:首先构建一个卷积神经网络模型CNN,用来对每一帧拟合一个外圈的圆,即获取每一帧对应圆的圆心和半径作为辅助标签,有些视频的烟花会在某一帧之后完全消失,对于这些视频,将没有任何图像的帧的辅助标签全部置为0,以提高训练的准确度;所述CNN为去除最后的softmax层并加入一个全连接层的inceptionV3模型,作为卷积神经网络模型;然后构建一个LSTM层,作为循环神经网络模型,分析帧与帧之间的关系,将所述卷积神经网络模型输出层前面的全连接层作为输入,输入到LSTM层分析帧与帧之间的关系,使用上述CNN模型得到的辅助标签作为LSTM的训练数据,有效的减少训练的数据量,提高训练的效率;The neural network is constructed as follows: first, a convolutional neural network model CNN is constructed to fit an outer circle to each frame, that is, the center and radius of the corresponding circle in each frame are obtained as auxiliary labels. It will disappear completely after a certain frame. For these videos, the auxiliary labels of the frames without any images are all set to 0 to improve the accuracy of training; the CNN is to remove the last softmax layer and add a fully connected layer. The inceptionV3 model is used as a convolutional neural network model; then an LSTM layer is constructed as a recurrent neural network model to analyze the relationship between frames, and the fully connected layer in front of the output layer of the convolutional neural network model is used as input. Go to the LSTM layer to analyze the relationship between frames, and use the auxiliary labels obtained by the above CNN model as the training data of LSTM, which can effectively reduce the amount of training data and improve the efficiency of training; 对于每一个视频,分别将原帧和差帧作为输入传入整个神经网络模型中作为两个不同的分支,然后通过一个全连接层将两个分支后合并,最后一层的全连接层,用于回归步骤(1)所述的参数,每个参数作为一个任务,构建出一个多任务学习(Multi-task Learning)的神经网络模型多任务的神经网络;For each video, the original frame and the difference frame are passed as input to the entire neural network model as two different branches, and then the two branches are merged through a fully connected layer, and the last fully connected layer is used. Regarding the parameters described in the regression step (1), each parameter is used as a task to construct a multi-task neural network model of a multi-task learning (Multi-task Learning) neural network; (3)将给定的待验证视频作为输入,通过步骤(2)所述神经网络进行非线性拟合,得出一组所述的描述花的在各个方向上速度、加速度,以及烟花颜色和尺寸随时间变化情况的参数,然后将得到的所述参数输入步骤(1)所述的渲染模型中,即得到重建后的三维烟花。(3) The given video to be verified is used as input, and the neural network in step (2) is used for nonlinear fitting to obtain a set of described flower speeds, accelerations, and fireworks colors and colors in all directions. The parameters of the size change over time are input into the rendering model described in step (1), that is, the reconstructed three-dimensional fireworks are obtained. 2.根据权利要求1所述的一种从烟花视频重建三维烟花的方法,其特征在于:所述步骤(1)具体实现如下:2. a kind of method for reconstructing three-dimensional fireworks from fireworks video according to claim 1, is characterized in that: described step (1) is specifically realized as follows: 基于粒子系统构建一个三维烟花的渲染模型,三维烟花的渲染模型模拟烟花爆炸之后,若干粒子从爆炸中心散开;在渲染模型中,给定烟花切面的烟花粒子数量,计算整个粒子系统的烟花粒子数量以及每个烟花粒子的方向;之后对于每一帧,求出第i帧生成的灰烬的尺寸和颜色,通过插值的方法计算粒子运动轨迹上每一点的颜色和尺寸;该三维烟花的渲染模型以烟花粒子的离心初速度,加速度;三维烟花的所有粒子组成的粒子系统在外力作用下的初速度和加速度,以及烟花粒子颜色和尺寸随时间变化的衰减比率作为三维烟花的渲染模型的参数。A 3D firework rendering model is constructed based on the particle system. The 3D firework rendering model simulates that after the firework explodes, several particles are scattered from the center of the explosion; in the rendering model, given the number of firework particles on the firework section, the firework particles of the entire particle system are calculated. The number and the direction of each firework particle; then for each frame, the size and color of the ash generated in the i-th frame are calculated, and the color and size of each point on the particle trajectory are calculated by interpolation; the rendering model of the three-dimensional firework Take the centrifugal initial velocity and acceleration of firework particles; the initial velocity and acceleration of the particle system composed of all particles of 3D firework under the action of external force, and the decay ratio of the color and size of firework particles with time as the parameters of the rendering model of 3D firework. 3.根据权利要求2所述的一种从烟花视频重建三维烟花的方法,其特征在于:所述计算三维烟花的所有粒子组成的粒子系统的烟花粒子数量以及每个烟花粒子的方向的方法如下:3. a kind of method for reconstructing three-dimensional fireworks from firework video according to claim 2, it is characterized in that: the method for the number of firework particles and the direction of each firework particle in the particle system that all particles of the three-dimensional firework are formed of are as follows: : 在标准三维空间右手坐标系下,水平向右的为y轴,竖直向上的为z轴,首先根据输入的切面,即yz轴切面的烟花粒子数量N,计算每个切面烟花粒子与竖直方向即z轴上的夹角theta,然后根据N2=sin(theta)得出该夹角下的水平面即xy轴平面的烟花粒子数量N2,根据N2计算出每个烟花粒子与y轴的夹角gamma,根据theta和gamma两个夹角,将烟花粒子的方向换算到球坐标系,单体化后得到最终烟花粒子的方向dir=(sin(theta)*sin(gamma),cos(theta),sin(theta)*cos(gamma))即为烟花粒子的方向。In the standard three-dimensional space right-handed coordinate system, the horizontal right is the y-axis, and the vertical upward is the z-axis. First, according to the input section, that is, the number N of firework particles in the yz-axis section, calculate the relationship between the vertical and horizontal firework particles of each section. The direction is the angle theta on the z-axis, and then according to N2=sin(theta), the horizontal plane under the angle is the number N2 of firework particles on the xy-axis plane, and the angle between each firework particle and the y-axis is calculated according to N2 gamma, according to the two angles of theta and gamma, convert the direction of the firework particle to the spherical coordinate system, and obtain the final direction of the firework particle after singulation dir=(sin(theta)*sin(gamma),cos(theta), sin(theta)*cos(gamma)) is the direction of the firework particles. 4.根据权利要求1或2所述的一种从烟花视频重建三维烟花的方法,其特征在于:所述步骤(1)中,为了获取更真实的效果,渲染模型加入了若干随机扰动因素,所述随机扰动因素包括给每个烟花粒子的初速度和加速度加入一个随机的系数,给每个烟花粒子的颜色和尺寸也加上一个随机的系数,使得不同方向上的烟花粒子的位置,颜色和尺寸略有差异,使得渲染效果更加真实。4. a kind of method for reconstructing three-dimensional fireworks from fireworks video according to claim 1 and 2, is characterized in that: in described step (1), in order to obtain more realistic effect, rendering model has added some random disturbance factors, The random disturbance factors include adding a random coefficient to the initial velocity and acceleration of each firework particle, and adding a random coefficient to the color and size of each firework particle, so that the positions and colors of the firework particles in different directions are added. And the size is slightly different, making the rendering more realistic. 5.根据权利要求1所述的一种从烟花视频重建三维烟花的方法,其特征在于:所述步骤(2)中,卷积神经网络模型对视频每一帧拟合圆的过程如下:利用整体-隔离法来分析视频,烟花粒子的离心速度一致,视频中每一帧的最外圈烟花粒子近似的在一个圆上,使用圆近似拟合每一帧烟花,圆心代表了三维烟花的所有粒子组成的粒子系统的位置变化情况,半径代表了每一帧外圈烟花粒子的相对于整个系统中心,即随着三维烟花的所有粒子组成的粒子系统移动后的烟花爆炸中心的位置。5. a kind of method for reconstructing three-dimensional fireworks from fireworks video according to claim 1, is characterized in that: in described step (2), the process of convolutional neural network model fitting circle to each frame of video is as follows: using The whole-isolation method is used to analyze the video. The centrifugal speed of the firework particles is the same. The outermost firework particles of each frame in the video are approximately on a circle. The circle is used to approximate each frame of fireworks, and the center of the circle represents all the three-dimensional fireworks. The position change of the particle system composed of particles, the radius represents the position of the firework particle in each frame relative to the center of the entire system, that is, the position of the firework explosion center after the particle system composed of all particles of the 3D firework moves.
CN201811146934.0A 2018-09-29 2018-09-29 A method of three-dimensional fireworks are rebuild from fireworks video Pending CN109461205A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811146934.0A CN109461205A (en) 2018-09-29 2018-09-29 A method of three-dimensional fireworks are rebuild from fireworks video

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811146934.0A CN109461205A (en) 2018-09-29 2018-09-29 A method of three-dimensional fireworks are rebuild from fireworks video

Publications (1)

Publication Number Publication Date
CN109461205A true CN109461205A (en) 2019-03-12

Family

ID=65607197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811146934.0A Pending CN109461205A (en) 2018-09-29 2018-09-29 A method of three-dimensional fireworks are rebuild from fireworks video

Country Status (1)

Country Link
CN (1) CN109461205A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993836A (en) * 2019-03-18 2019-07-09 浙江大学 A method to realize the controllable shape of virtual reality 3D fireworks
CN110163982A (en) * 2019-04-11 2019-08-23 浙江大学 A kind of virtual fireworks analogy method of immersion based on Sketch Searching and controlled shape
CN110619677A (en) * 2019-08-12 2019-12-27 浙江大学 Particle reconstruction method and device in three-dimensional flow field, electronic device and storage medium
GB2585078A (en) * 2019-06-28 2020-12-30 Sony Interactive Entertainment Inc Content generation system and method
CN112529997A (en) * 2020-12-28 2021-03-19 北京字跳网络技术有限公司 Firework visual effect generation method, video generation method and electronic equipment
CN112700517A (en) * 2020-12-28 2021-04-23 北京字跳网络技术有限公司 Method for generating visual effect of fireworks, electronic equipment and storage medium
WO2023134267A1 (en) * 2022-01-17 2023-07-20 腾讯科技(深圳)有限公司 Data processing method, apparatus and device, computer readable storage medium and computer program product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2667538A1 (en) * 2006-10-27 2008-05-02 Thomson Licensing System and method for recovering three-dimensional particle systems from two-dimensional images
CN107211100A (en) * 2014-12-29 2017-09-26 诺基亚技术有限公司 Method, device and computer program product for the motion deblurring of image
CN107392097A (en) * 2017-06-15 2017-11-24 中山大学 A kind of 3 D human body intra-articular irrigation method of monocular color video

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2667538A1 (en) * 2006-10-27 2008-05-02 Thomson Licensing System and method for recovering three-dimensional particle systems from two-dimensional images
CN107211100A (en) * 2014-12-29 2017-09-26 诺基亚技术有限公司 Method, device and computer program product for the motion deblurring of image
CN107392097A (en) * 2017-06-15 2017-11-24 中山大学 A kind of 3 D human body intra-articular irrigation method of monocular color video

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHIHONG WANG 等: "《3D Firework Reconstruction from a Given Videos》", 《INTERNATIONAL JOURNAL OF INFORMATION AND COMMUNICATION SCIENCES》 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993836B (en) * 2019-03-18 2020-11-17 浙江大学 Method for realizing controllable shape of virtual reality three-dimensional firework
CN109993836A (en) * 2019-03-18 2019-07-09 浙江大学 A method to realize the controllable shape of virtual reality 3D fireworks
CN110163982A (en) * 2019-04-11 2019-08-23 浙江大学 A kind of virtual fireworks analogy method of immersion based on Sketch Searching and controlled shape
GB2585078B (en) * 2019-06-28 2023-08-09 Sony Interactive Entertainment Inc Content generation system and method
GB2585078A (en) * 2019-06-28 2020-12-30 Sony Interactive Entertainment Inc Content generation system and method
US11328488B2 (en) 2019-06-28 2022-05-10 Sony Interactive Entertainment Inc. Content generation system and method
CN110619677A (en) * 2019-08-12 2019-12-27 浙江大学 Particle reconstruction method and device in three-dimensional flow field, electronic device and storage medium
CN110619677B (en) * 2019-08-12 2023-10-31 浙江大学 Particle reconstruction method and device, electronic equipment and storage medium in three-dimensional flow field
CN112700517A (en) * 2020-12-28 2021-04-23 北京字跳网络技术有限公司 Method for generating visual effect of fireworks, electronic equipment and storage medium
CN112529997B (en) * 2020-12-28 2022-08-09 北京字跳网络技术有限公司 Firework visual effect generation method, video generation method and electronic equipment
CN112700517B (en) * 2020-12-28 2022-10-25 北京字跳网络技术有限公司 Method for generating visual effect of fireworks, electronic equipment and storage medium
WO2022142869A1 (en) * 2020-12-28 2022-07-07 北京字跳网络技术有限公司 Method for generating firework visual effect, video generation method, and electronic device
CN112529997A (en) * 2020-12-28 2021-03-19 北京字跳网络技术有限公司 Firework visual effect generation method, video generation method and electronic equipment
EP4250125A4 (en) * 2020-12-28 2024-06-12 Beijing Zitiao Network Technology Co., Ltd. METHOD FOR GENERATING A VISUAL FIREWORKS EFFECT, ELECTRONIC DEVICE AND STORAGE MEDIUM
WO2023134267A1 (en) * 2022-01-17 2023-07-20 腾讯科技(深圳)有限公司 Data processing method, apparatus and device, computer readable storage medium and computer program product

Similar Documents

Publication Publication Date Title
CN109461205A (en) A method of three-dimensional fireworks are rebuild from fireworks video
US11741668B2 (en) Template based generation of 3D object meshes from 2D images
Tian et al. Training and testing object detectors with virtual images
Paulin et al. Review and analysis of synthetic dataset generation methods and techniques for application in computer vision
CN101271469B (en) Two-dimension image recognition based on three-dimensional model warehouse and object reconstruction method
US20220068007A1 (en) 3d asset generation from 2d images
CN109255831A (en) The method that single-view face three-dimensional reconstruction and texture based on multi-task learning generate
CN108984169B (en) Cross-platform multi-element integrated development system
KR101964282B1 (en) 2d image data generation system using of 3d model, and thereof method
WO2015149302A1 (en) Method for rebuilding tree model on the basis of point cloud and data driving
Liu et al. Real-time neural rasterization for large scenes
Wang et al. Construction of a virtual reality platform for UAV deep learning
Bird et al. From simulation to reality: CNN transfer learning for scene classification
Zhou et al. Deeptree: Modeling trees with situated latents
Rao et al. Comparing 3D rendering engines in blender
Di Paola et al. A gaming approach for cultural heritage knowledge and dissemination
CN117689837A (en) Small celestial body intelligent three-dimensional reconstruction method based on texture model and noise point cloud cleaning
CN115984443A (en) A simulation method of space satellite target image based on visible light camera
Zhou et al. Visual restoration of ocean wave effects produced by Houdini in the engine
Rahman Using generative adversarial networks for content generation in games
Nunes Procedural generation of synthetic forest environments to train machine learning algorithms
Queiroz et al. Generating facial ground truth with synthetic faces
Zamri et al. Research on atmospheric clouds: a review of cloud animation methods in computer graphics
Wang Collaborated machine learning-based design solution to conceptual design of architecture
Zhang et al. A realistic AI avatar generation method combining GAN, unity and kinect techniques

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190312