CN114998403A - Depth prediction method, depth prediction device, electronic apparatus, and medium - Google Patents
Depth prediction method, depth prediction device, electronic apparatus, and medium Download PDFInfo
- Publication number
- CN114998403A CN114998403A CN202210667499.6A CN202210667499A CN114998403A CN 114998403 A CN114998403 A CN 114998403A CN 202210667499 A CN202210667499 A CN 202210667499A CN 114998403 A CN114998403 A CN 114998403A
- Authority
- CN
- China
- Prior art keywords
- frame
- depth data
- transformed
- data
- depth
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 230000004044 response Effects 0.000 claims abstract description 8
- 238000004590 computer program Methods 0.000 claims description 15
- 230000009466 transformation Effects 0.000 claims description 5
- 238000013473 artificial intelligence Methods 0.000 abstract description 7
- 238000013135 deep learning Methods 0.000 abstract description 4
- 230000003190 augmentative effect Effects 0.000 abstract description 3
- 238000004891 communication Methods 0.000 description 13
- 238000012545 processing Methods 0.000 description 12
- 238000012549 training Methods 0.000 description 11
- 238000005516 engineering process Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 238000013507 mapping Methods 0.000 description 5
- 239000011159 matrix material Substances 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 5
- 238000013459 approach Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000002123 temporal effect Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000010267 cellular communication Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000003924 mental process Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 239000004984 smart glass Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/50—Depth or shape recovery
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/088—Non-supervised learning, e.g. competitive learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
Abstract
The disclosure provides a depth prediction method, a depth prediction device, electronic equipment and a depth prediction medium, and relates to the technical field of artificial intelligence, in particular to the technical fields of Augmented Reality (AR), virtual reality, computer vision, deep learning and the like. A depth prediction method includes: acquiring at least two video frames, wherein the at least two video frames comprise a first frame and a second frame; in response to determining that first depth data exists for the first frame, determining transformed first depth data of the first depth data in an image coordinate system of the second frame; and determining predicted second depth data for the second frame based on the image data of the second frame and the transformed first depth data.
Description
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to the field of augmented reality AR, virtual reality, computer vision, deep learning, and the like, and in particular, to a depth prediction method, apparatus, electronic device, computer-readable storage medium, and computer program product.
Background
Artificial intelligence is the subject of research that makes computers simulate some human mental processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), both at the hardware level and at the software level. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, etc.: the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, machine learning/deep learning, a big data processing technology, a knowledge map technology and the like.
In recent years, with the rapid development of deep neural networks, monocular depth estimation based on deep learning has been widely studied. For example, in the field of unmanned driving, depth information is important for an automatic driving system to perceive and estimate its own pose. In addition, depth information is also widely used in the fields of 3D map reconstruction, augmented reality, virtual reality, mixed reality, and the like.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, unless otherwise indicated, the problems mentioned in this section should not be considered as having been acknowledged in any prior art.
Disclosure of Invention
The disclosure provides a depth prediction method, an apparatus, an electronic device, a computer-readable storage medium and a computer program product.
According to an aspect of the present disclosure, there is provided a depth prediction method including: acquiring at least two video frames, wherein the at least two video frames comprise a first frame and a second frame; in response to determining that first depth data exists for the first frame, determining transformed first depth data of the first depth data in an image coordinate system of the second frame; and determining predicted second depth data for the second frame based on the image data of the second frame and the transformed first depth data.
According to another aspect of the present disclosure, there is provided a depth prediction apparatus including: a video frame acquiring unit, configured to acquire at least two video frames, where the at least two video frames include a first frame and a second frame; a transformation unit to determine transformed first depth data of first depth data in an image coordinate system of the second frame in response to determining that first depth data exists for the first frame; and a prediction unit for determining predicted second depth data of the second frame based on the image data of the second frame and the transformed first depth data.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a depth prediction method according to one or more embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a depth prediction method according to one or more embodiments of the present disclosure.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor, implements a depth prediction method according to one or more embodiments of the present disclosure.
According to one or more embodiments of the present disclosure, depth prediction may be accurately performed based on video frames.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the embodiments and, together with the description, serve to explain the exemplary implementations of the embodiments. The illustrated embodiments are for purposes of example only and do not limit the scope of the claims. Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a schematic diagram of an exemplary system in which various methods described herein may be implemented, according to an embodiment of the present disclosure;
FIG. 2 shows a flow diagram of a depth prediction method according to an embodiment of the present disclosure;
FIG. 3 shows a data flow diagram of a depth prediction method according to an embodiment of the present disclosure;
fig. 4 shows a block diagram of a depth prediction apparatus according to an embodiment of the present disclosure;
FIG. 5 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, the timing relationship, or the importance relationship of the elements, and such terms are used only to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, based on the context, they may also refer to different instances.
The terminology used in the description of the various described examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element may be one or a plurality of. Furthermore, the term "and/or" as used in this disclosure is intended to encompass any and all possible combinations of the listed items.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a schematic diagram of an exemplary system 100 in which various methods and apparatus described herein may be implemented in accordance with embodiments of the present disclosure. Referring to fig. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. Client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the depth prediction method according to the present disclosure to be performed.
In some embodiments, the server 120 may also provide other services or software applications, which may include non-virtual environments and virtual environments. In certain embodiments, these services may be provided as web-based services or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and/or 106 under a software as a service (SaaS) model.
In the configuration shown in fig. 1, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or a combination thereof, which may be executed by one or more processors. A user operating a client device 101, 102, 103, 104, 105, and/or 106 may, in turn, utilize one or more client applications to interact with the server 120 to take advantage of the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from system 100. Accordingly, fig. 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
The user may use client devices 101, 102, 103, 104, 105, and/or 106 to make depth predictions, view prediction results, and so forth. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Although fig. 1 depicts only six client devices, those skilled in the art will appreciate that any number of client devices may be supported by the present disclosure.
Network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP/IP, SNA, IPX, etc. By way of example only, one or more networks 110 may be a Local Area Network (LAN), an ethernet-based network, a token ring, a Wide Area Network (WAN), the internet, a virtual network, a Virtual Private Network (VPN), an intranet, an extranet, a blockchain network, a Public Switched Telephone Network (PSTN), an infrared network, a wireless network (e.g., bluetooth, WIFI), and/or any combination of these and/or other networks.
The server 120 may include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-end servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and/or combination. The server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture involving virtualization (e.g., one or more flexible pools of logical storage that may be virtualized to maintain virtual storage for the server). In various embodiments, the server 120 may run one or more services or software applications that provide the functionality described below.
The computing units in server 120 may run one or more operating systems including any of the operating systems described above, as well as any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and/or middle tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, and the like.
In some implementations, the server 120 may include one or more applications to analyze and consolidate data feeds and/or event updates received from users of the client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and/or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
In some embodiments, the server 120 may be a server of a distributed system, or a server incorporating a blockchain. The server 120 may also be a cloud server, or a smart cloud computing server or a smart cloud host with artificial intelligence technology. The cloud Server is a host product in a cloud computing service system, and is used for solving the defects of high management difficulty and weak service expansibility in the traditional physical host and Virtual Private Server (VPS) service.
The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The database 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The database 130 may be of different types. In certain embodiments, the database used by the server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data to and from the database in response to the command.
In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the application may be different types of databases, such as key-value stores, object stores, or regular stores supported by a file system.
The system 100 of fig. 1 may be configured and operated in various ways to enable application of the various methods and apparatus described in accordance with the present disclosure.
A depth prediction method 200 according to an exemplary embodiment of the present disclosure is described below with reference to fig. 2.
At step S201, at least two video frames are acquired, the at least two video frames including a first frame and a second frame.
At step S202, in response to determining that first depth data exists for the first frame, transformed first depth data of the first depth data in an image coordinate system of the second frame is determined.
At step S203, predicted second depth data of the second frame is determined based on the image data of the second frame and the transformed first depth data.
According to the method disclosed by the embodiment of the disclosure, the depth prediction can be accurately carried out on the basis of the video frame.
In the field of depth prediction, the single prediction of each frame easily causes poor consistency of prediction results in time sequence. For example, the prediction results vary greatly from frame to frame due to camera position fluctuations, object movement in the image, or other small noise effects. In contrast, according to the method of the present disclosure, it is possible to take as input the depth result of another frame in the video when predicting the depth of one frame. In other words, the depth of another frame can be projected to the image plane of the current frame as a priori, so that better temporal consistency can be guaranteed.
For example, first depth data (which may also be referred to as a depth matrix or a depth map) of a first frame is denoted as D 1 Then transformed first depth data D 'in an image coordinate system that projected the first frame to the second frame may be based on the calculation' 2 . For example, there are
D′ 2 =π(π -1 (D 1 ))
Where π denotes a projection or mapping from the camera coordinate system to the image coordinate system, π -1 Representing a projection or mapping from the image coordinate system to the camera coordinate system.
According to some embodiments, determining transformed first depth data of first depth data in an image coordinate system of the second frame comprises: determining the transformed first depth data based on a camera pose corresponding to the second frame.
According to such an embodiment, by taking into account the camera pose, it is possible to determine the depth variation between frames due to the camera poseIn addition, the time sequence consistency between frames can be ensured by the depth data after transformation. Continuing with the example above, let the camera pose corresponding to the second frame be p i+1 Then there is
D′ 2 =π(p i+1 ,π -1 (D 1 ))
Where π denotes a projection or mapping from the camera coordinate system to the image coordinate system, π -1 Representing a projection or mapping from the image coordinate system to the camera coordinate system, D 1 Representing first depth data, D' 2 Representing the transformed first depth data.
It is to be understood that the present disclosure is not limited thereto. For example, the above mapping may be done without the aid of the camera pose, or may be done additionally or alternatively taking into account the camera pose of the first frame, and so on.
According to some embodiments, determining the transformed first depth data based on the camera pose corresponding to the second frame comprises: projecting the first depth data to a camera coordinate system based on camera intrinsic parameters to obtain first depth data in the camera coordinate system; and projecting the first depth data in the camera coordinate system to an image coordinate system of the second frame based on a camera pose corresponding to the second frame to obtain the transformed first depth data.
According to such an embodiment, the conversion of the camera coordinate system and the pixel coordinate system can be realized by further considering the camera internal reference matrix. It is to be understood that camera intrinsic parameters may also be referred to as camera intrinsic parameters and may include, for example, resolution, camera coordinate system parameters, and the like. For example, in such an embodiment, there are
D′ 2 =π(p i+1 ,π -1 (I,D 1 ))
Wherein I represents camera reference, and the meanings of the rest variables are as described above and are not repeated herein.
According to some embodiments, method 200 may further comprise determining an inter-frame projection mask indicating whether individual pixels of the first frame can be projected onto an image plane of the second frame, and wherein said determining predicted second depth data of the second frame based on image data of the second frame and the transformed first depth data comprises: determining predicted second depth data for the second frame based on the image data for the second frame, the transformed first depth data, and the inter-frame projection mask.
In other words, determining the predicted second depth data for the second frame may also be based on the inter-frame projection mask. In such embodiments, an inter-frame projection Mask, denoted Mask, for example, is also determined. The inter-frame projection Mask may identify whether the pixels of the first frame are still included in the second frame after the planar movement, thereby making the first frame more targeted as reference data. It will be appreciated that the inter-frame projection Mask may also be referred to as a projection Mask, a projection matrix, a projection map, etc., and may be a matrix or map as large as the first depth data and the second depth data, with each value identifying a corresponding projection relationship of pixels of the first frame to the second frame. As a specific non-limiting example, the inter-frame projection Mask may be a matrix or a graph corresponding to the first depth data, wherein each number or point is 1 to indicate that the corresponding pixel point of the first depth data is still projected in the second frame, and 0 to indicate that it is not projected in the second frame. It is to be understood that the present disclosure is not limited thereto.
According to some embodiments, determining predicted second depth data for the second frame based on the image data for the second frame, the transformed first depth data, and the inter-projection mask comprises: inputting the image data of the second frame, the transformed first depth data, and the inter-projection mask into a pre-trained model to determine predicted second depth data of the second frame.
The association of depth data between two frames is established by a pre-trained model. Particularly, the depth data and the projection relation of the first frame are used as the input of the model, so that the model has more prior knowledge when determining the depth of the second frame, and a more accurate effect is obtained.
As an example, in the course of training, the current situation isWhen processing jth frame (j)>0) Based on the depth data D of a previous frame (denoted as the ith frame) i Pose p of camera j And one or more of the camera internal parameters I, D i Converted to camera coordinate system and then re-projected to the jth frame to obtain transformed depth data
D′ j =π(p j ,π -1 (I,D i ))
It will be appreciated that the depth data D i May be the result of prediction of the ith frame by the network, or may be depth data obtained in other manners, such as a nominal true value, etc., and the disclosure is not limited thereto.
In addition, a projection Mask may be obtained, and the transformed depth data D 'may be obtained' j Multiplied by a projection Mask and multiplied by sample data (e.g., RGB data or other pixel data) F of the j-th frame j Are input to the depth estimation network together. Thereafter, for data F for the j frame j Output predicted value D j Calculating a loss function:
Loss=|D j ,G j |
wherein G is j Is a calibrated real label. It will be appreciated that although the construction of the loss function is described herein with respect to a supervised trained model, the disclosure is not so limited. Those skilled in the art will appreciate that the methods applicable to the present disclosure may be applied to a variety of semi-supervised or unsupervised training models, and that those skilled in the art may train a model using a variety of penalty functions applicable to semi-supervised or unsupervised training models, as long as the input to the model in the training takes into account depth data ("first depth data") of another frame ("first frame").
Similarly, in the actual prediction process, the image frame to be predicted currently is still recorded as the jth frame, and it is assumed that depth data D already exists for a certain frame (recorded as the ith frame) before i Transformed depth data D 'may also be similarly transformed' j Mask, data F of the j frame to be predicted j Together input to the depth estimation network. And with the j-th frame to be predictedF (e.g. RGB data or other pixel data) j Input into the pre-trained depth estimation network together to output a predicted value D j 。
According to some embodiments, inputting the image data of the second frame, the transformed first depth data and the inter-frame projection mask into a pre-trained model comprises: multiplying the transformed first depth data and the inter-frame projection mask, and inputting the result of the multiplication and the image data of the second frame into the pre-trained model.
The inter-frame projection mask is multiplied by the depth data to retain only the first frame pixels included in the second frame, reducing the interference of the unwanted data with the model. For example, continuing the example above, the transformed depth data D 'may be input before the model is input' j Is multiplied by the projection Mask and the multiplication result is input into the model.
According to some embodiments, the method 200 may further comprise, prior to determining the transformed first depth data of the first depth data in the image coordinate system of the second frame: obtaining the first depth data based at least on image data of the first frame.
In such embodiments, the first depth data may be depth data predicted according to the same method, model, network, or the like. Therefore, the consistency in time sequence can be realized through at least two images in the video frame under the condition of not needing external calibration.
As one example, in the case where the first frame is the first predicted frame in a video frame, the depth data may be predicted based only on its image data itself. Alternatively, to ensure consistency of the data format, a blank or "transformed depth image" of all 0 values (and optionally a blank mask) may be generated when the current frame is determined to be the first frame.
As another example, in the case where the first frame is not the first predicted frame in the video frame, the first depth data of the first frame may be obtained based on the predicted depth of the previous frame. That is, the video prediction method of the present disclosure may be cyclically used in a video including three or more frames to ensure temporal consistency.
According to some embodiments, the first frame and the second frame are temporally adjacent frames of the video frame. By using the depth between the adjacent frames, the consistency on the time sequence can be ensured. In such an alternative embodiment, continuing with the example above, where the first frame is noted as the ith frame, the number j of the second frame may be equal to i + 1. It is to be understood that the present disclosure is not so limited. For example, the continuity-preserving depth estimation method according to the present disclosure may be performed once every few frames, only between certain key frames, and so on.
Referring to FIG. 3, a data flow diagram during a specific non-limiting example model training process is shown in accordance with the present disclosure.
The training data may include data (e.g., an RGB map) for a plurality of video frames (e.g., including at least a first frame and a second frame), pose changes between the plurality of video frames, and depth truth labels for a corresponding sequence of frames. As previously mentioned, although described herein under examples of supervised training, the present disclosure is not so limited.
As an example, when the (i + 1) th frame is processed as the "second frame", the prediction result D of the ith frame (as the "first frame") according to the network i 301 and camera pose p i+1 Camera intrinsic parameter I, etc., are re-projected at 310, by equation D' i+1 =π(p i+1 ,π -1 (I,D i ) Obtaining depth data D' i+1 302, and a projection mask 303.
Projecting picture D' i+1 Multiplied by Mask and multiplied by the data F of the second frame i+1 304 are input together into the depth estimation network 320, the predicted values 305 are output, and the predicted values are computed with the scaled true values 306 for the loss function.
It will be appreciated that the above are merely examples, and that the disclosure is not limited thereto.
In the related art, training is often performed on a single image, and the temporal stability of depth prediction of a video is not good. Furthermore, in the related art, the constraint on the consistency of the video depth estimation includes performing supervised training on each video to be estimated by using an optical flow in both the parallax and the space, or performing supervised training by using an optical flow in a training stage, and applying a trained network to each subsequent video without additional processing. However, such a solution may introduce inefficiencies and long computation time, and the consistency in timing is not stable enough. Therefore, the scheme of optimizing consistency in time sequence when depth estimation is carried out on videos is provided, and under the premise that performance is guaranteed, stable and consistent depth estimation of frames before and after output is achieved, and better experience effects are brought for the fields of 3D reconstruction, AR, VR and the like.
A depth prediction apparatus 400 according to an embodiment of the present disclosure will now be described with reference to fig. 4. The depth prediction apparatus 400 may include a video frame acquisition unit 401, a transformation unit 402, and a prediction unit 403. The video frame acquiring unit 401 is configured to acquire at least two video frames, where the at least two video frames include a first frame and a second frame. The transform unit 402 is to determine transformed first depth data of the first depth data in an image coordinate system of the second frame in response to determining that first depth data exists for the first frame. The prediction unit 403 is configured to determine predicted second depth data of the second frame based on the image data of the second frame and the transformed first depth data.
According to the device of the embodiment of the disclosure, the depth prediction can be accurately carried out on the basis of the video frame.
According to some embodiments, the transformation unit 402 may comprise: means for determining the transformed first depth data based on a camera pose corresponding to the second frame.
According to some embodiments, the means for determining the transformed first depth data based on the camera pose corresponding to the second frame may comprise: means for projecting the first depth data to a camera coordinate system based on camera intrinsic parameters to obtain first depth data in the camera coordinate system; and means for projecting the first depth data in the camera coordinate system to an image coordinate system of the second frame based on a camera pose corresponding to the second frame to obtain the transformed first depth data.
According to some embodiments, the apparatus 400 may further comprise a mask determining unit, which may be configured to determine an inter-frame projection mask indicating whether individual pixels of the first frame can be projected onto an image plane of the second frame, and wherein the prediction unit is further configured to determine predicted second depth data of the second frame based on the inter-frame projection mask.
According to some embodiments, the prediction unit 403 may include: means for inputting the image data of the second frame, the transformed first depth data, and the inter-frame projection mask into a pre-trained model to determine the second depth data.
According to some embodiments, the means for inputting the image data of the second frame, the transformed first depth data, and the inter-frame projection mask into a pre-trained model to determine the second depth data may comprise: means for multiplying the transformed first depth data and the inter-frame projection mask, and inputting a result of the multiplying and the image data of the second frame into the pre-trained model.
According to some embodiments, the apparatus 400 may further comprise means for obtaining first depth data based at least on the image data of the first frame prior to determining transformed first depth data of the first depth data in the image coordinate system of the second frame.
According to some embodiments, the first frame and the second frame may be temporally adjacent frames of the at least two video frames.
In the technical scheme of the disclosure, the collection, acquisition, storage, use, processing, transmission, provision, public application and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations, and do not violate the good customs of the public order.
According to an embodiment of the present disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.
Referring to fig. 5, a block diagram of a structure of an electronic device 500, which may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic device is intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 can also be stored. The calculation unit 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the electronic device 500 are connected to the I/O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 may be any type of device capable of inputting information to the electronic device 500, and the input unit 506 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and/or a remote controller. Output unit 507 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. The storage unit 508 may include, but is not limited to, a magnetic disk, an optical disk. The communication unit 509 allows the electronic device 500 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and/or the like.
The computing unit 501 may be a variety of general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 501 performs the various methods and processes described above, such as the method 200 and its variants. For example, in some embodiments, method 200, variations thereof, and so forth, may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 500 via the ROM 502 and/or the communication unit 509. One or more steps of the method 200 described above and variations thereof may be performed when the computer program is loaded into RAM 503 and executed by the computing unit 501. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the method 200, variations thereof, and so forth, in any other suitable manner (e.g., by way of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server combining a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be performed in parallel, sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
While embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the above-described methods, systems and apparatus are merely illustrative embodiments or examples and that the scope of the invention is not to be limited by these embodiments or examples, but only by the claims as issued and their equivalents. Various elements in the embodiments or examples may be omitted or may be replaced with equivalents thereof. Further, the steps may be performed in an order different from that described in the present disclosure. Further, various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced with equivalent elements that appear after the present disclosure.
Claims (19)
1. A depth prediction method, comprising:
acquiring at least two video frames, wherein the at least two video frames comprise a first frame and a second frame;
in response to determining that first depth data exists for the first frame, determining transformed first depth data of the first depth data in an image coordinate system of the second frame; and
determining predicted second depth data for the second frame based on the image data for the second frame and the transformed first depth data.
2. The method of claim 1, wherein determining transformed first depth data of first depth data in an image coordinate system of the second frame comprises: determining the transformed first depth data based on a camera pose corresponding to the second frame.
3. The method of claim 2, wherein determining the transformed first depth data based on the camera pose corresponding to the second frame comprises:
projecting the first depth data to a camera coordinate system based on camera intrinsic parameters to obtain first depth data in the camera coordinate system; and
projecting first depth data in the camera coordinate system to an image coordinate system of the second frame based on a camera pose corresponding to the second frame to obtain the transformed first depth data.
4. The method of any of claims 1-3, further comprising determining an inter-frame projection mask representing whether individual pixels of the first frame can be projected onto an image plane of the second frame, wherein the determining predicted second depth data for the second frame based on the image data of the second frame and the transformed first depth data comprises: determining predicted second depth data for the second frame based on the image data for the second frame, the transformed first depth data, and the inter-frame projection mask.
5. The method of claim 4, wherein determining predicted second depth data for the second frame based on the image data for the second frame, the transformed first depth data, and the inter-projection mask comprises: inputting the image data of the second frame, the transformed first depth data, and the inter-projection mask into a pre-trained model to determine predicted second depth data of the second frame.
6. The method of claim 5, wherein inputting the image data of the second frame, the transformed first depth data, and the inter-frame projection mask into a pre-trained model comprises: multiplying the transformed first depth data and the inter-frame projection mask, and inputting the result of the multiplication and the image data of the second frame into the pre-trained model.
7. The method of any of claims 1-6, further comprising, prior to determining the transformed first depth data for the first depth data in the image coordinate system of the second frame: obtaining the first depth data based at least on image data of the first frame.
8. The method of any of claims 1-7, wherein the first frame and the second frame are temporally adjacent frames of the video frame.
9. A depth prediction apparatus comprising:
a video frame acquiring unit, configured to acquire at least two video frames, where the at least two video frames include a first frame and a second frame;
a transformation unit to determine transformed first depth data of first depth data in an image coordinate system of the second frame in response to determining that first depth data exists for the first frame; and
a prediction unit for determining predicted second depth data of the second frame based on the image data of the second frame and the transformed first depth data.
10. The apparatus of claim 9, wherein the transform unit comprises: means for determining the transformed first depth data based on a camera pose corresponding to the second frame.
11. The apparatus of claim 10, wherein means for determining the transformed first depth data based on a camera pose corresponding to the second frame comprises:
means for projecting the first depth data to a camera coordinate system based on camera intrinsic parameters to obtain first depth data in the camera coordinate system; and
means for projecting the first depth data in the camera coordinate system to an image coordinate system of the second frame based on a camera pose corresponding to the second frame to obtain the transformed first depth data.
12. The apparatus according to any of claims 9-11, further comprising a mask determining unit for determining an inter-frame projection mask indicating whether individual pixels of the first frame can be projected onto an image plane of the second frame, and wherein the prediction unit is further for determining predicted second depth data of the second frame based on the inter-frame projection mask.
13. The apparatus of claim 12, wherein the prediction unit comprises: means for inputting the image data of the second frame, the transformed first depth data, and the inter-frame projection mask into a pre-trained model to determine the second depth data.
14. The apparatus of claim 13, wherein means for inputting the image data of the second frame, the transformed first depth data, and the inter-frame projection mask into a pre-trained model to determine the second depth data comprises: means for multiplying the transformed first depth data and the inter-frame projection mask, and inputting a result of the multiplying and the image data of the second frame into the pre-trained model.
15. The apparatus of any of claims 9-14, further comprising means for obtaining first depth data based at least on image data of the first frame prior to determining transformed first depth data of the first depth data in an image coordinate system of the second frame.
16. The apparatus of any of claims 9-15, wherein the first frame and the second frame are temporally adjacent frames of the at least two video frames.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
18. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
19. A computer program product comprising a computer program, wherein the computer program realizes the method of any one of claims 1-8 when executed by a processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210667499.6A CN114998403A (en) | 2022-06-13 | 2022-06-13 | Depth prediction method, depth prediction device, electronic apparatus, and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210667499.6A CN114998403A (en) | 2022-06-13 | 2022-06-13 | Depth prediction method, depth prediction device, electronic apparatus, and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114998403A true CN114998403A (en) | 2022-09-02 |
Family
ID=83035907
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210667499.6A Pending CN114998403A (en) | 2022-06-13 | 2022-06-13 | Depth prediction method, depth prediction device, electronic apparatus, and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114998403A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111540000A (en) * | 2020-04-28 | 2020-08-14 | 深圳市商汤科技有限公司 | Scene depth and camera motion prediction method and device, electronic device and medium |
US20210090279A1 (en) * | 2019-09-20 | 2021-03-25 | Google Llc | Depth Determination for Images Captured with a Moving Camera and Representing Moving Features |
WO2021218201A1 (en) * | 2020-04-27 | 2021-11-04 | 北京达佳互联信息技术有限公司 | Image processing method and apparatus |
CN114549612A (en) * | 2022-02-25 | 2022-05-27 | 北京百度网讯科技有限公司 | Model training and image processing method, device, equipment and storage medium |
-
2022
- 2022-06-13 CN CN202210667499.6A patent/CN114998403A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20210090279A1 (en) * | 2019-09-20 | 2021-03-25 | Google Llc | Depth Determination for Images Captured with a Moving Camera and Representing Moving Features |
WO2021218201A1 (en) * | 2020-04-27 | 2021-11-04 | 北京达佳互联信息技术有限公司 | Image processing method and apparatus |
CN113643342A (en) * | 2020-04-27 | 2021-11-12 | 北京达佳互联信息技术有限公司 | Image processing method and device, electronic equipment and storage medium |
CN111540000A (en) * | 2020-04-28 | 2020-08-14 | 深圳市商汤科技有限公司 | Scene depth and camera motion prediction method and device, electronic device and medium |
CN114549612A (en) * | 2022-02-25 | 2022-05-27 | 北京百度网讯科技有限公司 | Model training and image processing method, device, equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
LING LI ET AL.: "Unsupervised-Learning-Based Continuous Depth and Motion Estimation With Monocular Endoscopy for Virtual Reality Minimally Invasive Surgery", 《IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112749758B (en) | Image processing method, neural network training method, device, equipment and medium | |
CN114511758A (en) | Image recognition method and device, electronic device and medium | |
CN112967355B (en) | Image filling method and device, electronic equipment and medium | |
CN114972958B (en) | Key point detection method, neural network training method, device and equipment | |
CN115511779B (en) | Image detection method, device, electronic equipment and storage medium | |
CN116228867B (en) | Pose determination method, pose determination device, electronic equipment and medium | |
CN112967356A (en) | Image filling method and device, electronic device and medium | |
CN116205819B (en) | Character image generation method, training method and device of deep learning model | |
CN115661375B (en) | Three-dimensional hair style generation method and device, electronic equipment and storage medium | |
CN115761855B (en) | Face key point information generation, neural network training and three-dimensional face reconstruction method | |
CN115393514A (en) | Training method of three-dimensional reconstruction model, three-dimensional reconstruction method, device and equipment | |
CN114119935B (en) | Image processing method and device | |
CN115601555A (en) | Image processing method and apparatus, device and medium | |
CN114429678A (en) | Model training method and device, electronic device and medium | |
CN114998403A (en) | Depth prediction method, depth prediction device, electronic apparatus, and medium | |
CN115797455B (en) | Target detection method, device, electronic equipment and storage medium | |
CN115423827B (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN114821233B (en) | Training method, device, equipment and medium of target detection model | |
CN115512131B (en) | Image detection method and training method of image detection model | |
CN115578451B (en) | Image processing method, training method and device of image processing model | |
CN115131562B (en) | Three-dimensional scene segmentation method, model training method, device and electronic equipment | |
CN115762515B (en) | Processing and application method, device and equipment for neural network for voice recognition | |
CN117218499A (en) | Training method of facial expression capturing model, facial expression driving method and device | |
CN115861425A (en) | Method, apparatus, electronic device, and medium for determining camera pose | |
CN115953512A (en) | Expression generation method, neural network training method, device, equipment and medium |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220902 |
|
RJ01 | Rejection of invention patent application after publication |