CN115861425A - Method, apparatus, electronic device, and medium for determining camera pose - Google Patents

Method, apparatus, electronic device, and medium for determining camera pose Download PDF

Info

Publication number
CN115861425A
CN115861425A CN202211616091.2A CN202211616091A CN115861425A CN 115861425 A CN115861425 A CN 115861425A CN 202211616091 A CN202211616091 A CN 202211616091A CN 115861425 A CN115861425 A CN 115861425A
Authority
CN
China
Prior art keywords
video frames
subset
pose
video
loss value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211616091.2A
Other languages
Chinese (zh)
Inventor
宋春雨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202211616091.2A priority Critical patent/CN115861425A/en
Publication of CN115861425A publication Critical patent/CN115861425A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The disclosure provides a method, a device, an electronic device and a medium for determining a camera pose, and relates to the field of data processing, in particular to the field of image processing and artificial intelligence. The method can comprise the following steps: acquiring a plurality of video frames; obtaining a corresponding output pose matrix from corresponding initial pose matrices of a first subset of video frames of the plurality of video frames, the initial pose matrix of each video frame being based on an IMU measurement pose matrix at a capture time of the video frame; determining at least one loss value based on the output pose matrix; in response to determining that the adjustment ending condition is not satisfied: adjusting parameters of a non-linear optimization model based on the at least one loss value; and obtaining a corresponding output pose matrix from a corresponding initial pose matrix of a second subset of video frames of the plurality of video frames using the adjusted nonlinear optimization model; and in response to determining that the adjustment-ending condition is satisfied, determining the respective output pose matrix as the camera pose of the corresponding video frame.

Description

Method, apparatus, electronic device, and medium for determining camera pose
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to image processing and artificial intelligence, and in particular, to a method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product for determining a pose of a camera.
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, and the like: 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 various application scenes such as video processing and image processing, including but not limited to scenes such as panorama stitching, further calculation of data based on camera pose is required. Therefore, a method of obtaining an accurate pose between adjacent frames is desired.
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 present disclosure provides a method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product for determining a pose of a camera.
According to an aspect of the present disclosure, there is provided a method for determining a camera pose, including: acquiring a plurality of video frames; obtaining, using a non-linear optimization model, respective output pose matrices from respective initial pose matrices of a first subset of video frames of the plurality of video frames, wherein the first subset of video frames comprises at least two consecutive video frames, the initial pose matrix of each video frame being based on an IMU measurement pose matrix obtained by an inertial measurement unit IMU at a time of capture of the video frame; determining at least one loss value based on the respective output pose matrices of the first subset of video frames; in response to determining that the adjustment ending condition is not satisfied: adjusting parameters of the nonlinear optimization model based on the at least one loss value; and obtaining, using the adjusted nonlinear optimization model, a respective output pose matrix from a respective initial pose matrix of a second subset of video frames of the plurality of video frames, wherein the second subset of video frames includes at least two video frames in succession and the second subset of video frames has at least one shared video frame with the first subset of video frames; and in response to determining that the adjustment-ending condition is satisfied, determining the respective output pose matrix as the camera pose of the corresponding video frame.
According to another aspect of the present disclosure, there is provided an apparatus for determining a camera pose, comprising: a video frame determination unit for acquiring a plurality of video frames; a first output pose matrix obtaining unit configured to obtain, using a non-linear optimization model, a respective output pose matrix from a respective initial pose matrix of a first subset of video frames of the plurality of video frames, wherein the first subset of video frames includes at least two consecutive video frames, and the initial pose matrix of each video frame is based on an IMU measurement pose matrix obtained by an inertial measurement unit IMU at a capture time of the video frame; a loss value determination unit for determining at least one loss value based on the respective output pose matrix of the first subset of video frames; a model adjustment unit for adjusting parameters of the nonlinear optimization model based on the at least one loss value in response to determining that an adjustment end condition is not satisfied; a second output pose matrix obtaining unit, configured to obtain, using the adjusted nonlinear optimization model, a corresponding output pose matrix from a corresponding initial pose matrix of a second subset of video frames of the plurality of video frames in response to determining that the adjustment end condition is not satisfied, wherein the second subset of video frames includes at least two video frames in succession and the second subset of video frames has at least one shared video frame with the first subset of video frames; and a camera pose determination unit for determining the respective output pose matrix as the camera pose of the corresponding video frame in response to determining that the adjustment end condition is satisfied.
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 method for determining a camera pose 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 having stored thereon computer instructions for causing the computer to perform a method for determining a camera pose 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 method for determining a camera pose according to one or more embodiments of the present disclosure.
According to one or more embodiments of the present disclosure, the camera pose can be obtained more accurately.
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 illustration 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, in accordance with embodiments of the present disclosure;
fig. 2 shows a flow diagram of a method for determining a camera pose according to an embodiment of the present disclosure;
fig. 3 shows a flow diagram of a method for determining a camera pose according to another embodiment of the present disclosure;
fig. 4 shows a block diagram of an apparatus for determining camera pose 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 the 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 elements may be one or more. 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 example 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 method for determining camera pose 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 determine camera poses, etc. 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.
Client devices 101, 102, 103, 104, 105, and/or 106 may include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and so forth. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, linux, or Linux-like operating systems (e.g., GOOGLE Chrome OS); or include various Mobile operating systems such as MICROSOFT Windows Mobile OS, iOS, windows Phone, android. Portable handheld devices may include cellular telephones, smart phones, tablets, personal Digital Assistants (PDAs), and the like. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. The gaming system may include a variety of handheld gaming devices, internet-enabled gaming devices, and the like. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), short Message Service (SMS) applications, and may use a variety of communication protocols.
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 method 200 for determining a camera pose according to an exemplary embodiment of the present disclosure is described below with reference to fig. 2.
At step S201, a plurality of video frames are acquired.
At step S202, a respective output pose matrix is obtained from a respective initial pose matrix of a first subset of video frames of the plurality of video frames using a non-linear optimization model, wherein the first subset of video frames comprises at least two video frames in succession, the initial pose matrix of each video frame being based on the IMU measurement pose matrix obtained by the inertial measurement unit IMU at the moment of capture of that video frame.
At step S203, in response to determining that the adjustment end condition is not satisfied: adjusting parameters of the nonlinear optimization model based on the at least one loss value; and obtaining a corresponding output pose matrix from a corresponding initial pose matrix of a second subset of video frames of the plurality of video frames using the adjusted nonlinear optimization model, wherein the second subset of video frames includes at least two consecutive video frames and the second subset of video frames has at least one shared video frame with the first subset of video frames.
At step S204, at least one loss value is determined based on the respective output pose matrix of the first subset of video frames.
At step S205, in response to determining that the adjustment end condition is satisfied, the respective output pose matrix is determined as the camera pose of the corresponding video frame.
According to the method, the camera pose can be obtained more accurately. Specifically, by using the IMU pose as the initial pose, model convergence can be promoted, and the camera pose can be determined more accurately and quickly.
According to some embodiments, the second video frame comprises at least one video frame not comprised in the first subset of video frames.
By executing the method for the video frames one by one and iteratively, the stability of the video frames which are already calculated is ensured on one hand, and a better calculation effect is obtained for new video frames by utilizing the video frames which are already calculated on the other hand.
For example, the respective initial pose matrix for the second subset of video frames is determined by: for the at least one shared video frame, adopting an output pose matrix subjected to last nonlinear optimization as an initial pose matrix; and for the at least one video frame not included in the first subset of video frames, employing the IMU measurement pose matrix as an initial pose matrix.
According to some embodiments, the method 200 may further comprise, prior to obtaining the respective output pose matrix from the respective initial pose matrix for a first subset of video frames of the plurality of video frames using a non-linear optimization model, in response to determining that no non-linear optimization has been performed on any video frame of the first subset of video frames: selecting the earliest two video frames in the plurality of video frames as the first video frame subset; and using the corresponding IMU measurement pose matrices of the two video frames as respective initial pose matrices.
For example, for video frame numbers 0123456 \8230;, the following sequence may be employed: the video frame 01 is calculated first, then the video frame 012 (or 12) is calculated, and then the 0123 (or 23) is calculated.
According to some embodiments, the at least one loss value comprises a first loss value representing a sum of reprojection errors of at least one video frame of the consecutive at least two video frames, respectively, onto the remaining video frames.
Through calculation of the reprojection error, angles between adjacent frames are consistent, and therefore accurate camera pose can be guaranteed.
As one example, a pre-trained feature extraction model may be employed, a sequence of features is obtained from the plurality of video frames, and a reprojection error is calculated based on image features of the at least two consecutive video frames.
According to some embodiments, the at least one loss value comprises a second loss value representing a difference between, for at least one pair of video frames of the consecutive at least two video frames: a difference in the corresponding output pose matrix between a pair of video frames, and a difference in the corresponding IMU measurement pose matrix between a pair of video frames.
The second penalty can be used to ensure that the pose matrix differences of two adjacent needles are consistent with the IMU pose differences — this is based on the following assumption: although the IMU measurement matrix may have errors, the rotational difference between the two frames is substantially accurate.
In particular, in a panoramic photo capture scene, the rotation value of such IMU matrix (i.e., the difference between two frames) will be accurate or substantially accurate assuming pure rotation with little translational motion.
According to some embodiments, the adjustment ending condition comprises that the at least one loss value satisfies a corresponding threshold value, respectively. In such a case, the calculation is ended when the loss value satisfies the threshold value, thereby obtaining the corresponding camera pose.
According to some embodiments, the adjusting an end condition further comprises that all video frames of the plurality of video frames are non-linearly optimized.
In such an embodiment, the calculation is not completed until all frames have been optimized. For example, for all video frames {0,1,2,3,4,5,6,7,8,9}, the processing for video frames 0,1;1,2;2,3;3,4;4,5;5,6;6,7;7,8; and 8,9, and finishing the calculation when the corresponding loss values respectively meet the threshold values, thereby obtaining the corresponding camera pose.
According to some embodiments, the method 200 may further comprise, after adjusting the parameters of the non-linear optimization model based on the at least one loss value: obtaining, using the adjusted nonlinear optimization model, again from the respective initial pose matrices of the first subset of video frames, adjusted respective output pose matrices for the first subset of video frames; determining a third loss value based on the adjusted respective output pose matrices for the first subset of video frames; and in response to the third loss value not satisfying a corresponding threshold, defining an image feature in the first subset of video frames that is associated with the third loss value as an outlier; and wherein, in response to determining that the outlier is included in the at least one shared video frame, obtaining a respective output pose matrix from a respective initial pose matrix of a second subset of video frames of the plurality of video frames comprises: disregarding the outliers in the second subset of video frames when obtaining the corresponding output pose matrix.
After optimization, the loss value is calculated again (e.g., the third loss value may be calculated in the same manner as either of the first or second loss values, and may be, for example, a reprojection error); if the third penalty requirement cannot be met after optimization, outliers (e.g., pixels) are determined and outlier effects are not considered in later calculations to avoid error dilation.
According to some embodiments, the plurality of video frames are associated with the same panoramic photograph capture operation, and the determined camera pose is used to generate a panoramic photograph for the plurality of video frames based on the panoramic photograph capture operation.
The plurality of video frames are temporally adjacent video frames captured in the same panorama photograph taking operation. Because the panoramic photo has more shooting rotation and less translation, the utilization of the IMU is particularly beneficial.
In the application of the panoramic stitching algorithm, how to obtain the optimized pose between the adjacent frames is the key for realizing the panoramic stitching result. This also becomes a key issue in panoramic stitching applications. An IMU pose prior based nonlinear optimization algorithm in accordance with one or more embodiments of the present disclosure can solve this problem.
It is understood that the method according to one or more embodiments of the present disclosure may be applied to panorama tiled products or items, but the present disclosure is not limited thereto.
In the related technology, IMU pose prior is not mainly utilized, the image matching result is directly used, then the homography matrix is calculated, and then the rotation matrix is calculated through the nonlinear optimization homography matrix. The prior art solutions have several major disadvantages: the method has the advantages that robustness is not high, the requirement on a matching result is high, and if the matching result is poor, an accurate homography matrix cannot be calculated or even cannot be solved, so that splicing failure is caused; the method has the advantages of low efficiency, no IMU pose prior, relatively low overall efficiency and low nonlinear optimization convergence speed.
One or more embodiments of the present disclosure aim to accurately determine a camera pose. In particular, the input video frames are a time sequence of images taken for corpus stitching, mainly rotated (possibly with a few translations); the camera pose can be used for a panorama stitching algorithm.
Various exemplary steps of a method 300 according to one particular embodiment of the present disclosure are described next in connection with fig. 3.
At step S301, the IMU pose is taken as the initial pose for each frame. The acquisition order may also be fixed due to the IMU data.
At step S302, feature extraction and matching are performed. For example, feature extraction may be performed on each frame in sequence, feature matching may be performed on adjacent frames, and feature data and matching results may be stored.
At step S303, nonlinear optimization is performed. For example, an incremental nonlinear optimization may be performed according to the calculated matching pairs, for example, first, the 1 st frame of the 0 th frame is optimized; frame 0112, frame 011223, frame 01122334, \8230, and so on.
For example, nonlinear optimization may be performed using a ceres solution library or other methods as will occur to those of skill in the art.
At step S304, a first loss is calculated. In the optimization process, the reprojection error of the matched multi-frame matching characteristics can be used as a loss function, and the camera internal parameter matrix and the pose matrix of each frame are sequentially optimized.
As an example, the reprojection may be determined using the following calculation:
Figure BDA0004001754600000101
where pij is the projection of Xj in image i, and Xi and Xj are the matching features in images i and j. Pij may be obtained by calculation according to KR, and the calculation formula is as follows:
Figure BDA0004001754600000102
the re-projection error may mean a difference in pixel coordinates between two frames after projecting an image of one frame to coordinate values of another frame. As in the above equation, K may be a camera internal reference and R may be a pose (Rotation).
At step S305, a second loss is calculated. For example, the relative pose of the IMU between two frames can be used as a constraint to ensure that the pose results between 2 frames do not deviate significantly.
The expression "relative pose as a constraint" may mean that the difference in the poses of the two frames after update is made as equal as possible to the difference in the poses of the IMU. This is because, although the IMU may have errors, the relative rotation between the two frames is generally considered accurate.
At step S306, the error is recalculated and the outlier is determined. For example, after the first sub-optimization is finished, the re-projection error is recalculated by using the pose after the optimization, if the error exceeds a certain threshold, such as 5 pixels, the feature is considered as an outlier, and the next sub-optimization is not calculated again. The outlier feature may be in units of pixels, e.g., tens, hundreds of pixels, and the disclosure is not limited thereto.
According to such an embodiment, steps S304-S306 may be performed for frames numbered 0 and 1, then steps S304-S306 for frames numbered 1 and 2 (or 0,1, 2), steps S304-S306 8230for frames numbered 2 and 3 (or 0,1,2, 3), and so on. Each optimization may be performed on only the last frame or on all frames.
According to one or more embodiments of the present disclosure, it is possible to apply to a scene in which a plurality of video frames are rotated to be mainly photographed. According to one or more embodiments of the present disclosure, the output result may be a camera pose.
According to one or more embodiments of the disclosure, each application may be inputting image features for a model, and using IMU pose as initialization, iterating, converging under a model framework, and outputting a result; in other words, no additional model training step may be required.
An apparatus 400 for determining a camera pose according to an embodiment of the present disclosure is now described with reference to fig. 4. The apparatus 400 for determining a camera pose may include a video frame determining unit 401, a first output pose matrix obtaining unit 402, a loss value determining unit 403, a model adjusting unit 404, a second output pose matrix obtaining unit 405, and a camera pose determining unit 406. The video frame determination unit 401 may be used to obtain a plurality of video frames. The first output pose matrix obtaining unit 402 may be configured to obtain, using a non-linear optimization model, a respective output pose matrix from respective initial pose matrices of a first subset of video frames of the plurality of video frames, wherein the first subset of video frames comprises at least two video frames in succession, the initial pose matrix of each video frame being based on an IMU measurement pose matrix obtained by the inertial measurement unit IMU at the moment of capture of the video frame. The loss value determination unit 403 may be configured to determine at least one loss value based on the respective output pose matrix of the first subset of video frames. The model adjustment unit 404 may be configured to adjust a parameter of the non-linear optimization model based on the at least one loss value in response to determining that the adjustment termination condition is not satisfied. The second output pose matrix obtaining unit 405 may be configured to, in response to determining that the adjustment end condition is not satisfied, obtain, using the adjusted nonlinear optimization model, a corresponding output pose matrix from a corresponding initial pose matrix of a second subset of video frames of the plurality of video frames, wherein the second subset of video frames includes at least two consecutive video frames and the second subset of video frames has at least one shared video frame with the first subset of video frames. The camera pose determination unit 406 may be configured to determine the respective output pose matrix as the camera pose of the corresponding video frame in response to determining that the adjustment end condition is satisfied.
According to the device disclosed by the embodiment of the disclosure, the camera pose can be obtained more accurately.
According to some embodiments, the second video frame may comprise at least one video frame not comprised in the first subset of video frames.
According to some embodiments, apparatus 400 may further include means for, prior to obtaining a respective output pose matrix from a respective initial pose matrix for a first subset of video frames of the plurality of video frames using a non-linear optimization model, in response to determining that no non-linear optimization has been performed on any video frame of the first subset of video frames: selecting the earliest two video frames in the plurality of video frames as the first video frame subset; and using the corresponding IMU measurement pose matrices of the two video frames as respective initial pose matrices.
According to some embodiments, the at least one loss value may comprise a first loss value, which may represent a sum of reprojection errors of at least one video frame of the consecutive at least two video frames, respectively, to the remaining video frames.
According to some embodiments, the at least one loss value may comprise a second loss value, which may represent a difference between, for at least one pair of video frames of the consecutive at least two video frames: a difference in the corresponding output pose matrix between a pair of video frames, and a difference in the corresponding IMU measurement pose matrix between a pair of video frames.
According to some embodiments, the adjustment end condition may include that the at least one loss value satisfies a corresponding threshold value, respectively.
According to some embodiments, the adjusting the end condition may further include that all video frames of the plurality of video frames are non-linearly optimized.
According to some embodiments, the apparatus 400 may further include means for performing the following after adjusting the parameters of the non-linear optimization model based on the at least one loss value: obtaining, using the adjusted nonlinear optimization model, again from the respective initial pose matrices of the first subset of video frames, adjusted respective output pose matrices for the first subset of video frames; determining a third loss value based on the adjusted respective output pose matrices for the first subset of video frames; and in response to the third loss value not satisfying a corresponding threshold, defining an image feature in the first subset of video frames that is associated with the third loss value as an outlier; and wherein, in response to determining that the outlier is included in the at least one shared video frame, obtaining a respective output pose matrix from a respective initial pose matrix of a second subset of video frames of the plurality of video frames comprises: disregarding the outliers in the second subset of video frames when obtaining the corresponding output pose matrix.
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, there is also provided an electronic device, a readable storage medium, and a computer program product.
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 comprises a computing unit 501 which may perform various suitable 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 RAM503, 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 RAM503 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 methods 200 and/or 300 and variations thereof. For example, in some embodiments, methods 200 and/or 300, 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. When loaded into RAM503 and executed by computing unit 501, may perform one or more of the steps of methods 200 and/or 300, variations thereof, and the like, described above. Alternatively, in other embodiments, the computing unit 501 may be configured in any other suitable manner (e.g., by way of firmware) to perform the methods 200 and/or 300, variations thereof, and so forth.
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 code 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 code, when executed by the processor or controller, causes the functions/acts 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 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 may 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 may 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 with a combined 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.
Although 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 exemplary embodiments or examples and that the scope of the present invention is not 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 (20)

1. A method for determining a camera pose, comprising:
acquiring a plurality of video frames;
obtaining, using a non-linear optimization model, respective output pose matrices from respective initial pose matrices of a first subset of video frames of the plurality of video frames, wherein the first subset of video frames comprises at least two consecutive video frames, the initial pose matrix of each video frame being based on an IMU measurement pose matrix obtained by an inertial measurement unit IMU at a time of capture of the video frame;
determining at least one loss value based on the respective output pose matrices of the first subset of video frames;
in response to determining that the adjustment ending condition is not satisfied:
adjusting parameters of the nonlinear optimization model based on the at least one loss value; and
obtaining, using the adjusted nonlinear optimization model, a respective output pose matrix from a respective initial pose matrix of a second subset of video frames of the plurality of video frames, wherein the second subset of video frames includes at least two video frames in succession and the second subset of video frames has at least one shared video frame with the first subset of video frames; and
in response to determining that the adjustment-ending condition is satisfied, determining the respective output pose matrix as the camera pose of the corresponding video frame.
2. The method of claim 1, wherein the second video frame comprises at least one video frame not included in the first subset of video frames.
3. The method of claim 1 or 2, further comprising, prior to obtaining a respective output pose matrix from a respective initial pose matrix for a first subset of video frames of the plurality of video frames using a non-linear optimization model, in response to determining that no non-linear optimization has been performed on any video frame of the first subset of video frames:
selecting the first two video frames of the plurality of video frames as the first video frame subset; and
using the corresponding IMU measurement pose matrices of the two video frames as corresponding initial pose matrices.
4. The method according to any of claims 1-3, wherein the at least one loss value comprises a first loss value representing a sum of reprojection errors of at least one video frame of the consecutive at least two video frames, respectively, reprojected to the remaining video frames.
5. The method according to any of claims 1-4, wherein the at least one loss value comprises a second loss value representing a difference between, for at least one pair of video frames of the consecutive at least two video frames: a difference in the corresponding output pose matrix between a pair of video frames, and a difference in the corresponding IMU measurement pose matrix between a pair of video frames.
6. The method according to any of claims 1-5, wherein the adjustment end condition comprises that the at least one loss value satisfies a corresponding threshold value, respectively.
7. The method of claim 6, wherein the adjusting the end condition further comprises that all video frames of the plurality of video frames are non-linearly optimized.
8. The method of any of claims 1-7, further comprising, after adjusting parameters of the nonlinear optimization model based on the at least one loss value:
obtaining, using the adjusted nonlinear optimization model, again from the respective initial pose matrices of the first subset of video frames, adjusted respective output pose matrices for the first subset of video frames;
determining a third loss value based on the adjusted respective output pose matrices for the first subset of video frames; and
in response to the third loss value not satisfying a corresponding threshold, defining an image feature in the first subset of video frames that is associated with the third loss value as an outlier; and is
Wherein, in response to determining that the outlier is included in the at least one shared video frame, obtaining a respective output pose matrix from a respective initial pose matrix of a second subset of video frames of the plurality of video frames comprises: disregarding the outliers in the second subset of video frames when obtaining the corresponding output pose matrix.
9. The method of any of claims 1-8, wherein the plurality of video frames are associated with a same panoramic photograph capture operation, and the determined camera pose is used to generate a panoramic photograph for the plurality of video frames based on the panoramic photograph capture operation.
10. An apparatus for determining a camera pose, comprising:
a video frame determination unit for acquiring a plurality of video frames;
a first output pose matrix obtaining unit configured to obtain, using a non-linear optimization model, a respective output pose matrix from respective initial pose matrices of a first subset of video frames of the plurality of video frames, wherein the first subset of video frames includes at least two consecutive video frames, and the initial pose matrix of each video frame is based on an IMU measurement pose matrix obtained by an inertial measurement unit IMU at a capture time of the video frame;
a loss value determination unit for determining at least one loss value based on the respective output pose matrix of the first subset of video frames;
a model adjustment unit for adjusting parameters of the nonlinear optimization model based on the at least one loss value in response to determining that an adjustment end condition is not satisfied;
a second output pose matrix obtaining unit, configured to obtain, using the adjusted nonlinear optimization model, a corresponding output pose matrix from a corresponding initial pose matrix of a second subset of video frames of the plurality of video frames in response to determining that the adjustment end condition is not satisfied, wherein the second subset of video frames includes at least two video frames in succession and the second subset of video frames has at least one shared video frame with the first subset of video frames; and
a camera pose determination unit to determine the respective output pose matrix as a camera pose of the corresponding video frame in response to determining that the adjustment end condition is satisfied.
11. The apparatus of claim 10, wherein the second video frame comprises at least one video frame not included in the first subset of video frames.
12. The apparatus of claim 10 or 11, further comprising, prior to obtaining a respective output pose matrix from a respective initial pose matrix for a first subset of video frames of the plurality of video frames using a non-linear optimization model, in response to determining that no non-linear optimization has been performed on any video frame of the first subset of video frames, means for:
selecting the earliest two video frames in the plurality of video frames as the first video frame subset; and
using the corresponding IMU measurement pose matrices of the two video frames as corresponding initial pose matrices.
13. The apparatus according to any of claims 10-12, wherein the at least one loss value comprises a first loss value representing a sum of reprojection errors of at least one video frame of the consecutive at least two video frames, respectively, reprojected to the remaining video frames.
14. The apparatus according to any of claims 10-13, wherein the at least one loss value comprises a second loss value representing a difference between, for at least one pair of video frames of the consecutive at least two video frames: a difference in the corresponding output pose matrix between a pair of video frames, and a difference in the corresponding IMU measurement pose matrix between a pair of video frames.
15. The apparatus of any of claims 10-14, wherein the adjustment termination condition comprises the at least one loss value satisfying a corresponding threshold, respectively.
16. The apparatus of claim 15, wherein the adjustment termination condition further comprises that all video frames of the plurality of video frames are non-linearly optimized.
17. The apparatus of any of claims 10-16, further comprising means for performing the following after adjusting parameters of the non-linear optimization model based on the at least one loss value:
obtaining, using the adjusted nonlinear optimization model, again from the respective initial pose matrices of the first subset of video frames, adjusted respective output pose matrices for the first subset of video frames;
determining a third loss value based on the adjusted respective output pose matrices for the first subset of video frames; and
in response to the third loss value not satisfying a corresponding threshold, defining an image feature in the first subset of video frames that is associated with the third loss value as an outlier; and is provided with
Wherein, in response to determining that the outlier is included in the at least one shared video frame, obtaining a respective output pose matrix from a respective initial pose matrix of a second subset of video frames of the plurality of video frames comprises: disregarding the outliers in the second subset of video frames when obtaining the corresponding output pose matrix.
18. 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-9.
19. 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-9.
20. A computer program product comprising a computer program, wherein the computer program realizes the method of any one of claims 1-9 when executed by a processor.
CN202211616091.2A 2022-12-15 2022-12-15 Method, apparatus, electronic device, and medium for determining camera pose Pending CN115861425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211616091.2A CN115861425A (en) 2022-12-15 2022-12-15 Method, apparatus, electronic device, and medium for determining camera pose

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211616091.2A CN115861425A (en) 2022-12-15 2022-12-15 Method, apparatus, electronic device, and medium for determining camera pose

Publications (1)

Publication Number Publication Date
CN115861425A true CN115861425A (en) 2023-03-28

Family

ID=85673313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211616091.2A Pending CN115861425A (en) 2022-12-15 2022-12-15 Method, apparatus, electronic device, and medium for determining camera pose

Country Status (1)

Country Link
CN (1) CN115861425A (en)

Similar Documents

Publication Publication Date Title
CN115147558B (en) Training method of three-dimensional reconstruction model, three-dimensional reconstruction method and device
EP4033444A2 (en) Method and apparatus for enhancing image quality, device, and medium
CN115631418B (en) Image processing method and device and training method of nerve radiation field
CN114972958B (en) Key point detection method, neural network training method, device and equipment
CN112967196A (en) Image restoration method and device, electronic device and medium
CN115239888B (en) Method, device, electronic equipment and medium for reconstructing three-dimensional face image
CN112967356A (en) Image filling method and device, electronic device and medium
CN115482325A (en) Picture rendering method, device, system, equipment and medium
CN114627268A (en) Visual map updating method and device, electronic equipment and medium
CN111523467B (en) Face tracking method and device
CN115578515B (en) Training method of three-dimensional reconstruction model, three-dimensional scene rendering method and device
CN114461078B (en) Man-machine interaction method based on artificial intelligence
CN115393514A (en) Training method of three-dimensional reconstruction model, three-dimensional reconstruction method, device and equipment
CN115965939A (en) Three-dimensional target detection method and device, electronic equipment, medium and vehicle
CN116245998A (en) Rendering map generation method and device, and model training method and device
CN116030185A (en) Three-dimensional hairline generating method and model training method
CN115601555A (en) Image processing method and apparatus, device and medium
CN114120448A (en) Image processing method and device
CN114071024A (en) Image shooting method, neural network training method, device, equipment and medium
CN115861425A (en) Method, apparatus, electronic device, and medium for determining camera pose
CN114092556A (en) Method, apparatus, electronic device, medium for determining human body posture
CN115797455B (en) Target detection method, device, electronic equipment and storage medium
CN116246026B (en) Training method of three-dimensional reconstruction model, three-dimensional scene rendering method and device
CN116030191B (en) Method, device, equipment and medium for displaying virtual object
CN115423827B (en) Image processing method, image processing device, electronic equipment and storage 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