Method, device, equipment and storage medium for generating video image frames

By generating and synthesizing depth map feature tensors of image frames, the accuracy problem of the optical flow method in distinguishing camera motion and scene flow is solved, achieving accurate image frame prediction in dynamic scenes and reducing the amount of rendering calculations.

CN115734005BActive Publication Date: 2024-10-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110988978.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-26
Publication Date
2024-10-15
Estimated Expiration
2041-08-26

AI Technical Summary

Technical Problem

When using a mobile camera to record dynamic scenes, the optical flow method is difficult to accurately distinguish between camera motion and scene flow, resulting in inaccurate motion estimation, which in turn affects the prediction effect of image frames.

Method used

By obtaining the depth map of the image frame to be synthesized and the depth maps of the previous N processed image frames, a feature tensor is generated and synthesized to obtain an accurate synthesized image frame, avoiding the limitations of the optical flow method.

Benefits of technology

This method can accurately synthesize image frames under moving cameras and dynamic scenes, improve the accuracy of image frame prediction, reduce the calculation amount of image rendering, and is suitable for improving video resolution and reducing the frame rate required for rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115734005B_ABST
    Figure CN115734005B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment and storage medium for generating video image frames, including: obtaining a depth map of an image frame to be synthesized, N processed image frames and depth maps of each of the N processed image frames, wherein the N processed image frames are N rendered or synthesized image frames before the image frame to be synthesized in the video, and N is a positive integer; generating a feature tensor of the image frame to be synthesized according to the depth map of the image frame to be synthesized, the N processed image frames and the depth maps of each of the N processed image frames; synthesizing the depth map of the image frame to be synthesized, the N processed image frames and the feature tensors of the image frame to be synthesized to obtain a synthesized image frame corresponding to the image frame to be synthesized. Thus, the synthesized image frame corresponding to the image frame to be synthesized can be accurately synthesized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to artificial intelligence (AI) technology, and in particular to a method, device, equipment and storage medium for generating video image frames. Background Art

[0002] A video is composed of multiple image frame sequences. Since the content correlation between adjacent image frames is high, that is, the same moving object often exists continuously in two or three adjacent image frames, and the background area between adjacent image frames is likely to be homogeneous. Therefore, motion estimation and motion compensation can be performed on the processed image frames to predict the current image frame, and the optical flow method is often used for motion estimation to predict the current image frame.

[0003] If two image frames are given, the motion vector of each pixel can be calculated by the optical flow method, that is, the motion information from one image frame to another can be obtained. However, when a mobile camera is used to record a dynamic scene, the resulting image frame sequence usually contains a mixture of two types of motion: one is the movement of the camera, and the other is the 3D (Dimension, D) scene flow. At this time, the relative motion of the 2D image plane described by the optical flow contains both types of motion. However, the motion vector obtained by the optical flow method cannot distinguish between camera motion and scene flow well, resulting in inaccurate motion estimation, and thus the current image frame predicted is also inaccurate. Summary of the invention

[0004] The present application provides a method, device, equipment and storage medium for generating a video image frame, so as to accurately synthesize a synthesized image frame corresponding to an image frame to be synthesized.

[0005] In a first aspect, a method for generating a video image frame is provided, comprising: obtaining a depth map of an image frame to be synthesized, N processed image frames, and depth maps of each of the N processed image frames, where the N processed image frames are N rendered or synthesized image frames before the image frame to be synthesized in the video, and N is a positive integer; generating a feature tensor of the image frame to be synthesized according to the depth map of the image frame to be synthesized, the N processed image frames, and the depth maps of each of the N processed image frames; synthesizing the depth map of the image frame to be synthesized, the N processed image frames, and the feature tensors of the image frame to be synthesized to obtain a synthesized image frame corresponding to the image frame to be synthesized.

[0006] In a second aspect, a device for processing video image frames is provided, comprising: an acquisition module, a generation module and a synthesis module, wherein the acquisition module is used to acquire a depth map of an image frame to be synthesized, N processed image frames and depth maps of each of the N processed image frames, the N processed image frames are N rendered or synthesized image frames before the image frame to be synthesized in the video, and N is a positive integer; the generation module is used to generate a feature tensor of the image frame to be synthesized according to the depth map of the image frame to be synthesized, the N processed image frames and the depth maps of each of the N processed image frames; the synthesis module is used to synthesize the depth map of the image frame to be synthesized, the N processed image frames and the feature tensors of the image frame to be synthesized, so as to obtain a synthesized image frame corresponding to the image frame to be synthesized.

[0007] According to a third aspect, an electronic device is provided, comprising: a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect or its various implementations.

[0008] According to a fourth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method according to the first aspect or its various implementations.

[0009] According to a fifth aspect, a computer program product is provided, comprising computer program instructions, wherein the computer program instructions enable a computer to execute the method according to the first aspect or its various implementations.

[0010] According to a sixth aspect, a computer program is provided, which enables a computer to execute the method according to the first aspect or its various implementations.

[0011] In the present application, the electronic device can generate a feature tensor of the image frame to be synthesized based on the depth map of the image frame to be synthesized, N processed image frames and the depth maps of each of the N processed image frames; synthesize the depth map of the image frame to be synthesized, the N processed image frames and the feature tensor of the image frame to be synthesized to obtain a synthesized image frame corresponding to the image frame to be synthesized. This method is not affected by the video shooting scene, and thus can accurately synthesize the synthesized image frame corresponding to the image frame to be synthesized.

[0012] From another perspective, in the prior art, the server needs to render each image frame and send the rendered image frame to the terminal device so that the terminal device can present each image frame. However, through the technical solution provided by the present application, the server can synthesize the synthesized image frame corresponding to the image frame to be synthesized based on N processed image frames, their depth maps and the depth map of the image frame to be synthesized, without rendering the image frame, so that the image frame can be rendered at a lower frame rate, thereby reducing the amount of computation brought by image rendering. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 An application scenario diagram provided for an embodiment of the present application;

[0015] Figure 2 A flowchart of a method for generating a video image frame provided in an embodiment of the present application;

[0016] Figure 3 A schematic diagram of generating a synthesized image frame corresponding to an image frame to be synthesized provided in an embodiment of the present application;

[0017] Figure 4 A schematic diagram of another method of generating a synthesized image frame corresponding to an image frame to be synthesized provided in an embodiment of the present application;

[0018] Figure 5 A schematic diagram of a video image frame processing device provided in an embodiment of the present application;

[0019] Figure 6 It is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0022] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0023] Computer vision technology (Computer Vision, CV) is a science that studies how to make machines "see". To put it more specifically, it refers to the use of cameras and computers to replace human eyes to identify, track and measure targets, and further perform graphic processing to make computer processing into images that are more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multidimensional data. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (Optical Character Recognition, OCR), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and mapping, automatic driving, smart transportation and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition. This application mainly involves image processing technology in artificial intelligence, specifically image frame prediction.

[0024] As mentioned above, optical flow is often used for motion estimation to predict the current image frame.

[0025] Optical flow describes the changes caused by the movement of spatial objects on the 2D visual plane. This change is based on pixel granularity. Therefore, motion estimation using optical flow calculation can grasp motion information at the pixel level. The optical flow field between adjacent image frames is the set of optical flow vectors between matching pixels in two image frames. Assuming that the movement of pixels in the image over time is smooth, the optical flow of matching pixels between the first two frames can be extrapolated to approximately simulate the optical flow between the pixels of the previous frame and the pixels of the current frame. The smooth motion assumption and the simulated extrapolation of optical flow make it possible to perform motion compensation based on this. Therefore, image frame prediction based on optical flow, that is, frame extrapolation technology, can obtain the optical flow field by calculating the displacement of all pixels in the video between adjacent image frames, thereby performing motion compensation on the basis of the processed frames and completing the prediction of the current image frame. As mentioned above, when a mobile camera is used to record a dynamic scene, the motion vector obtained by the optical flow method cannot distinguish between camera motion and scene flow well, resulting in inaccurate motion estimation, and thus the current image frame predicted is also inaccurate. In addition, when using the optical flow method for motion estimation, artifacts caused by object occlusion are often encountered, resulting in inaccurate motion estimation, and thus inaccurate prediction of the current image frame. Rapid object movement can also lead to errors in optical flow calculation, and thus inaccurate prediction of the current image frame.

[0026] In order to solve the above technical problems, the present application does not use the optical flow method to predict the current image frame, but synthesizes the current image frame through the image frames between the current image frames, the depth maps of these image frames and the depth map of the current image frame. This method is not affected by the video shooting scene and can accurately obtain the current image frame.

[0027] It should be understood that the technical solution of the present application can be applied to any image frame prediction scenario. The following is an exemplary description of the application scenario of the present application:

[0028] Example 1: A terminal device with shooting and image processing functions can shoot objects, but the video resolution shot by the terminal device is low. The terminal device can adopt the technical solution provided in this application to predict image frames and perform frame interpolation technology to improve the video resolution.

[0029] Example 2: Figure 1 An application scenario diagram provided for an embodiment of the present application, such as Figure 1 As shown, the terminal device 110 can communicate with the server 120, wherein the terminal device 110 has a specific shooting function and can transmit the shot video to the server 120, wherein the video shot by the terminal device has a low resolution, and the server 120 has an image processing function, that is, the technical solution provided in the present application can be used to predict image frames to perform frame extrapolation technology, thereby improving the video resolution.

[0030] In some possible implementations, Figure 1 The application scenarios shown may also include: base stations, core network side equipment, etc. In addition, Figure 1 One terminal device and one server are shown as an example, but other numbers of terminal devices and servers may actually be included, and this application does not impose any limitation on this.

[0031] Example 3: This application also provides an application scenario of image rendering in a video, such as Figure 1 As shown, the server 120 may have an image processing function, that is, the technical solution provided in the present application may be used to predict image frames, thereby eliminating the need to render some image frames, and sending each image frame to the terminal device 110 so that the terminal device 110 presents these image frames.

[0032] For example, in the field of gaming, the server 120 may be a server corresponding to a gaming application (Application, APP), and the terminal device 110 may be a gaming terminal, such as a mobile phone, computer, tablet or other gaming terminal, etc. This application does not impose any restrictions on this.

[0033] In some possible implementations, Figure 1 The server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services, which is not limited in the present application.

[0034] The technical solution of this application will be described in detail below:

[0035] Figure 2 A flowchart of a method for generating a video image frame provided in an embodiment of the present application, the method can be executed by an electronic device, the electronic device can be the terminal device in the above example 1, or the server in example 2 or example 3, but is not limited thereto, such as Figure 2 As shown, the method comprises the following steps:

[0036] S210: Obtaining a depth map of the image frame to be synthesized, N processed image frames, and depth maps of each of the N processed image frames;

[0037] S220: generating a feature tensor of the image frame to be synthesized according to the depth map of the image frame to be synthesized, the N processed image frames, and the depth maps of each of the N processed image frames;

[0038] S230: synthesizing the depth map of the image frame to be synthesized, the N processed image frames, and the feature tensors of the image frame to be synthesized to obtain a synthesized image frame corresponding to the image frame to be synthesized.

[0039] It should be understood that the N processed image frames are the N rendered or synthesized image frames before the image frame to be synthesized in the video, and N is a positive integer. Among them, the rendered image frame refers to an image frame that is rendered by a certain rendering method instead of using the technical solution of the present application. The synthesized image frame is an image frame synthesized by the technical solution of the present application. Among them, the N processed image frames can be N consecutive image frames, and they and the image frame to be synthesized also constitute continuous image frames. For example: the N processed image frames are the 1st to Nth processed image frames in a video, and the image frame to be synthesized is the N+1th image frame in the video.

[0040] It should be understood that the electronic device may generate the feature tensor of the image frame to be synthesized in any of the following achievable ways, but is not limited thereto:

[0041] Implementation method 1: For any one of the N processed image frames, the electronic device stacks the processed image frame, the depth map of the processed image frame and the depth map of the image frame to be synthesized into a first tensor; and inputs the first tensors corresponding to each of the N processed image frames into a first neural network to obtain a feature tensor of the image frame to be synthesized.

[0042] A second implementation method is as follows: the electronic device stacks the depth map of the image frame to be synthesized, N processed image frames, and the depth maps of each of the N processed image frames into a second tensor; and inputs the second tensor into a second neural network to obtain a feature tensor of the image frame to be synthesized.

[0043] It should be understood that the feature tensor of the image frame to be synthesized is a feature expression of the image frame to be synthesized, and the feature expression is a tensor, so it is referred to as a feature tensor here.

[0044] Assume that the image frame to be synthesized is recorded as Its depth map is denoted as d t , N processed image frames are denoted as X t-1 , they are x1,x2…x N , their corresponding depth maps are d1, d2…d N , the depth maps of N processed image frames constitute a set denoted as D t-1 , the feature tensor of the image frame to be synthesized is recorded as F t Assume that the height of each processed image frame is h, the width is w, and the number of channels is l, where if l=1 of a processed image frame, it means that the image frame is a grayscale image, and if l=3 of a processed image frame, it means that the image frame is a red green blue (RGB) or YUV image, or a color image in any other color space.

[0045] It should be understood that the number of channels of the depth map of the image frame to be synthesized is 1, and the number of channels of the depth maps of the N processed image frames is also 1.

[0046] The following is an explanation of the above-mentioned possible implementation method 1:

[0047] For any processed image frame x among the N processed image frames i , the electronic device can process the processed image frame x i , the processed image frame x i The depth map d i and the depth map d of the image frame to be synthesized t Stacked into the first tensor I with a height of h, a width of w, and a number of channels of l+2 i , where i = 1, 2…N. The channel number 2 in l+2 is the depth map d i and the depth map d t The sum of the number of channels of , and their respective channel numbers are 1.

[0048] It should be noted that the present application does not impose any restriction on how to stack the processed image frame, the depth map of the processed image frame, and the depth map of the image frame to be synthesized into a first tensor.

[0049] It should be understood that the first tensor of each of the N processed image frames, namely the first tensor I i , i = 1, 2 ... N can be input into the first neural network to obtain the feature tensor F of the image frame to be synthesized t .

[0050] In some implementations, the first neural network is any of the following neural networks, but is not limited thereto: a 3D convolutional network, a time recursive neural network (RNN), and a transformer network based on an attention mechanism.

[0051] In some implementations, the 3D convolutional network may be a flow-agnostic video representation (FLVAR) network, but is not limited thereto.

[0052] The following describes the second possible implementation method:

[0053] The electronic device can process N processed image frames x1, x2…x N , depth maps d1, d2…d of N processed image frames N and the depth map d of the image frame to be synthesized tThe second tensor I' is stacked into a height of h, a width of w, and a channel number of N*(l+1)+1. The first "1" in the channel number N*(l+1)+1 is the depth map d1, d2...d N The number of channels, the second "1" is the depth map d t The number of channels of each of them is 1.

[0054] It should be noted that the present application does not impose any restriction on how to stack the depth map of the image frame to be synthesized, the N processed image frames, and the depth maps of each of the N processed image frames into a second tensor.

[0055] It should be understood that the second tensor I' can be input into the second neural network to obtain the feature tensor F of the image frame to be synthesized. t .

[0056] In some implementations, the second neural network is a 2D convolutional network, but is not limited thereto.

[0057] In some implementations, the electronic device may input the depth map of the image frame to be synthesized, N processed image frames, and the feature tensor of the image frame to be synthesized into a third neural network to obtain a synthesized image frame corresponding to the image frame to be synthesized.

[0058] Figure 3 A schematic diagram of generating a synthesized image frame corresponding to an image frame to be synthesized is provided in an embodiment of the present application, such as Figure 3 As shown, for any one of the N processed image frames, the electronic device stacks the processed image frame, the depth map of the processed image frame, and the depth map of the image frame to be synthesized into a first tensor; the first tensors corresponding to each of the N processed image frames are input into the first neural network to obtain the feature tensor of the image frame to be synthesized. Furthermore, the electronic device can input the depth map of the image frame to be synthesized, the N processed image frames, and the feature tensors of the image frame to be synthesized into the third neural network to obtain a synthesized image frame corresponding to the image frame to be synthesized.

[0059] Figure 4 A schematic diagram of another method for generating a synthesized image frame corresponding to an image frame to be synthesized provided in an embodiment of the present application is as follows: Figure 4 As shown, the electronic device stacks the depth map of the image frame to be synthesized, N processed image frames, and the depth maps of each of the N processed image frames into a second tensor; and inputs the second tensor into the second neural network to obtain a feature tensor of the image frame to be synthesized. Furthermore, the electronic device can input the depth map of the image frame to be synthesized, the N processed image frames, and the feature tensors of the image frame to be synthesized into a third neural network to obtain a synthesized image frame corresponding to the image frame to be synthesized.

[0060] It should be noted that the present application does not limit the specific structures of the first neural network, the second neural network, and the third neural network. For example, the encoder in the UNet network architecture can be used as the first neural network or the second neural network, and the decoder can be used as the third neural network. The UNet network architecture can be composed of several 2D or 3D convolutional layers.

[0061] It should be noted that the encoder and decoder here are not encoders and decoders in the hardware sense, but networks or network branches.

[0062] In summary, in the present application, the electronic device can generate a feature tensor of the image frame to be synthesized based on the depth map of the image frame to be synthesized, N processed image frames and the depth maps of each of the N processed image frames; synthesize the depth map of the image frame to be synthesized, the N processed image frames and the feature tensors of the image frame to be synthesized to obtain a synthesized image frame corresponding to the image frame to be synthesized. This method is not affected by the video shooting scene, that is, even in at least one of the following situations: using a mobile camera to record a dynamic scene, a scene with object occlusion, and a scene with rapid object movement, the technical solution of the present application can accurately synthesize the synthesized image frame corresponding to the image frame to be synthesized.

[0063] From another perspective, assuming the scenario provided in the above example three, in the prior art, the server needs to render each image frame and send the rendered image frame to the terminal device so that the terminal device presents each image frame. However, through the technical solution provided in the present application, the server can synthesize the synthesized image frame corresponding to the image frame to be synthesized based on N processed image frames, their depth maps and the depth map of the image frame to be synthesized, without rendering the image frame, so that the image frame can be rendered at a lower frame rate, thereby reducing the amount of computation brought by image rendering.

[0064] In some implementations, the electronic device may also train the first neural network, the second neural network, and the third neural network, wherein the electronic device may train the first neural network and the third neural network together, or train the second neural network and the third neural network together.

[0065] The following first describes the training process of the electronic device for the first neural network and the third neural network:

[0066] The electronic device may train the first neural network and the third neural network in any of the following achievable ways:

[0067] Possible implementation method 1: The electronic device can obtain multiple training samples, each training sample includes: a depth map of an image frame to be synthesized, N processed image frames, depth maps of each of the N processed image frames, and a real image frame corresponding to the image frame to be synthesized, the N processed image frames are the N rendered or synthesized image frames before the image frame to be synthesized in the video, and N is a positive integer; that is, the real image frame corresponding to the image frame to be synthesized is the label of the training sample, and the electronic device can obtain the synthesized image frame corresponding to the image frame to be synthesized through the technical solution provided by the present application, that is, for any one of the N processed image frames, the electronic device stacks the processed image frame, the depth map of the processed image frame, and the depth map of the image frame to be synthesized into a first tensor; the first tensors corresponding to each of the N processed image frames are input into the first neural network to obtain the feature tensor of the image frame to be synthesized. The electronic device inputs the depth map of the image frame to be synthesized, the N processed image frames, and the feature tensors of the image frame to be synthesized into the third neural network to obtain the synthesized image frame corresponding to the image frame to be synthesized.

[0068] Furthermore, the electronic device can calculate the distortion loss between the real image frame corresponding to the image frame to be synthesized and the synthesized image frame, wherein the electronic device can adopt a mean square error loss function (MSE), a structural similarity index (SSIM) loss function or an adversarial loss function, but is not limited to this.

[0069] It should be understood that the adversarial loss function includes a discriminator loss function and a generator loss function. The discriminator loss function includes two parts: one part is the probability that the discriminator judges the real image frame corresponding to the image frame to be synthesized as a real image frame, and the other part is the probability that the discriminator judges the synthesized image frame corresponding to the image frame to be synthesized generated by the generator as a false image frame. The total loss of the discriminator is the sum of these two parts, and the loss should be maximized. Since the discriminator's ability to distinguish authenticity increases with the increase in the number of training times, the generator has to "compete" with it. The generator's loss function is the second part of the above-mentioned discriminator loss function, except that the generator should minimize this item, so the discriminator and the generator increase or reduce their own losses to continuously confront each other.

[0070] Furthermore, the electronic device can calculate the gradient of the distortion loss between the real image frame and the synthesized image frame, and update the parameters of the first neural network and the third neural network according to the gradient. That is, the electronic device can use the gradient descent algorithm to optimize the parameters of the first neural network and the third neural network.

[0071] Possible implementation method 2: The electronic device may also calculate the loss of the feature tensor of the above-mentioned image frame to be synthesized, and the loss may be a regularization loss or an L1 norm of the feature tensor, or other losses of the feature tensor, and the present application does not impose any restrictions on this. Furthermore, the electronic device may calculate the gradient of the loss of the feature tensor of the image frame to be synthesized, and update the parameters of the first neural network and the third neural network according to the gradient. That is, the electronic device may use a gradient descent algorithm to optimize the parameters of the first neural network and the third neural network.

[0072] Implementation method three: The electronic device can calculate the distortion loss between the real image frame and the synthesized image frame according to the implementation method one above, and calculate the loss of the feature tensor of the image frame to be synthesized according to the implementation method two above. The electronic device can update the parameters of the first neural network and the third neural network according to the distortion loss between the real image frame and the synthesized image frame and the loss of the feature tensor of the image frame to be synthesized. For example: the electronic device can calculate the sum of the distortion loss between the real image frame and the synthesized image frame and the loss of the feature tensor of the image frame to be synthesized, calculate the gradient of the summed result, and update the parameters of the first neural network and the third neural network according to the gradient. That is, the electronic device can use the gradient descent algorithm to optimize the parameters of the first neural network and the third neural network.

[0073] In some implementations, the gradient descent algorithm may be a stochastic gradient descent algorithm, a mini-batch gradient descent (MBGD) algorithm, etc., but is not limited thereto.

[0074] In some implementations, the electronic device may update the parameters in the first neural network and the third neural network at different times with different learning rates. Of course, the electronic device may also update the parameters in the first neural network and the third neural network at the same time with the same learning rate, and this application does not limit this.

[0075] In some implementations, the electronic device may update some or all parameters in the first neural network and the third neural network, which is not limited in this application.

[0076] The following describes the training process of the electronic device for the second neural network and the third neural network:

[0077] The electronic device may train the second neural network and the third neural network in any of the following achievable ways:

[0078] Possible implementation method 1: The electronic device can obtain multiple training samples, each training sample includes: a depth map of an image frame to be synthesized, N processed image frames, depth maps of each of the N processed image frames, and a real image frame corresponding to the image frame to be synthesized, the N processed image frames are the N rendered or synthesized image frames before the image frame to be synthesized in the video, and N is a positive integer; that is, the real image frame corresponding to the image frame to be synthesized is the label of the training sample, and the electronic device can obtain the synthesized image frame corresponding to the image frame to be synthesized through the technical solution provided by the present application, that is, the electronic device stacks the depth map of the image frame to be synthesized, the N processed image frames, and the depth maps of each of the N processed image frames into a second tensor; the second tensor is input into the second neural network to obtain the feature tensor of the image frame to be synthesized. The electronic device inputs the depth map of the image frame to be synthesized, the N processed image frames, and the feature tensors of the image frame to be synthesized into the third neural network to obtain the synthesized image frame corresponding to the image frame to be synthesized.

[0079] Furthermore, the electronic device may calculate the distortion loss between the real image frame and the synthesized image frame corresponding to the image frame to be synthesized, wherein the electronic device may adopt MSE, SSIM loss function or adversarial loss function, etc., but is not limited thereto.

[0080] It should be understood that the explanation of the adversarial loss function can be found above, and this application will not go into details.

[0081] Furthermore, the electronic device can calculate the gradient of the distortion loss between the real image frame and the synthesized image frame, and update the parameters of the second neural network and the third neural network according to the gradient. That is, the electronic device can use the gradient descent algorithm to optimize the parameters of the second neural network and the third neural network.

[0082] Possible implementation method 2: The electronic device may also calculate the loss of the feature tensor of the above-mentioned image frame to be synthesized, and the loss may be a regularization loss or an L1 norm of the feature tensor, or other losses of the feature tensor, and the present application does not limit this. Furthermore, the electronic device may calculate the gradient of the loss of the feature tensor of the image frame to be synthesized, and update the parameters of the second neural network and the third neural network according to the gradient. That is, the electronic device may use a gradient descent algorithm to optimize the parameters of the second neural network and the third neural network.

[0083] Possible implementation method three: The electronic device can calculate the distortion loss between the real image frame and the synthesized image frame according to the above-mentioned feasible implementation method one, and calculate the loss of the feature tensor of the image frame to be synthesized according to the above-mentioned feasible implementation method two. The electronic device can update the parameters of the second neural network and the third neural network according to the distortion loss between the real image frame and the synthesized image frame and the loss of the feature tensor of the image frame to be synthesized. For example: The electronic device can calculate the sum of the distortion loss between the real image frame and the synthesized image frame and the loss of the feature tensor of the image frame to be synthesized, calculate the gradient of the summed result, and update the parameters of the second neural network and the third neural network according to the gradient. That is, the electronic device can use the gradient descent algorithm to optimize the parameters of the second neural network and the third neural network.

[0084] It should be understood that the explanation of the gradient descent algorithm can be found above, and this application will not go into details.

[0085] In some implementations, the electronic device may update the parameters in the second neural network and the third neural network at different times with different learning rates. Of course, the electronic device may also update the parameters in the second neural network and the third neural network at the same time with the same learning rate, and this application does not limit this.

[0086] In some implementations, the electronic device may update some or all parameters in the second neural network and the third neural network, which is not limited in this application.

[0087] In summary, in the present application, the electronic device can train the first neural network / the second neural network, and the third neural network based on at least one of the distortion loss between the real image frame and the synthesized image frame corresponding to the image frame to be synthesized, and the loss of the feature tensor of the image frame to be synthesized, so as to improve the robustness of the first neural network / the second neural network, and the third neural network.

[0088] Figure 5 A schematic diagram of a video image frame processing device provided in an embodiment of the present application, the device includes: an acquisition module 510, a generation module 520 and a synthesis module 530, wherein the acquisition module 510 is used to obtain a depth map of an image frame to be synthesized, N processed image frames and depth maps of each of the N processed image frames, the N processed image frames are N rendered or synthesized image frames before the image frame to be synthesized in the video, and N is a positive integer; the generation module 520 is used to generate a feature tensor of the image frame to be synthesized according to the depth map of the image frame to be synthesized, the N processed image frames and the depth maps of each of the N processed image frames; the synthesis module 530 is used to synthesize the depth map of the image frame to be synthesized, the N processed image frames and the feature tensors of the image frame to be synthesized, so as to obtain a synthesized image frame corresponding to the image frame to be synthesized.

[0089] In some possible implementations, the generation module 520 is specifically the same as: for any one of the N processed image frames, stacking the processed image frame, the depth map of the processed image frame and the depth map of the image frame to be synthesized into a first tensor; inputting the first tensors corresponding to each of the N processed image frames into a first neural network to obtain a feature tensor of the image frame to be synthesized.

[0090] In some implementations, the first neural network is any one of the following neural networks: a 3D convolutional network, a temporal RNN, and a transformation network based on an attention mechanism.

[0091] In some possible implementations, for any one of the N processed image frames, the height of the processed image frame is h, the width is w, and the number of channels is l, the number of channels of the depth map of the processed image frame is 1, and the number of channels of the depth map of the image frame to be synthesized is 1; accordingly, the height of the first tensor is h, the width is w, and the number of channels is l+2.

[0092] In some implementations, the generation module 520 is specifically equivalent to: stacking the depth map of the image frame to be synthesized, N processed image frames, and the depth maps of each of the N processed image frames into a second tensor; inputting the second tensor into a second neural network to obtain a feature tensor of the image frame to be synthesized.

[0093] In some implementations, the generation module 520 is specifically the same as: the second neural network is a 2D convolutional network.

[0094] In some possible implementations, the generation module 520 is specifically the same as: for any one of the N processed image frames, the height of the processed image frame is h, the width is w, the number of channels is l, the number of channels of the depth map of the processed image frame is 1, and the number of channels of the depth map of the image frame to be synthesized is 1; accordingly, the height of the second tensor is h, the width is w, and the number of channels is N*(l+1)+1.

[0095] In some implementations, the synthesis module 530 is specifically the same as: inputting the depth map of the image frame to be synthesized, N processed image frames and the feature tensor of the image frame to be synthesized into the third neural network to obtain a synthesized image frame corresponding to the image frame to be synthesized.

[0096] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here. Specifically, Figure 5 The video image frame processing device shown can perform Figure 2 The corresponding method embodiment, and the aforementioned and other operations and / or functions of each module in the video image frame processing device are respectively to achieve Figure 2 For the sake of brevity, the corresponding processes in each method are not repeated here.

[0097] The above describes the processing device of the video image frame of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0098] Figure 6 1 is a schematic block diagram of an electronic device provided in an embodiment of the present application. The electronic device may be the terminal device in the above example 1, or the server in example 2 or example 3, but is not limited thereto.

[0099] like Figure 6 As shown, the electronic device may include:

[0100] The memory 610 and the processor 620, the memory 610 is used to store the computer program and transmit the program code to the processor 620. In other words, the processor 620 can call and run the computer program from the memory 610 to implement the method in the embodiment of the present application.

[0101] For example, the processor 620 may be configured to execute the above method embodiments according to instructions in the computer program.

[0102] In some embodiments of the present application, the processor 620 may include but is not limited to:

[0103] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0104] In some embodiments of the present application, the memory 610 includes but is not limited to:

[0105] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0106] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 610 and executed by the processor 620 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0107] like Figure 6 As shown, the electronic device may also include:

[0108] The transceiver 630 may be connected to the processor 620 or the memory 610 .

[0109] The processor 620 may control the transceiver 630 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 630 may include a transmitter and a receiver. The transceiver 630 may further include an antenna, and the number of antennas may be one or more.

[0110] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0111] The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0112] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0113] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0114] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0115] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0116] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for generating a video image frame, characterized in that: include: Obtaining a depth map of an image frame to be synthesized, N processed image frames, and depth maps of each of the N processed image frames, wherein the N processed image frames are N rendered or synthesized image frames before the image frame to be synthesized in the video, where N is a positive integer; Generate a feature tensor of the image frame to be synthesized according to the depth map of the image frame to be synthesized, the N processed image frames, and the depth maps of each of the N processed image frames; Synthesizing the depth map of the image frame to be synthesized, the N processed image frames, and the feature tensor of the image frame to be synthesized to obtain a synthesized image frame corresponding to the image frame to be synthesized; The step of generating a feature tensor of the image frame to be synthesized according to the depth map of the image frame to be synthesized, the N processed image frames, and the depth maps of each of the N processed image frames includes: For any one of the N processed image frames, stacking the processed image frame, the depth map of the processed image frame, and the depth map of the image frame to be synthesized into a first tensor; Inputting first tensors corresponding to the N processed image frames into a first neural network to obtain feature tensors of the image frame to be synthesized; For any one of the N processed image frames, the height of the processed image frame is h, the width is w, and the number of channels is l, the number of channels of the depth map of the processed image frame is 1, and the number of channels of the depth map of the image frame to be synthesized is 1; accordingly, the height of the first tensor is h, the width is w, and the number of channels is l+2.

2. The method according to claim 1, characterized in that: The first neural network is any one of the following neural networks: a 3D convolutional network, a time recurrent neural network RNN, and a transformation network based on an attention mechanism.

3. The method according to claim 1, characterized in that The step of synthesizing the depth map of the image frame to be synthesized, the N processed image frames, and the feature tensor of the image frame to be synthesized to obtain a synthesized image frame corresponding to the image frame to be synthesized includes: The depth map of the image frame to be synthesized, the N processed image frames and the feature tensor of the image frame to be synthesized are input into a third neural network to obtain a synthesized image frame corresponding to the image frame to be synthesized.

4. A video image frame processing device, characterized in that: include: An acquisition module, used to acquire a depth map of an image frame to be synthesized, N processed image frames, and depth maps of each of the N processed image frames, wherein the N processed image frames are N rendered or synthesized image frames before the image frame to be synthesized in the video, and N is a positive integer; A generating module, configured to generate a feature tensor of the image frame to be synthesized according to the depth map of the image frame to be synthesized, the N processed image frames, and the depth maps of each of the N processed image frames; A synthesis module, used for synthesizing the depth map of the image frame to be synthesized, the N processed image frames and the feature tensor of the image frame to be synthesized, so as to obtain a synthesized image frame corresponding to the image frame to be synthesized; Wherein, the generation module is specifically used for: For any one of the N processed image frames, stacking the processed image frame, the depth map of the processed image frame, and the depth map of the image frame to be synthesized into a first tensor; Inputting first tensors corresponding to the N processed image frames into a first neural network to obtain feature tensors of the image frame to be synthesized; For any one of the N processed image frames, the height of the processed image frame is h, the width is w, and the number of channels is l, the number of channels of the depth map of the processed image frame is 1, and the number of channels of the depth map of the image frame to be synthesized is 1; accordingly, the height of the first tensor is h, the width is w, and the number of channels is l+2.

5. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 3.

7. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 3 is implemented.