# Patent

## Title
Camera pose estimation for 3D reconstruction

## Abstract

Camera pose estimation for 3D reconstruction is described, for example, to enable position and orientation of a depth camera moving in an environment to be tracked for robotics, gaming and other applications. In various embodiments, depth observations from the mobile depth camera are aligned with surfaces of a 3D model of the environment in order to find an updated position and orientation of the mobile depth camera which facilitates the alignment. For example, the mobile depth camera is moved through the environment in order to build a 3D reconstruction of surfaces in the environment which may be stored as the 3D model. In examples, an initial estimate of the pose of the mobile depth camera is obtained and then updated by using a parallelized optimization process in real time.

## Background
BACKGROUND
For many applications it is valuable to be able to track orientation and position of a camera as it moves in an environment. Orientation and position of a camera is known as camera pose. For example, in robotics, vehicle navigation, computer game applications, medical applications and other problem domains. Previous approaches have involved using color images captured by moving cameras, identifying features in those images such as lines and edges and tracking that information in a sequence of color images captured by the camera to try and estimate relative camera position. Existing approaches are limited in accuracy, robustness and speed. However, for many applications, accurate camera tracking is required in real-time, for example, in order that a robot may successfully move about in its environment.
The embodiments described below are not limited to implementations which solve any or all of the disadvantages of known camera pose estimation processes.
SUMMARY
The following presents a simplified summary of the disclosure in order to provide a basic understanding to the reader. This summary is not an extensive overview of the disclosure and it does not identify key/critical elements or delineate the scope of the specification. Its sole purpose is to present a selection of concepts disclosed herein in a simplified form as a prelude to the more detailed description that is presented later.
Camera pose estimation for 3D reconstruction is described, for example, to enable position and orientation of a depth camera moving in an environment to be tracked for robotics, gaming and other applications. In various embodiments, depth observations from the mobile depth camera are aligned with surfaces of a 3D model of the environment in order to find an updated position and orientation of the mobile depth camera which facilitates the alignment. For example, the mobile depth camera is moved through the environment in order to build a 3D reconstruction of surfaces in the environment which may be stored as the 3D model. In examples, an initial estimate of the pose of the mobile depth camera is obtained and then updated by using a parallelized optimization process in real time.
Many of the attendant features will be more readily appreciated as the same becomes better understood by reference to the following detailed description considered in connection with the accompanying drawings.



DESCRIPTION OF THE DRAWINGS
The present description will be better understood from the following detailed description read in light of the accompanying drawings, wherein:
FIG. 1 is a schematic diagram of a person in a room holding a mobile depth camera which may be used for real-time camera tracking and optionally also to produce a dense 3D model or map of the room;
FIG. 2 is a plan view of a floor of a building which is being explored by a person holding a mobile depth camera;
FIG. 3 is a schematic diagram of a mobile depth camera connected to a real-time camera tracking system, a dense 3D model formation system and a game system;
FIG. 4 is a schematic diagram of an example camera pose engine;
FIG. 5 is a flow diagram of a method at a camera pose engine
FIG. 6 is a flow diagram of part of the method of FIG. 5;
FIG. 7 shows methods which may be used as part of the method of FIG. 6;
FIG. 8 is a flow diagram of methods of computing quantities related to residuals as part of the process of FIG. 6;
FIG. 9 is a schematic diagram illustrating ways of checking whether convergence is reached for use in the method of FIG. 5;
FIG. 10 is a schematic diagram illustrating ways of obtaining an initial estimate of camera pose registration parameters;
FIG. 11 illustrates an exemplary computing-based device in which embodiments of a real-time camera pose estimation system may be implemented.



Like reference numerals are used to designate like parts in the accompanying drawings.
DETAILED DESCRIPTION
The detailed description provided below in connection with the appended drawings is intended as a description of the present examples and is not intended to represent the only forms in which the present example may be constructed or utilized. The description sets forth the functions of the example and the sequence of steps for constructing and operating the example. However, the same or equivalent functions and sequences may be accomplished by different examples.
Although the present examples are described and illustrated herein as being implemented in a real-time camera pose estimation system (also referred to as a camera tracking system) using depth images obtained from a mobile depth camera which emits and captures infra-red light, the system described is provided as an example and not a limitation. As those skilled in the art will appreciate, the present examples are suitable for application in a variety of different types of real-time camera tracking systems including but not limited to those using depth information obtained from stereo cameras and those using depth information obtained by emitting and capturing other types of electromagnetic radiation.
The term “image element” is used in this document to refer to a pixel, group of pixels, voxel, group of voxels, or other higher level component of an image.
The term “dense 3D model” is used in this document to refer to a representation of a three dimensional scene comprising objects and surfaces where that representation comprises detail about image elements of that scene. In contrast non-dense 3D models may comprise polygon-based or point-based representations of objects. In an example, all or many points from an incoming depth map may be used to describe surfaces (using a signed distance function isosurface representation in some examples) in the environment and this description forms a dense 3D model. A sparse model would only take a subset of the points to speed up calculations and reduce memory footprint.
FIG. 1 is a schematic diagram of a person 100 standing in a room and holding a mobile depth camera 102 which in this example also incorporates a projector which is projecting the image of a cat 108 into the room. The room contains various objects 106 such as a chair, door, window, plant, light and another person 104. Many of the objects 106 are static although some of the objects such as person 104 may move. As the person moves around the room the mobile depth camera captures images which are used by a real-time camera tracking system 112 to monitor the location and orientation of the camera in the room. The real-time camera tracking system 112 may be integral with the mobile depth camera 102 or may be at another location provided that it is able to receive communication from the mobile depth camera 102, either directly or indirectly. For example, the real-time camera tracking system 112 may be provided at a personal computer, dedicated computer game apparatus, or other computing device in the room and in wireless communication with the mobile depth camera 102. In other examples the real-time camera tracking system 112 may be elsewhere in the building or at another remote location in communication with the mobile depth camera 102 using a communications network of any suitable type. The mobile depth camera 102 is also in communication with a dense 3D model 110 of the environment (which in this case is a 3D model of the room) or another type of map of the environment. For example, images captured by the mobile depth camera 102 are used to form and build up the dense 3D model of the environment as the person moves about the room. The real-time camera tracking system 112 may track the position of the camera in relation to the 3D model 110 or map of the environment. The outputs of the real-time camera tracking system 112 and dense 3D model 110 or map may be used by a game system or other application although that is not essential. For example, a projector at the mobile depth camera 102 may be arranged to project images depending on the output of the real-time camera tracking system 112 and 3D model 110.
FIG. 2 is a plan view of a floor 200 of a building. A person 202 holding a mobile depth camera 204 is moving around the floor as indicated by dotted arrows 208. The person walks along a corridor 206 past rooms and furniture 210. The real-time camera tracking system 112 is able to track the position of the mobile depth camera 204 as it moves and a 3D model or map of the floor is formed. It is not essential for a person 202 to carry the mobile depth camera 204. In other examples the mobile depth camera 204 is mounted on a robot or vehicle. This also applies to the example of FIG. 1.
FIG. 3 is a schematic diagram of a mobile environment sensor 300 for use with a real-time camera tracker 316, dense model formation system 324 and optionally a game system 332. The mobile environment sensor 300 comprises a depth camera 302 which is arranged to capture sequences of depth images of a scene. Each depth image or depth map frame 314 comprises a two dimensional image in which each image element comprises a depth value such as a length or distance from the camera to an object in the captured scene which gave rise to that image element. This depth value may be an absolute value provided in specified units of measurement such as meters, or centimeters or may be a relative depth value. In some cases the depth value may be a disparity value such as in situations where stereo depth information is available. In each captured depth image there may be around 300,000 or more image elements each having a depth value. The frame rate is high enough to enable the depth images to be used for working robotics, computer game or other applications. For example, at least 20 frames per second.
The depth information may be obtained using any suitable technique including but not limited to, time of flight, structured light, stereo images. In some examples the depth camera is able to organize the depth information into Z layers that are perpendicular to a Z axis extending along a line of sight of the depth camera.
The mobile environment sensor 300 may also comprise an emitter 304 arranged to illuminate the scene in such a manner that depth information may be ascertained by the depth camera 302. For example, in the case that the depth camera 302 is an infra-red (IR) time-of-flight camera, the emitter 304 emits IR light onto the scene, and the depth camera 302 is arranged to detect backscattered light from the surface of one or more objects in the scene. In some examples, pulsed infrared light may be emitted from the emitter 304 such that the time between an outgoing light pulse and a corresponding incoming light pulse may be detected by the depth camera and measure and used to determine a physical distance from the environment sensor 300 to a location on objects in the scene. Additionally, in some examples, the phase of the outgoing light wave from the emitter 304 may be compared to the phase of the incoming light wave at the depth camera 302 to determine a phase shift. The phase shift may then be used to determine a physical distance from the mobile environment sensor 300 to a location on the objects by analyzing the intensity of the reflected beam of light over time via various techniques including, for example, shuttered light pulse imaging.
In another example, the mobile environment sensor 300 can use structured light to capture depth information. In such a technique patterned light (e.g. light displayed as a known pattern such as a grid or stripe pattern) may be projected onto a scene using the emitter 304. Upon striking the surface of objects in the scene the pattern becomes deformed. Such a deformation of the pattern is captured by the depth camera 302 and analyzed to determine an absolute or relative distance from the depth camera 302 to the objects in the scene. In some cases, the mobile environment sensor 300 emits a spatially varying and/or time varying pattern of electromagnetic radiation and that pattern is calibrated so that when an image is received by the depth camera 302 it is able to perform pattern matching against a database of patterns and thus calculate depth information. This can be thought of as a 3D pattern of dots being projected into the environment, and wherever there is a surface that pattern is reflected so the depth camera 302 can detect it and calculate the distance of that surface from the depth camera 302.
In another example, the depth camera 302 comprises a pair of stereo camera such that visual stereo data is obtained and resolved to generate relative depth information. In this case the emitter 304 may be used to illuminate the scene or may be omitted.
In some examples, in addition to the depth camera 302, the mobile environment sensor 300 comprises a color video camera referred to as an RGB camera 306. The RGB camera 306 is arranged to capture sequences of images of the scene at visible light frequencies.
The mobile environment sensor 300 may comprise an orientation sensor 308 such as an inertial measurement unit (IMU), accelerometer, gyroscope, compass or other orientation sensor 308. However, it is not essential to use an orientation sensor. The mobile environment sensor 300 may comprise a location tracking device such as a GPS 310 although this is not essential.
The mobile environment sensor may comprise a projector 312 as mentioned above with reference to FIG. 1 although this is not essential.
The mobile environment sensor also comprises one or more processors, a memory and a communications infrastructure as described in more detail below.
The mobile environment sensor may be provided in a housing which is shaped and sized to be hand held by a user or worn by a user. In other examples the mobile environment sensor is sized and shaped to be incorporated or mounted on a vehicle, toy or other movable apparatus.
The mobile environment sensor 300 is connected to a real-time tracker 316. This connection may be a physical wired connection or may use wireless communications. In some examples the mobile environment sensor 300 is connected indirectly to the real-time tracker over one or more communications networks such as the internet.
The real-time tracker 316 is computer implemented using a general purpose microprocessor controlling one or more graphics processing units (GPUs). It comprises a camera pose engine 318 and optionally a loop closure engine 320 and a relocalization engine 322. The real-time tracker 316 takes depth map frames 314 from the depth camera 302, and optionally also input from the mobile environment sensor 300, optional map data 334 and optional data from a game system 332. The real-time tracker operates to compute the camera pose from the 3D model 326 and the depth map frame 314 sequence in order to produce a real-time series 328 of six degree of freedom pose estimates of the depth camera 302. It may also produce transformation parameters (also referred to as registration parameters) for transforms between pairs of depth map frames. In some examples the real-time tracker operates on pairs of depth map frames 314 from the depth camera in order to produce an initial estimate of camera pose. In various examples, the real-time tracker 316 takes a single depth map frame 314 and aligns that with a dense 3D model 326 of the scene. In some examples the real-time tracker uses color video input from the RGB camera 306 in order to produce an initial estimate of camera pose.
For example, in some embodiments the real-time tracker 316 provides output to a dense 3D model formation system 324 which uses that information together with the depth map frames 314 to form and store a dense 3D model of the scene or environment in which the mobile environment sensor 300 is moving. For example, in the case of FIG. 1 the 3D model would be a 3D model of the surfaces and objects in the room. In the case of FIG. 2 the 3D model would be a 3D model of the floor of the building including the objects and surfaces on that floor of the building. The dense 3D model 326 may be stored in GPU memory or in other ways. For example, the dense 3D model may be stored as a linear array in slice-row-column order, optionally with some padding so that slices and rows align certain memory block sizes. For example, the model may be stored in GPU texture memory or it may be stored as a linear array of memory locations used to represent a 3D volume. This may be achieved by mapping each voxel (or other 3D image element such as a group of voxels) to a memory array index using a linear pitched memory which provides fast, parallel access to the data stored on the parallel computing unit memory. Each voxel may store a numerical value which may be zero at a surface represented by the model, positive outside objects represented by the model and negative inside objects represented by the model, where the magnitude of the numerical value is related to distance from the closest surface represented by the model.
The mobile environment sensor 300 may be used in conjunction with a game system 332 which is connected to a display 330. For example, the game may be a golf game, boxing game, motor car racing game or other type of computer game. Data from the game system 332 such as the game state or meta data about the game may be provided to the real-time tracker 316. Also, information from the real-time tracker may be used by the game system 332 to influence the course of a game. Information from the 3D model may also be used by the game system 332 to influence the course of a game.
Map data 334 is optionally available to the real-time tracker 316. For example, this may be an architect's drawing of the environment (e.g. room or floor of building), the location of landmarks known in the environment, a map of the environment available from another source.
The camera pose engine 318 of the real-time tracker is arranged to compute the camera pose by finding a camera pose which gives a good alignment of a depth map frame with the dense 3D model. It uses an iterative process which may be implemented using one or more graphics processing units, or using multiple CPU cores, in order that the camera pose engine operates in real-time. More detail about the camera pose engine is given below with reference to FIG. 4. In contrast, previous approaches have used iterative closest point (ICP) algorithms to track camera pose. By using a camera pose engine 318 which calculates a camera pose which gives a good alignment of a depth map frame with surfaces depicted in the 3D model of the camera's environment, a faster and more accurate camera tracking is achieved (with respect to previous ICP approaches). The camera pose engine 318 is also robust to sudden large movements as initial estimates of the camera pose may be computed, for example, as described with reference to FIG. 10 below.
The loop closure engine is arranged to detect when the mobile environment sensor has moved in a loop so that the scene depicted in the current depth frame is at least partially overlapping with that of a previous depth frame which is not the immediately preceding depth frame. For example, this may occur when a user walks around the whole floor of the building in FIG. 2 and reaches the starting point again. It may also occur when a user moves around a room behind some furniture and out again to the original start position, or close to that original start position.
The relocalization engine 322 is arranged to deal with the situation where the real-time tracker loses the current location of the mobile environment sensor 300 and relocalizes or finds the current location again.
The processing performed by the real-time tracker 316 and/or the dense 3D model formation system 324 can, in one example, be executed remotely from the location of the mobile environment sensor 300. For example, the mobile environment sensor 300 can be connected to (or comprise) a computing device having relatively low processing power, and which streams the depth images over a communications network to a server. The server has relatively high processing power, and performs the computationally complex tasks of the real-time tracker 316 and/or the dense 3D model formation system 324. The server can return a rendered image of the dense reconstruction per-frame to provide an interactive experience to the user, and also return the final dense 3D reconstruction on completion of the model, for subsequent local use (e.g. in a game). Such an arrangement avoids the need for the user to possess a high-powered local computing device.
In an example, input from an RGB camera at the mobile environment sensor may be used to complement information from the depth camera. This is useful in situations where depth does not provide adequate information for tracking, such as when a camera is moving in an environment with few depth features. If visual features are present in the environment these may be detected by the RGB camera and used to enable localization and mapping to be provided.
FIG. 4 is a schematic diagram of the camera pose engine 318 of FIG. 3 in more detail. The camera pose engine 408 is computer implemented at a computing device having one or more GPUs 416 or other parallel computing units and optionally also, texturing hardware. For example, the parallel computing units may be vector processors, single instruction multiple data (SIMD) architectures, graphics processing units or other parallel computing devices. It comprises optimization engine 412 for finding camera registration parameter values which align the depth map observations with the modeled environment surfaces. The camera pose engine receives the current depth map 400 from the depth camera. The camera pose engine has access to a dense 3D model of surfaces in the environment 406. For example, the 3D model comprises a 3D function which is a truncated signed distance function that is negative inside objects, positive outside objects and zero at surfaces. The model may be stored in system memory or GPU memory as described in more detail below. The camera pose engine may also receive optional additional data 402 such as color images, sensor data and other information which may be used to compute an initial estimate of camera pose registration parameters.
The output of the camera pose engine 408 is a set of registration parameters θ=(q,t) 414 of a transform from camera space to world space. In some examples these registration parameters are provided as a six degree of freedom (6DOF) pose estimate in the form of an SE3 matrix describing the rotation and translation of the depth camera 302 relative to real-world coordinates. More formally, the SE3 matrix which is a camera space to world space transformation matrix can be expressed as:




  
    T
    ⁡
    
      (
      θ
      )
    
  
  =
  
    (
    
      
        
          
            R
            ⁡
            
              (
              q
              )
            
          
        
        
          t
        
      
      
        
          0
        
        
          1
        
      
    
    )
  




The registration parameters may be a parameter vector θ=(q,t) where qε4 is a (normalized) quarternion representing a rotation, and tε3 represents a translation. R(q) is a 3×3 rotation matrix defined as




  
    R
    ⁡
    
      (
      q
      )
    
  
  =
  
    
      1
      
        
          
          q
          
        
        2
      
    
    ⁢
    
      (
      
        
          
            
              
                q
                0
                2
              
              +
              
                q
                1
                2
              
              -
              
                q
                2
                2
              
              -
              
                q
                3
                2
              
            
          
          
            
              2
              ⁢
              
                (
                
                  
                    
                      q
                      1
                    
                    ⁢
                    
                      q
                      2
                    
                  
                  -
                  
                    
                      q
                      0
                    
                    ⁢
                    
                      q
                      3
                    
                  
                
                )
              
            
          
          
            
              2
              ⁢
              
                (
                
                  
                    
                      q
                      1
                    
                    ⁢
                    
                      q
                      3
                    
                  
                  +
                  
                    
                      q
                      0
                    
                    ⁢
                    
                      q
                      2
                    
                  
                
                )
              
            
          
        
        
          
            
              2
              ⁢
              
                (
                
                  
                    
                      q
                      1
                    
                    ⁢
                    
                      q
                      2
                    
                  
                  +
                  
                    
                      q
                      0
                    
                    ⁢
                    
                      q
                      3
                    
                  
                
                )
              
            
          
          
            
              
                q
                0
                2
              
              -
              
                q
                1
                2
              
              +
              
                q
                2
                2
              
              -
              
                q
                3
                2
              
            
          
          
            
              2
              ⁢
              
                (
                
                  
                    
                      q
                      2
                    
                    ⁢
                    
                      q
                      3
                    
                  
                  -
                  
                    
                      q
                      0
                    
                    ⁢
                    
                      q
                      1
                    
                  
                
                )
              
            
          
        
        
          
            
              2
              ⁢
              
                (
                
                  
                    
                      q
                      1
                    
                    ⁢
                    
                      q
                      3
                    
                  
                  -
                  
                    
                      q
                      0
                    
                    ⁢
                    
                      q
                      2
                    
                  
                
                )
              
            
          
          
            
              2
              ⁢
              
                (
                
                  
                    
                      q
                      2
                    
                    ⁢
                    
                      q
                      3
                    
                  
                  +
                  
                    
                      q
                      0
                    
                    ⁢
                    
                      q
                      1
                    
                  
                
                )
              
            
          
          
            
              
                q
                0
                2
              
              -
              
                q
                1
                2
              
              -
              
                q
                2
                2
              
              +
              
                q
                3
                2
              
            
          
        
      
      )
    
  




Coordinates in camera space (i.e. from the camera perspective) can be mapped to real-world coordinates by multiplying by the transformation matrix T(θ) given above.
The registration parameters θ=(q,t) may be provided in any suitable form, not necessarily as a vector. These registration parameters are used by the real time tracker 316 to produce the real-time series of 6 degree of freedom pose estimates of the depth camera.
The optimization engine 412 for finding the camera registration parameter values which align the depth map observations with the modeled environment surfaces may optimize an energy function. The energy function expresses an aim of finding a camera pose which aligns well the observed depth map points and the model surface (once those quantities have been mapped into a form that enables a direct comparison).
An example of a suitable energy function is:

E(θ)=1⁄2Σi=0n-1d(HVT(θ){acute over (x)}i)2 

Which may be expressed in words as, an energy of a function of a camera pose registration parameter vector is equal to one half of the sum over image elements of the square of the truncated signed distance d given by the 3D model at the position of the current image element transformed by the current pose estimate. Matrix V transforms from world space to model space and matrix H is a formatting matrix.
The symbol xi denotes an observed surface point (from the depth map) for image element i. For example, let xiε3 for i=0, . . . , n−1 be the observed surface points in camera space obtained by back projecting the valid image elements of a depth map.
The symbol {acute over (x)}i denotes the promotion of a 3 element vector storing the observed surface point to a 4 element vector in order to facilitate calculation. More formally, let {acute over (x)} denote the promotion of an inhomogeneous vector xε3 to a homogeneous vector ε4 by appending a 1 to its elements, and let H=[I3|0] be the 3×4 matrix that strips the final row from its right-hand operand.
The symbol d represents a model distance value. For example, let d:3→[−1,1] be a truncated signed distance function evaluated at continuous valued positions by tri-linearly interpolating samples stored at voxel centres in the 3D model. Outside the discrete voxel grid d=1. The model of the surfaces in the environment is given by the level set d(•)=0.
The matrix V may be a 4×4 affine matrix representing a similarity transformation from world space to model space (also referred to as volume space). Volume space may refer to the discrete coordinates of a voxel grid, which in turn determines the memory location of the voxel elements. For example, the factors affecting V may be: the dimensions of the discrete voxel grid, the length of each voxel, and the position of the world origin within the volume.
The optimization engine 412 may use any suitable optimization process such as a Gauss-Newton method, a gradient descent method, a limited memory Broyden-Fletcher-Goldfarb-Shanno (LBFGS) method and a Levenberg-Marquardt method.
FIG. 5 is a flow diagram of an example iterative process at the optimization engine 412. An initial estimate of the registration parameters is obtained 500. These are the registration parameters of a transform for aligning the current and source frames. This initial estimate is formed in any suitable manner as described in more detail below with reference to FIG. 10.
An energy function is formed as described above with reference to FIG. 4 which expresses an aim of finding a camera pose which aligns well the observed depth map points and the model surface (once those quantities have been mapped into a form that enables a direct comparison). The initial estimate, the depth map data and the model data are used to compute the quantities of the energy function and find a possible solution 504 to an unknown increment to the initial estimate. A test is made to check 506 whether convergence has been reached. This check is a decision as to whether the iterative process is to continue or not. If the iterative process continues an update 510 is made to a parameter which controls the amount of change between iterations. For example, this parameter is increased to move away from local minima or decreased to speed convergence. The update 510 to the parameter is optional and may be omitted. If the iterative process ends the registration parameters are output 508. More detail about the check 506 is given below with reference to FIG. 9.
FIG. 6 is a flow diagram showing more detail of step 504 of FIG. 5 in which a possible solution to the energy function is found by the optimization engine. This process is repeated iteratively as indicated in FIG. 5 although the iteration is not indicated in FIG. 6.
The inputs to this process comprise the current camera pose estimate 600. For example, this is the estimate computed from the previous depth frame. When camera tracking is started, the current camera pose estimate may be an initial estimate obtained from a process as described below with reference to FIG. 10. Another input is the current depth map 606 from a frame stream 602 of depth maps captured by the camera. Another input is a camera calibration result 604 although this is optional.
The optimization engine maps 608 the observed depth points (from depth map 606) to model space to find model points corresponding to the observed depth points. Subsampling may be used whereby every nth depth point from the depth map is processed in order to reduce processing requirements. Distance values from the 3D surfaces 610 are computed from the model data. For example, this is achieved by using interpolation as described in more detail below with reference to FIG. 7.
Residuals are computed 612 by comparing the distance values of the model and the observed depth points from the depth map. An updated camera pose is then computed 614 which minimizes the residuals. More detail about how quantities relating to the residuals may be calculated in real time is given below with reference to FIG. 8.
More detail about how model distance values 610 may be computed from the model data in real time is now given. In some examples, the optimization engine obtains 704 voxel distance values from a plurality of voxels of the 3D model at and around the model point. The model position is a point from the depth map which is converted to model space. Any suitable number of voxels at and around the model position may be selected. Each voxel stores a distance value which is a truncated signed distance as described above. An interpolation 706, such as a tri-linear interpolation is calculated using the distance values of the selected voxels to obtain a distance value for the model position. Gradients of the model position distance values may also be calculated 708 using the selected voxels for use in the optimization.
In some examples, the camera pose engine comprises texturing hardware which is specialist computer graphics hardware for computing textures of surfaces. The texturing hardware may be used to compute depth values and gradients of the model positions in real time. Texturing hardware may comprise two elements: texture memory and texture sampling. Texture memory is an area of memory on a GPU used for storing textures. For example, the volume array may be stored in GPU texture memory. A GPU may have specialized hardware to perform interpolation on texture memory very efficiently. For example, tri-linear interpolation may be performed.
As mentioned above, the optimization engine 412 may use any suitable optimization process such as a Gauss-Newton method, a gradient descent method, a limited memory Broyden-Fletcher-Goldfarb-Shanno (LBFGS) method and a Levenberg-Marquardt method. In an example, a Levenberg-Marquardt method is used which comprises computing for each iteration of the optimization process, a solution to the following equation:

(JTJ+λI)δ=−JTr 

Which may be expressed in words as, an unknown vector δ which increments an initial estimate of the camera pose registration parameters, times JTJ (which is a square matrix given by the transpose of J multiplied on the right by J) plus a scalar times the identity matrix, is equal to the residuals times the negative of the transpose of J which is JT where J is the Jacobian of the residuals vector.
In this example, where a Levenberg-Marquardt method is used, a main computation for the optimization engine is to calculate the 7×7 (or other size) matrix JTJ at each iteration and also the 7×1 (or other size) vector JTr at each iteration. These quantities 800 which are related to the residuals may be computed, in the case that a multi-core computer is used, by accumulating 804 over image elements in parallel. In this way real time computation may be achieved. An optional subsampling 802 is used to speed up processing by selecting every nth image element of the depth image to be processed. In the case that a GPU is present at the camera pose estimation engine, a map reduce operation 806 may be used to compute the quantities 800 which are related to the residuals on a per image element basis. The results of the map operation computed for each image element may be aggregated at the reduce stage to calculate the updated camera pose estimate.
FIG. 9 gives more detail about how the decision check 506 on convergence may be made. For example the optimization engine may check the magnitude of the change in the camera pose at each iteration. If there is little or no change 900 then convergence is reached. In another example, the optimization engine may check the magnitude of the change in the increment to the camera pose at each iteration 902. If there is little or no change then convergence is reached. The optimization engine may check the rate of change of the calculated camera pose 904. If there is little or no change then convergence is reached. The optimization engine may check the size of the scalar quantity (updated at step 510 of FIG. 5 and referred to using symbol λ above) used to control the iteration. If this scalar is large then convergence may be reached. The optimization may use a combination of one or more of these or other criteria.
FIG. 10 gives more detail about how the initial estimate of the camera registration parameters 500 may be calculated. The initial estimate may be obtained from game state and or game meta data 1000 where this is available. The initial estimate may be obtained from map data 1002 where this is available as described above. The initial estimate may be obtained from GPS data 1004 where the real time camera tracking system comprises a GPS sensor and a user has given consent for GPS data to be used where appropriate. The initial estimate may be obtained from orientation sensor data 1006 where an orientation sensor is incorporated in the camera tracking system. The initial estimate may be predicted from a previous motion path of the camera 1010. For example, the camera may be assumed to have a constant velocity or a constant acceleration. The motion path of the camera from time 0 to time t−1 may be used to estimate where the camera will be at time t and thus obtain an estimate of the registration parameters.
In some examples the initial estimate is obtained from a frame to frame matching process 1008. In an example, the current and previous depth image frames are used in a frame to frame matching process. The current depth image frame is used to compute an image pyramid where an image pyramid comprises an image and a plurality of successively smaller versions of that image computed by successively downsampling or reducing the resolution. A corresponding image pyramid, having the same number of versions of the image at the same resolutions, is computed for the previous depth image frame.
Starting with the lowest resolution versions of the current and previous depth image frames, a frame to frame energy function is minimized to find a camera pose which best aligns the two frames. The camera pose is refined by repeating this process for successively higher resolution pairs of the previous and current depth image frames from the pyramids.
The frame to frame energy function expresses an energy which is related to the sum over image elements of the difference between depth values of surfaces depicted by corresponding image elements of the two frames. For example a frame to frame energy function which may be used is:

Ef(θ)=Σi(e2TM(θ)úi−z1(π(M(θ)úi)))2 

Which may be expressed in words as, an energy of a function of a camera pose registration parameter vector is equal to the sum over image elements i of the squares of the differences between, the depth component (obtained by applying a matrix transpose T with the unit vector e2) of the 3D points in view space of the image elements of the previous frame, times a rigid transformation M(θ) from the view space of the previous frame to that of the current frame, and the 3D points in view space of the image element of the current frame, given a function π(x) which represents the projection of a 3D view-space coordinate x to a 2D image coordinate; where x is given by the corresponding depth value of the image element of the previous frame times the rigid transformation from the view space of the previous frame to that of the current frame.
The frame to frame energy function may be a nonlinear least squares problem as shown in the example above and may be optimized using Levenberg-Marquardt or any other suitable optimization process. The previous frame's pose may be used as an initial estimate of the camera pose registration parameter.
Alternatively, or in addition, the functionality described herein can be performed, at least in part, by one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Program-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), Graphics Processing Units (GPUs).
FIG. 11 illustrates various components of an exemplary computing-based device 1104 which may be implemented as any form of a computing and/or electronic device, and in which embodiments of a real-time camera tracker may be implemented.
The computing-based device 1104 comprises one or more input interfaces 1102 arranged to receive and process input from one or more devices, such as user input devices (e.g. capture device 1108, a game controller 1105, a keyboard 1106, a mouse 1107). This user input may be used to control software applications or real-time camera tracking. For example, capture device 1108 may be a mobile depth camera arranged to capture depth maps of a scene. The computing-based device 1104 may be arranged to provide real-time tracking of that capture device 1108.
The computing-based device 1104 also comprises an output interface 1110 arranged to output display information to a display device 1109 which can be separate from or integral to the computing device 1104. The display information may provide a graphical user interface. In an example, the display device 1109 may also act as the user input device if it is a touch sensitive display device. The output interface 1110 may also output date to devices other than the display device, e.g. a locally connected printing device.
In some examples the user input devices 1005, 1007, 1008, 1009 may detect voice input, user gestures or other user actions and may provide a natural user interface (NUI). This user input may be used to control a game or other application. The output interface 1110 may also output data to devices other than the display device, e.g. a locally connected printing device.
The input interface 1102, output interface 1110, display device 1109 and optionally the user input devices 1105, 1107, 1108, 1109 may comprise NUI technology which enables a user to interact with the computing-based device in a natural manner, free from artificial constraints imposed by input devices such as mice, keyboards, remote controls and the like. Examples of NUI technology that may be provided include but are not limited to those relying on voice and/or speech recognition, touch and/or stylus recognition (touch sensitive displays), gesture recognition both on screen and adjacent to the screen, air gestures, head and eye tracking, voice and speech, vision, touch, gestures, and machine intelligence. Other examples of NUI technology that may be used include intention and goal understanding systems, motion gesture detection systems using depth cameras (such as stereoscopic camera systems, infrared camera systems, rgb camera systems and combinations of these), motion gesture detection using accelerometers/gyroscopes, facial recognition, 3D displays, head, eye and gaze tracking, immersive augmented reality and virtual reality systems and technologies for sensing brain activity using electric field sensing electrodes (EEG and related methods).
Computer executable instructions may be provided using any computer-readable media that is accessible by computing based device 1104. Computer-readable media may include, for example, computer storage media such as memory 1112 and communications media. Computer storage media, such as memory 1112, includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EPROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information for access by a computing device.
In contrast, communication media may embody computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave, or other transport mechanism. As defined herein, computer storage media does not include communication media. Therefore, a computer storage medium should not be interpreted to be a propagating signal per se. Propagated signals may be present in a computer storage media, but propagated signals per se are not examples of computer storage media. Although the computer storage media (memory 1112) is shown within the computing-based device 1104 it will be appreciated that the storage may be distributed or located remotely and accessed via a network or other communication link (e.g. using communication interface 1113).
Computing-based device 1104 also comprises one or more processors 1100 which may be microprocessors, controllers or any other suitable type of processors for processing computing executable instructions to control the operation of the device in order to provide real-time camera tracking. In some examples, for example where a system on a chip architecture is used, the processors 1100 may include one or more fixed function blocks (also referred to as accelerators) which implement a part of the method of real-time camera tracking in hardware (rather than software or firmware).
Platform software comprising an operating system 1114 or any other suitable platform software may be provided at the computing-based device to enable application software 1116 to be executed on the device. Other software than may be executed on the computing device 1104 comprises: camera pose engine 1118, loop closure engine 1120, relocalization engine 1122. A data store 1124 is provided to store data such as previously received depth maps, registration parameters, user configurable parameters, other parameters, dense 3D models of scenes, game state information, game metadata, map data and other data.
The term ‘computer’ or ‘computing-based device’ is used herein to refer to any device with processing capability such that it can execute instructions. Those skilled in the art will realize that such processing capabilities are incorporated into many different devices and therefore the terms ‘computer’ and ‘computing-based device’ each include PCs, servers, mobile telephones (including smart phones), tablet computers, set-top boxes, media players, games consoles, personal digital assistants and many other devices.
The methods described herein may be performed by software in machine readable form on a tangible storage medium e.g. in the form of a computer program comprising computer program code means adapted to perform all the steps of any of the methods described herein when the program is run on a computer and where the computer program may be embodied on a computer readable medium. Examples of tangible storage media include computer storage devices comprising computer-readable media such as disks, thumb drives, memory etc. and do not include propagated signals. Propagated signals may be present in a tangible storage media, but propagated signals per se are not examples of tangible storage media. The software can be suitable for execution on a parallel processor or a serial processor such that the method steps may be carried out in any suitable order, or simultaneously.
This acknowledges that software can be a valuable, separately tradable commodity. It is intended to encompass software, which runs on or controls “dumb” or standard hardware, to carry out the desired functions. It is also intended to encompass software which “describes” or defines the configuration of hardware, such as HDL (hardware description language) software, as is used for designing silicon chips, or for configuring universal programmable chips, to carry out desired functions.
Those skilled in the art will realize that storage devices utilized to store program instructions can be distributed across a network. For example, a remote computer may store an example of the process described as software. A local or terminal computer may access the remote computer and download a part or all of the software to run the program. Alternatively, the local computer may download pieces of the software as needed, or execute some software instructions at the local terminal and some at the remote computer (or computer network). Those skilled in the art will also realize that by utilizing conventional techniques known to those skilled in the art that all, or a portion of the software instructions may be carried out by a dedicated circuit, such as a DSP, programmable logic array, or the like.
Any range or device value given herein may be extended or altered without losing the effect sought, as will be apparent to the skilled person.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
It will be understood that the benefits and advantages described above may relate to one embodiment or may relate to several embodiments. The embodiments are not limited to those that solve any or all of the stated problems or those that have any or all of the stated benefits and advantages. It will further be understood that reference to ‘an’ item refers to one or more of those items.
The steps of the methods described herein may be carried out in any suitable order, or simultaneously where appropriate. Additionally, individual blocks may be deleted from any of the methods without departing from the spirit and scope of the subject matter described herein. Aspects of any of the examples described above may be combined with aspects of any of the other examples described to form further examples without losing the effect sought.
The term ‘comprising’ is used herein to mean including the method blocks or elements identified, but that such blocks or elements do not comprise an exclusive list and a method or apparatus may contain additional blocks or elements.
It will be understood that the above description is given by way of example only and that various modifications may be made by those skilled in the art. The above specification, examples and data provide a complete description of the structure and use of exemplary embodiments. Although various embodiments have been described above with a certain degree of particularity, or with reference to one or more individual embodiments, those skilled in the art could make numerous alterations to the disclosed embodiments without departing from the spirit or scope of this specification.

## Claims

1. A method of real-time camera tracking comprising:
receiving, at a processor, a sequence of depth map frames from a moving mobile depth camera each depth map frame comprising a depth value at each image element that depth value being related to a distance from the mobile depth camera to a surface in the environment captured by the mobile depth camera;
accessing, by the processor, a 3D model of surfaces in the environment;
tracking the position and orientation of the mobile depth camera by computing, at the processor, for each of a plurality of the depth map frames, an updated position and orientation of the mobile depth camera according to an alignment of the image elements of the depth map frame and a surface depicted in the 3D model of the environment, the alignment being based at least in part on at least one of:
an energy of a function of a camera pose registration parameter vector being equal to one half of the sum over image elements of the square of a truncated signed distance given by the 3D model at the position of the current image element transformed by a current pose estimate; or
an energy of a function of a camera pose registration parameter vector being equal to the sum over image elements of the squares of the differences between, a depth component of the 3D points in a view space of the image elements of a previous frame, times a rigid transformation from the view space of the previous frame to that of a current frame, and the 3D points in a view space of an image element of the current frame, given a function which represents the projection of a 3D view space coordinate to a 2D image coordinate, where the projection of the 3D view space coordinate is given by a corresponding depth value of the image element of the previous frame times the rigid transformation from the view space of the previous frame to that of the current frame.

2. A method as claimed in claim 1 comprising computing an initial estimate of the position and orientation of the mobile depth camera from two of the depth map frames by computing a camera pose which aligns the two frames.

3. A method as claimed in claim 1 wherein accessing the 3D model of surfaces comprises accessing a signed distance function representing the surfaces in the environment.

4. A method as claimed in claim 1 comprising mapping depth values of image elements from a depth map frame to model positions with respect to the 3D model.

5. A method as claimed in claim 4 comprising calculating depth values for the model positions from the 3D model.

6. A method as claimed in claim 5 comprising computing residuals by comparing the depth values of the model positions and the depth values of corresponding image elements from a depth map frame.

7. A method as claimed in claim 5 comprising interpolating the depth values of the model positions from a plurality of values obtained from the 3D model.

8. A method as claimed in claim 5 comprising using texturing hardware to compute the depth values of the model positions.

9. A method as claimed in claim 1 comprising computing the alignment of the image elements of the depth map frame and a surface depicted in the 3D model of the environment by using a parallel computing device to accumulate quantities related to the alignment over image elements in parallel.

10. A method as claimed in claim 1 comprising computing the alignment of the image elements of the depth map frame and a surface depicted in the 3D model of the environment by using a parallel processing unit to carry out a sum operation to compute quantities related to the alignment per image element.

11. A real-time camera tracker comprising:
a communications interface arranged to receive a sequence of depth map frames from a moving mobile depth camera each depth map frame comprising a depth value at each image element that depth value being related to a distance from the mobile depth camera to a surface in the environment captured by the mobile depth camera;
the communications interface being arranged to access a 3D model of surfaces in the environment;
a camera pose engine arranged to track the position and orientation of the mobile depth camera by computing, for each of a plurality of the depth map frames, an updated position and orientation of the mobile depth camera according to an alignment of the image elements of the depth map frame and a surface depicted in the 3D model of the environment, the alignment being based at least in part on at least one of:
an energy of a function comprising terms related at least to the square of a truncated signed distance, a transformation matrix, and a formatting matrix; or
an energy of a function comprising terms related at least to a depth component of the 3D points in a view space of the image elements of a previous frame, a rigid transformation from the view space of the previous frame to that of a current frame, and a projection of a 3D view space coordinate to a 2D image coordinate.

12. A real-time camera tracker as claimed in claim 11 the camera pose engine arranged to compute an initial estimate of the position and orientation of the mobile depth camera from two of the depth map frames by computing a camera pose which aligns the two frames.

13. A real-time camera tracker as claimed in claim 11 the communications interface being arranged to access the 3D model of surfaces by accessing a signed distance function representing the surfaces in the environment.

14. A real-time camera tracker as claimed in claim 11 the camera pose engine comprising a parallel computing device arranged to compute the alignment of the image elements of the depth map frame and a surface depicted in the 3D model of the environment by accumulating quantities related to the alignment over image elements in parallel.

15. A real-time camera tracker as claimed in claim 11 the camera pose engine comprising a graphics processing unit arranged to compute the alignment of the image elements of the depth map frame and a surface depicted in the 3D model of the environment by carrying out a map reduce operation to compute quantities related to the alignment per image element.

16. A real time camera tracker as claimed in claim 11 the camera pose engine being at least partially implemented using hardware logic selected from any one or more of: a field-programmable gate array, a program-specific integrated circuit, a program-specific standard product, a system-on-a-chip, a complex programmable logic device, a graphics processing unit (GPU), texturing hardware.

17. A game system comprising a real time camera tracker as claimed in claim 11, the game system being arranged to influence the course of a game in relation to location and orientation of one or more mobile depth cameras tracked by the real time camera tracker.

18. A computer storage media storing device-executable instructions that, when executed, cause a system to execute steps comprising:
receiving, at a processor, a sequence of depth map frames from a moving mobile depth camera each depth map frame comprising a depth value at each image element that depth value being related to a distance from the mobile depth camera to a surface in the environment captured by the mobile depth camera;
accessing, by the processor, a signed distance function representing surfaces in the environment;
and
tracking the position and orientation of the mobile depth camera by computing, at the processor, for each of a plurality of the depth map frames, an updated position and orientation of the mobile depth camera on the basis of an alignment of the image elements of the depth map frame and at least part of the signed distance function, the alignment being based at least in part on at least one of:
an energy of a function comprising terms related at least to the square of a truncated signed distance, a transformation matrix, and a formatting matrix; or
an energy of a function comprising terms related at least to a depth component of the 3D points in a view space of the image elements of a previous frame, a rigid transformation from the view space of the previous frame to that of a current frame, and a projection of a 3D view space coordinate to a 2D image coordinate.

19. A computer storage media as claimed in claim 18 wherein the alignment of the image elements of the depth map frame and a surface depicted in the 3D model of the environment is computed by using a parallel computing device to accumulate quantities related to the alignment over image elements in parallel.

20. A computer storage media as claimed in claim 18 wherein the alignment of the image elements of the depth map frame and a surface depicted in the 3D model of the environment is computed by using a graphics processing unit (GPU) to carry out a map reduce operation to compute quantities related to the alignment per image element.