# Patent

## Title
Method and apparatus for recovering depth value of depth image

## Abstract

A method and apparatus for processing a depth image determines a number of mods (NoM) for corresponding pixels in a plurality of depth images. The corresponding pixels may represent a same three-dimensional (3D) point. The NoM may be determined to be a value for minimizing a Markov random field (MRF) energy. A depth value for one depth image may be recovered, and a depth value for another depth image may be updated using the recovered depth value.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
This application claims the priority benefit under 35 U.S.C. §119(e) of U.S. Provisional Application No. 61/584,925, filed on Jan. 10, 2012, in the U.S. Patent and Trademark Office, and under 35 U.S.C. §119(a) of Korean Patent Application No. 10-2012-0093530, filed on Aug. 27, 2012, in the Korean Intellectual Property Office, the entire disclosures of which are hereby incorporated by reference.


BACKGROUND
1. Field
Example embodiments relate to a method and apparatus for recovering a depth value of a depth image, and more particularly, to a method and apparatus for calculating a depth value of a pixel in a depth image taken with a Time-of-Flight (ToF) depth camera.
2. Description of the Related Art
A Time-of-Flight (ToF) depth camera provides two-and-a-half-dimensional (2.5D) information of a scene. Here, 2.5D refers to a method of providing depth information for a visible surface.
The ToF depth camera may include a light emitting diode (LED) to radiate an infrared (IR) light and a sensor to detect the IR light. The ToF depth camera may calculate a distance between the ToF depth camera and an object by measuring a time taken for the IR light from the LED to bounce off the object and return to the sensor.
The IR light may be modulated with a frequency f. That is, the IR light may have a frequency f. ToF ttime-of-flight may be calculated indirectly by measuring an intensity of light returning to the sensor based on two or four phases.
SUMMARY
The foregoing and/or other aspects are achieved by providing a method of processing a depth image, the method including receiving a first depth image and a second depth image, determining a number of mods (NoM) of corresponding pixels in the first depth image and the second depth image, and recovering a depth value for at least one of the first depth image and the second depth image based on the determined NoM, the corresponding pixels representing a same three-dimensional (3D) point.
The determining may include determining an NoM of a pixel in the first depth image to minimize an Markov random field (MRF) energy of the first depth image, and determining an NoM of a pixel in the second depth image to minimize an MRF energy of the second depth image.
The MRF energy of the first depth image may be determined based on a data cost for a pixel in the first depth image and a discontinuity cost for two neighboring pixels in the first depth image.
The MRF energy of the second depth image may be determined based on a data cost for a pixel in the second depth image and a discontinuity cost for two neighboring pixels in the second depth image.
The discontinuity cost may be based on a constraint of NoMs in two spatially neighboring pixels in one depth image being the same when 3D distances between the two pixels are similar to one another.
The 3D distance may correspond to a distance between a camera used to generate a depth image including a pixel and a 3D point corresponding to the pixel.
A first pixel in the first depth image and a second pixel in the second depth image may correspond to the corresponding pixels.
The data cost may be calculated by the determined NoM of the first pixel and the determined NoM of the second pixel which minimize a distance between a first 3D point recovered by applying an NoM to the first pixel and a second 3D point recovered by applying an NoM to the second pixel.
A value of the data cost may be changed to a threshold value by a robust potential function when the value of the calculated data cost is greater than the threshold value.
The method may further include updating the recovered depth value of the first depth image using the second depth image having the recovered depth value.
The updating may include updating the recovered depth image of the first depth image by minimizing the MRF energy of the first depth image having the recovered depth value iteratively based on the recovered depth value of the second depth image, such that the recovered depth value of the first depth image is consistent with the recovered depth value of the second depth image.
The method may further include generating the first depth image, and generating the second depth image.
The first depth image and the second depth image may be generated by photographing a scene under at least one condition of different locations and different directions.
The foregoing and/or other aspects are also achieved by providing an apparatus for processing a depth image, the apparatus including a receiving unit configured to receive a first depth image and a second depth image, and a processing unit configured to determine an NoM of corresponding pixels in the first depth image and the second depth image, and to recover a depth value for at least one of the first depth image and the second depth image based on the determined NoM, the corresponding pixels representing a same 3D point.
The processing unit may be configured to determine an NoM for a pixel in the first depth image to minimize an MRF energy of the first depth image, and to determine an NoM for a pixel in the second depth image to minimize an MRF energy of the second depth image.
The processing unit may be configured to determine the MRF energy of the first depth image based on a data cost for a pixel in the first depth image and a discontinuity cost for two neighboring pixels in the first depth image, and to determine the MRF energy of the second depth image based on a data cost for a pixel in the second depth image and a discontinuity cost for two neighboring pixels in the second depth image.
The processing unit may be configured to calculate the data cost by calculating the determined NoM of the first pixel and the determined NoM of the second pixel to minimize a distance between a first 3D point recovered by applying an NoM to the first pixel and a second 3D point recovered by applying an NoM to the second pixel.
The processing unit may be configured to change a value of the data cost to a threshold value by a robust potential function when the value of the calculated data cost is greater than the threshold value.
The processing unit may be configured to update the recovered depth value of the first depth image using the second depth image having the recovered depth value.
The processing unit may be configured to update the recovered depth image of the first depth image by minimizing the MRF energy of the first depth image having the recovered depth value iteratively based on the recovered depth value of the second depth image, such that the recovered depth value of the first depth image is consistent with the recovered depth value of the second depth image.
The apparatus may further include a first camera configured to generate the first depth image by photographing a scene, and a second camera configured to generate the second depth image by photographing the scene.
The first camera and the second camera may be configured to photograph the scene under at least one condition of different locations and different directions.
Additional aspects of embodiments will be set forth in part in the description which follows and, in part, will be apparent from the description, or may be learned by practice of the disclosure.



BRIEF DESCRIPTION OF THE DRAWINGS
These and/or other aspects will become apparent and more readily appreciated from the following description of embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 illustrates an apparatus for processing a depth image according to an example embodiment;
FIG. 2 illustrates a method of calculating a distance using a plurality of Time-of-Flight (ToF) depth cameras according to an example embodiment;
FIG. 3 illustrates a method of recovering a depth value of a depth image according to an example embodiment;
FIG. 4 illustrates a distance change of a three-dimensional (3D) point depending on a number of mods (NoM) according to an example embodiment;
FIG. 5 illustrates examples of images recovered using a data cost function according to an example embodiment;
FIG. 6 illustrates a role of a discontinuity cost according to an example embodiment; and
FIG. 7 illustrates examples of depth images having updated depth values according to an example embodiment.



DETAILED DESCRIPTION
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to like elements throughout. Embodiments are described below to explain the present disclosure by referring to the figures.
FIG. 1 illustrates an apparatus 100 for processing a depth image according to an example embodiment.
Referring to FIG. 1, the apparatus 100 for processing a depth image includes a first camera 110, a second camera 120, a receiving unit 130, and a processing unit 140.
The first camera 110 may generate a first depth image by photographing a scene. The second camera 120 may generate a second depth image by photographing the scene. The first camera 110 and the second camera 120 may generate the first depth image and the second depth image by photographing the scene at different locations and/or in different directions. The first depth image and the second depth image may be generated by photographing the scene at different locations and in different directions.
Each of the first camera 110 and the second camera 120 may correspond to a Time-of-Flight (ToF) depth camera. The first camera 110 and the second camera 120 may correspond to a stereo ToF depth camera. The disclosure is not limited to two cameras, as there may be more than two cameras. The cameras may be arranged along an axis and capture an image in a same direction, that is the cameras may be separated a predetermined distance and face the same direction. Alternatively, the cameras may be separated a predetermined distance and face a different direction relative to one another, to capture an image. Other arrangements are also possible. For example, the cameras may be arranged along an arc.
The receiving unit 130 may receive the first depth image and the second depth image.
The processing unit 140 may recover a depth value of the first depth image and a depth value of the second depth image. Here, the depth value of the depth image may correspond to a depth value for each pixel of the depth image. The recovery of the depth value may correspond to a change of an incorrect or insufficient depth value to a correct or more correct depth value.
The depth value of a pixel in the depth image may refer to a distance between the camera used in taking the depth image and a three-dimensional (3D) point of the scene corresponding to the pixel. Accordingly, as the distance and the depth value of the pixel are adjacent to each other, the depth value of the pixel may be considered as being more correct.
FIG. 2 illustrates a method of calculating a distance using a plurality of ToF depth cameras according to an example embodiment.
The plurality of ToF depth cameras may include the first camera 110 and the second camera 120.
The processing unit 140 may calculate a distance between a ToF depth camera and an object based on the following Equation 1.




  
    
      
        d
        =
        
          
            c
            ·
            
              t
              
                time
                ⁢
                
                  -
                
                ⁢
                of
                ⁢
                
                  -
                
                ⁢
                flight
              
            
          
          2
        
      
    
    
      
        [
        
          Equation
          ⁢
          
            
          
          ⁢
          1
        
        ]
      
    
  




where ‘d’ may denote a distance between a ToF depth camera and an object. ‘c’ may denote a velocity of light. ttime-of-flight may denote a time taken for a light radiated from a light source, for example a light emitting diode (LED) of the ToF depth camera to bounce off the object and return to a sensor. Hereinafter, the light being radiated from the LED may be referred to as a radiated or emitted light, and the light being bounced off the object and returning to the sensor may be referred to as a reflected light. The radiated light may correspond to a light modulated with a frequency f, that is, an infrared (IR) light.
The time-of-flight may be calculated indirectly by measuring an intensity of light returning to the sensor based on two or four phases, for example, by the processing unit 140.
In FIG. 2, the distance may be calculated using an intensity of light measured based on two different phases. Here, two different phases may include a 0 degree phase and a 180 degree phase.
A signal received by the sensor may be represented by Equation 2. Here, the received signal may correspond to the reflected light received by the sensor.

A sin(2πft−φ)  [Equation 2]

where ‘A’ may denote an amplitude of the received signal. ‘t’ may denote a time. φ may denote a phase difference between the radiated light and the reflected light.
The processing unit 140 may calculate ttime-of-flight based on the following Equation 3.




  
    
      
        
          t
          
            time
            ⁢
            
              -
            
            ⁢
            of
            ⁢
            
              -
            
            ⁢
            flight
          
        
        =
        
          φ
          
            2
            ⁢
            π
            ⁢
            
              
            
            ⁢
            f
          
        
      
    
    
      
        [
        
          Equation
          ⁢
          
            
          
          ⁢
          3
        
        ]
      
    
  




The received signal may be mixed with a sine wave sin(2πft) and a cosine wave cos(2πft) by a first mixer 210 and a second mixer 220. Signals generated by mixing may be passed through a first low pass filter 212 and a second low pass filter 214. A first correlation signal ‘B’ and a second correlation signal ‘C’ may be generated by passing the signals generated by mixing through the first low pass filter 212 and the second low pass filter 214, respectively. Here, the sine wave sin(2πft) and the cosine wave cos(2πft) may refer to a wave corresponding to a first phase and a wave corresponding to a third phase, respectively.
‘B’ and ‘C’ may be calculated based on Equation 4.




  
    
      
        
          B
          =
          
            
              A
              2
            
            ⁢
            
              cos
              ⁡
              
                (
                
                  -
                  φ
                
                )
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          C
          =
          
            
              A
              2
            
            ⁢
            
              sin
              ⁡
              
                (
                
                  -
                  φ
                
                )
              
            
          
        
      
    
    
      
        [
        
          Equation
          ⁢
          
            
          
          ⁢
          4
        
        ]
      
    
  




Also, ‘A’ and φ may be calculated based on Equation 5.




  
    
      
        
          φ
          =
          
            
              tan
              
                -
                1
              
            
            ⁡
            
              (
              
                -
                
                  C
                  B
                
              
              )
            
          
        
        ⁢
        
          

        
        ⁢
        
          A
          =
          
            2
            ⁢
            
              
                
                  B
                  2
                
                +
                
                  C
                  2
                
              
            
          
        
      
    
    
      
        [
        
          Equation
          ⁢
          
            
          
          ⁢
          5
        
        ]
      
    
  




dmax may denote a maximum distance that can be measured absent ambiguity. For example, dmax may denote a distance corresponding to a period of phase difference. dmax may be referred to as a non-ambiguous distance range or a maximum acquirable distance.
When the phase difference between the radiated light and the reflected light is greater than 2π, the phase difference may be measured as being smaller than an actual phase difference, that is, in a range between 0 and 2π.
‘d’ may be calculated based on Equation 6.




  
    
      
        d
        =
        
          
            
              c
              ⁢
              
                
              
              ⁢
              φ
            
            
              4
              ⁢
              π
              ⁢
              
                
              
              ⁢
              f
            
          
          =
          
            
              d
              max
            
            ⁢
            
              φ
              
                2
                ⁢
                π
              
            
          
        
      
    
    
      
        [
        
          Equation
          ⁢
          
            
          
          ⁢
          6
        
        ]
      
    
  




To measure ‘d’ correctly, the processing unit 140 may calculate d+ndmax using a sum of the measured phase difference φ and 2πn, φ+2πn. Here, ‘n’ may denote an integer having a value of 0 or more. A method of measuring depth using a single depth camera may fail to determine a value of ‘n’. Accordingly, a maximum distance that can be measured by a depth camera may be dmax, and the processing unit 140 may fail to calculate a depth value of an object located more distant from a depth camera than dmax correctly, producing an incorrect result that is less than an actual distance value. Here, the depth value of the object may correspond to a depth value of a pixel representing the object among pixels of a depth image.
That is, the depth value of the depth image taken with the first camera 110 or the second camera 120 in the presence of ambiguity may correspond to a wrong depth value from which ndmax is missing. The processing unit 140 may recover the depth value of the depth image by adding ndmax to the depth value of the depth image.
The depth value recovered by referring to FIG. 1 may correspond to a wide-range recovered depth value by determining the value of ‘n’. Also, the recovered depth image may be a depth image which has a wide-range recovered depth value by determining the value of ‘n’ for each depth value of pixels in the depth image.
Here, ‘n’ may represent a number of mods (NoM). A measured distance ‘d’ between a camera and an object located at a distance greater than dmax may be shorter than an actual distance d+ndmax between the camera and the object. This phenomenon may refer to phase wrapping. Also, phase unwrapping may refer to a process of estimating an unknown number ‘n’ of wrapping. When a maximum distance dmax that can be measured absent ambiguity is given, NoM may correspond to a number of phase wrappings in the actual distance ‘d+ndmax’ between the camera and the object. For example, NoM may correspond to a result of dividing an actual distance value between the camera and the object by a measured distance value between the camera and the object. NoM may correspond to a number of phase wrappings which occur in the measured distance ‘d’ between the camera and the object, where dmax is the maximum distance that can be measured from the camera absent ambiguity and d+ndmax is the actual distance between the camera and the object.
The technical disclosure provided with reference to Equations 1 through 6 may be applied to each signal received by a plurality of cameras.
FIG. 3 illustrates a method of recovering a depth value of a depth image according to an example embodiment.
Referring to FIG. 3, in operation 310, the first camera 110 may generate a first depth image by photographing a scene.
In operation 320, the second camera 120 may generate a second depth image by photographing the scene.
In operations 310 and 320, the first camera 110 and the second camera 120 may photograph the same scene at different locations and/or in different directions. That is, the first depth image and the second depth image may be generated by photographing the scene at different locations and/or in different directions. The first depth image and the second depth image may have different viewpoints for the scene.
In operation 330, the receiving unit 130 may receive the first depth image from the first camera 110 and the second depth image from the second camera 120.
In operation 340, the processing unit 140 may determine a NoM for each of corresponding pixels in the first depth image and the second depth image. Here, the corresponding pixels may represent the same 3D point. That is, when an object in the scene is photographed by the first camera 110 and the second camera 120, a pixel representing the object in the first depth image and a pixel representing the object in the second depth image may refer to corresponding pixels.
The determining of the NoM is described in detail with reference to FIG. 4.
The operation 340 may include operation 342 and operation 344.
In operation 342, the processing unit 140 may determine an NoM for each pixel in the first depth image to minimize a Markov random field (MRF) energy of the first depth image. The MRF energy is described in detail with reference to FIG. 5.
In operation 344, the processing unit 140 may determine an NoM for each pixel in the second depth image to minimize an MRF energy of the second depth image.
In operation 350, the processing unit 140 may recover a depth value of at least one of the first depth image and the second depth image based on the determined NoM.
In operation 360, the processing unit 140 may update the recovered depth value of the first depth image and the recovered depth value of the second depth image using the first depth image having the recovered depth value and the second depth image having the recovered depth value. Operation 360 may correspond to an operation of optimizing the first depth image and the second depth image.
The operation 360 may include operation 362 and operation 364.
In operation 362, the processing unit 140 may update the recovered depth value of the first depth image using the second depth image having the recovered depth value.
In operation 364, the processing unit 140 may update the recovered depth value of the second depth image using the first depth image having the recovered depth value.
FIG. 4 illustrates a distance change of a 3D point depending on an NoM according to an example embodiment.
A first pixel may correspond to one pixel among pixels of the first depth image. A second pixel may correspond to one pixel among pixels of the second depth image. The first pixel and the second pixel may refer to corresponding pixels.
In operation 330 of FIG. 3, the first pixel of the first depth image may have a depth value ‘d1’. The second pixel of the second depth image may have a depth value ‘d2’. As described with reference to FIG. 2, ‘d1’ may range from ‘0’ to a value smaller than dmax(f1), and ‘d2’ may range from ‘0’ to a value smaller than dmax(f2).
dmax(f1) may correspond to dmax of the signal sensed by the sensor of the first camera 110 when the light radiated from the first camera 110 is modulated with a frequency f1. Here, dmax of the signal may correspond to dmax of the pixel in the depth image. Also, dmax(f2) may correspond to dmax of the signal sensed by the sensor of the second camera 120 when the light radiated from the second camera 120 is modulated with a frequency f2. Here, dmax of the signal may correspond to dmax of the pixel in the depth image. That is, each pixel of the first depth image may have a depth value in a range of ‘0’ to dmax(f1) irrespective of a distance at which a point represented by each pixel is actually located from the first camera 110. The depth value of the pixel in the first depth image may correspond to a remainder when dividing an actual distance value between the point represented by the pixel and the first camera 110 by dmax(f1).
‘x1’ may denote the first pixel. Also, ‘x2’ may denote the second pixel. X1 may represent a 3D point corresponding to ‘x1’. X2 may represent a 3D point corresponding to ‘x2’.
When the depth value of ‘x1’ generated by the first camera 110 is ‘d1’, a distance between the first camera 110 and X1 may correspond to d1+n1dmax(f1). ‘n1’ may denote ‘x1’ and an NoM of X1. ‘n1’ may correspond to an integer having a value of 0 or more. Also, when the depth value of ‘x2’ generated by the second camera 120 is ‘d2’, a distance between the second camera 120 and X2 may correspond to d2+n2dmax(f2). ‘n2’ may denote ‘x2’ and an NoM of X2. ‘n2’ may correspond to an integer having a value of ‘0’ or more.
X1(k1) may represent a 3D point corresponding to ‘x1’ when a value of ‘n1’ is ‘k1’. That is, X1(k1) may represent a 3D point corresponding to ‘x1’ determined based on a location and a direction of the first camera 110, ‘d1’, and dmax(f1), when an NoM of ‘x1’ is ‘k1’. X2(k2) may represent a 3D point corresponding to ‘x2’ when a value of ‘n2’ is ‘k2’. That is, X2(k2) may represent a 3D point corresponding to ‘x2’ determined based on a location and a direction of the second camera 120, ‘d2’, and dmax(f2), when an NoM of ‘x2’ is ‘k2’.
A symbol ‘≡’ may be used to represent a distance between the camera and the 3D point. An expression ‘X1(k1)≡d1’ may indicate that a distance between the first camera 110 and X1(k1) is ‘d1’. An expression ‘d2≡X2(k2)’ may indicate that a distance between the second camera 120 and X2(k2) is ‘d2’.
In FIG. 4, a location of each of X1(0), X1(1), and X1(2) is shown. Also, a location of each of X2(0), X2(1), and X2(2) is shown.
The processing unit 140 may recover the 3D point X1 corresponding to ‘x1’ based on ‘x1’. Here, recovery may correspond to a determination of the NoM of ‘x1’. That is, recovery may comprise determining one among X1(0) through X1(m1) to be the 3D point corresponding to ‘x1’. Here, ‘m1’ may denote a maximum value of ‘k1’.
When ‘x1’ corresponds to ‘x2’, the 3D point recovered from ‘x1’ and the 3D point recovered from ‘x2’ may correspond to points placed at the same location or points placed within a predetermined distance.
In FIG. 4, a trace of X1 corresponding to ‘x1’ with changes of a value of ‘n1’ and a trace of X2 corresponding to ‘x2’ with changes of a value of ‘n2’ are shown as straight lines. When the NoM of X1 and the NoM of X2 are each 2, X1 and X2 may intersect at one point. Accordingly, it may be determined that X1 and X2 are recovered correctly when ‘n1’ and ‘n2’ are each 2. That is, the 3D point recovered from ‘x1’ may correspond to X1(2), and the 3D point recovered from ‘x2’ may correspond to X2(2).
The processing unit 140 may calculate optimum NoMs of X1 and X2 based on Equation 7.

m*=arg minm(minn(∥RX1(m)+T−X2(n)∥))

n*=arg minn(minm(∥RT(X2(n)−T)−X1(m)∥))  [Equation 7]

where ‘R’ may denote a rotation matrix representing rotation between the first camera 110 and the second camera 120. ‘R’ may denote a rotation matrix representing rotation in a direction from the first camera 110 to the second camera 120. ‘R’ may correspond to a 3×3 rotation matrix. RT may denote the transpose of the matrix ‘R’.
‘T’ may denote a 3D translation vector indicating translation between the first camera 110 and the second camera 120. ‘T’ may denote a 3D translation vector indicating translation from a location of the first camera 110 to a location of the second camera 120.
Each of ‘R’ and ‘T’ may denote a predetermined value given by extrinsic calibration of the first camera 110 and the second camera 120.
In Equation 7, ‘m’ may denote the NoM of the 3D point X1 corresponding to the pixel ‘x1’ in the first depth image taken with the first camera 110. ‘n’ may denote the NoM of the 3D point X2 corresponding to the pixel ‘x2’ in the second depth image taken with the second camera 120.
X2(n) may represent a 3D point when X1(m) is projected on the second depth image and an NoM of a pixel projected on the second depth image is ‘n’. Here, the pixel having X1(m) projected on the second depth image may correspond to X2. X1(m) may represent a 3D point when X2(n) is projected on the first depth image and an NoM of a pixel projected on the first depth image is ‘m’. Here, the pixel having X2(n) projected on the second depth image may correspond to X1.
Each of m* and n* may denote an optimum NoM for minimizing a distance between the 3D point generated by recovering X1 and the 3D point generated by recovering X2.
The functions of Equation 7 may be referred to as cost functions.
FIG. 5 illustrates examples of images recovered using a data cost function according to an example embodiment.
Referring to FIG. 3, the processing unit 140 may generate a first recovered depth image 510 and a second recovered depth image 520 by applying a data cost function to the first depth image and the second depth image, respectively, in operation 340.
When the first camera 110 and the second camera 120 have the same viewpoint, occlusion may be absent in the first depth image taken with the first camera 110 and the second depth image taken with the second camera 120. Accordingly, a corresponding pixel may be present in another depth image for each pixel of one depth image.
However, since the first camera 110 and the second camera 120 have different locations and/or different directions for the scene, corresponding pixels for some pixels of one depth image may be absent in another depth image. That is, occlusion may be present in the first depth image and the second depth image. Also, noise in the first depth image and the second depth image may result in incorrect calculation of an NoM using a data cost function.
FIG. 5 shows the first recovered depth image 510 and the second recovered depth image 520 as examples of incorrect recovered depth images caused by occlusion and noise.
MRF energies of the first depth image and the second depth image may be defined as shown in the following Equation 8. The processing unit 140 may use the MRF energy function defined based on Equation 8, to determine the NoM for each pixel of the first depth image and the NoM for each pixel of the second depth image.




  
    
      
        
          
            E
            1
          
          =
          
            
              
                ∑
                i
              
              ⁢
              
                
                  D
                  1
                
                ⁡
                
                  (
                  
                    m
                    i
                  
                  )
                
              
            
            +
            
              λ
              ⁢
              
                
                  ∑
                  
                    
                      (
                      
                        i
                        ,
                        j
                      
                      )
                    
                    ∈
                    N
                  
                
                ⁢
                
                  
                    V
                    1
                  
                  ⁡
                  
                    (
                    
                      
                        m
                        i
                      
                      ,
                      
                        m
                        j
                      
                    
                    )
                  
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            E
            2
          
          =
          
            
              
                ∑
                i
              
              ⁢
              
                
                  D
                  2
                
                ⁡
                
                  (
                  
                    n
                    i
                  
                  )
                
              
            
            +
            
              λ
              ⁢
              
                
                  ∑
                  
                    
                      (
                      
                        i
                        ,
                        j
                      
                      )
                    
                    ∈
                    N
                  
                
                ⁢
                
                  
                    V
                    2
                  
                  ⁡
                  
                    (
                    
                      
                        n
                        i
                      
                      ,
                      
                        n
                        j
                      
                    
                    )
                  
                
              
            
          
        
      
    
    
      
        [
        
          Equation
          ⁢
          
            
          
          ⁢
          8
        
        ]
      
    
  




where E1 may denote an MRF energy of the first depth image. E2 may denote an MRF energy of the second depth image.
Each of ‘i’ and ‘i’ may denote an index of a pixel in the first depth image or the second depth image.
‘N’ may denote a set of neighboring pixel pairs in the first depth image or the second depth image. That is, (i, j) may denote an index pair of two neighboring pixels in the first depth image or the second depth image. A pixel having an index ‘i’ may have four or eight neighboring pixels.
‘mi’ may denote an NoM of a pixel having an index ‘I’ in the first depth image. ‘mj’ may denote an NoM of a pixel having an index ‘J’ in the first depth image. ‘ni’ may denote an NoM of a pixel having an index ‘I’ in the second depth image. ‘nj’ may denote an NoM of a pixel having an index ‘J’ in the second depth image.
‘D1’ may denote a data cost for the first depth image. ‘D2’ may denote a data cost for the second depth image. ‘D1(mi)’ may denote a data cost for the NoM of the pixel having the index ‘I’ in the first depth image. ‘D2(ni)’ may denote a data cost for the NoM of the pixel having the index ‘I’ in the second depth image.
‘V1’ may denote a discontinuity cost for the first depth image. ‘V2’ may denote a discontinuity cost for the second depth image. ‘V1(mi, mj)’ may denote a discontinuity cost between the NoM of the pixel having the index ‘I’ in the first depth image and the NoM of the pixel having the index ‘J’ in the first depth image. ‘V2(ni, nj)’ may denote a discontinuity cost between the NoM of the pixel having the index ‘I’ in the second depth image and the NoM of the pixel having the index ‘J’ in the second depth image.
The discontinuity cost may be based on a constraint of NoMs in two spatially neighboring pixels in one depth image being the same when 3D distances between the two pixels are similar to one another. Here, the 3D distance may correspond to a distance between a camera used to generate a depth image including a pixel and a 3D point corresponding to the pixel.
‘λ’ may denote a balancing coefficient. The balancing coefficient may be a value used to coordinate a difference of units of the discontinuity cost and the data cost consistent or to coordinate a difference units of the discontinuity cost and the MRF energy consistent. ‘λ’ may have a constant value.
That is, the processing unit 140 may determine the MRF energy of the first depth image based on the data cost for each pixel in the first depth image and the discontinuity cost for neighboring pixels in the first depth image, and may determine the MRF energy of the second depth image based on the data cost for each pixel in the second depth image and the discontinuity cost for neighboring pixels in the second depth image.
The processing unit 140 may determine the NoM for each pixel of the first depth image to minimize the MRF energy of the first depth image, and may determine the NoM for each pixel of the second depth image to minimize the MRF energy of the second depth image.
Each of D1(mi) and D2(ni) may be defined by Equation 9. The processing unit 140 may use a function defined by Equation 9 to calculate a data cost for each of ‘Mi’ and ‘Ni’.

D1(mi)=δ(minnk(∥RX1i(mi)+T−X2k(nk)∥))

D2(ni)=δ(minmk(∥RT(X2i(ni)−T)−X1k(mk)∥))  [Equation 9]

‘x1i’ may denote a pixel having an index ‘I’ in the first depth image. ‘x2i’ may denote a pixel having an index ‘I’ in the second depth image. ‘x1k’ may denote a pixel having an index ‘k’ in the first depth image. ‘x2k’ may denote a pixel having an index ‘k’ in the second depth image. Each of ‘x1i’ and ‘x2k’ may correspond to the first pixel and the second pixel described with reference to FIG. 4, respectively. That is, ‘x1i’ and ‘x2k’ may refer to corresponding pixels. Also, each of ‘x1k’ and ‘x2i’ may correspond to the first pixel and the second pixel described with reference to FIG. 4, respectively. That is, ‘x1k’ and ‘x2i’ may refer to corresponding pixels.
‘X1i(mi)’ may represent a 3D point corresponding to ‘x1i’, calculated based on ‘mi’ when an NoM of ‘x1i’ is ‘mi’. ‘X1k(mk)’ may represent a 3D point corresponding to ‘x1k’, calculated based on ‘mk’ when an NoM of ‘x1k’ is ‘mk’. ‘X2i(ni)’ may represent a 3D point corresponding to ‘x2i’, calculated based on ‘ni’ when an NoM of ‘x2i’ is ‘ni’. ‘X2k(nk)’ may represent a 3D point corresponding to ‘x2k’, calculated based on ‘nk’ when an NoM of ‘x2k’ is ‘nk’.
‘δ’ may denote a function for limiting an eventual distance error. ‘≡’ may denote a robust potential function. In Equation 9, data costs D1 and D2 may be such that the robust potential function ‘δ’ is applied. When a distance between two 3D points is calculated as being greater than a predetermined threshold value due to occlusion or noise, ‘δ’ may be used to replace the result with the threshold value.
In Equation 9, when the calculated data cost is greater than the threshold value, a value of the data cost may be changed to the threshold value by the robust potential function. When the value of the calculated data cost is greater than the threshold value, the processing unit 140 may change the value of data cost to the threshold value using the robust potential function.
As shown in Equation 9, the processing unit 140 may calculate the data cost by calculating the determined NoM of the first pixel and the determined NoM of the second pixel which minimize a distance between a first 3D point recovered by applying an NoM to the first pixel and a second 3D point recovered by applying an NoM to the second pixel.
Each of V1(mi, mj) and V2(ni, nj) may be defined by Equation 10. The processing unit 140 may use a function defined by Equation 10 to calculate a discontinuity cost for each of index pairs (mi, mj) and (ni, nj).




  
    
      
        
          
            V
            1
          
          ⁡
          
            (
            
              
                m
                i
              
              ,
              
                m
                j
              
            
            )
          
        
        =
        
          {
          
            
              
                
                  
                    
                      v
                      ⁡
                      
                        (
                        
                          
                          
                            
                            
                              
                                X
                                
                                  1
                                  ⁢
                                  i
                                
                              
                              -
                              
                                X
                                
                                  1
                                  ⁢
                                  j
                                
                              
                            
                            
                          
                          
                        
                        )
                      
                    
                  
                  
                    
                      
                        
                          if
                          ⁢
                          
                            
                          
                          ⁢
                          
                            m
                            i
                          
                        
                        ≠
                        
                          m
                          j
                        
                      
                      ,
                      
                        
                          
                          
                            
                            
                              
                                X
                                
                                  1
                                  ⁢
                                  i
                                
                              
                              -
                              
                                X
                                
                                  1
                                  ⁢
                                  j
                                
                              
                            
                            
                          
                          
                        
                        <
                        τ
                      
                    
                  
                
                
                  
                    0
                  
                  
                    otherwise
                  
                
              
              ⁢
              
                

              
              ⁢
              
                
                  V
                  2
                
                ⁡
                
                  (
                  
                    
                      n
                      i
                    
                    ,
                    
                      n
                      j
                    
                  
                  )
                
              
            
            =
            
              {
              
                
                  
                    
                      v
                      ⁡
                      
                        (
                        
                          
                          
                            
                            
                              
                                X
                                
                                  2
                                  ⁢
                                  i
                                
                              
                              -
                              
                                X
                                
                                  2
                                  ⁢
                                  j
                                
                              
                            
                            
                          
                          
                        
                        )
                      
                    
                  
                  
                    
                      
                        
                          if
                          ⁢
                          
                            
                          
                          ⁢
                          
                            n
                            i
                          
                        
                        ≠
                        
                          n
                          j
                        
                      
                      ,
                      
                        
                          
                          
                            
                            
                              
                                X
                                
                                  2
                                  ⁢
                                  i
                                
                              
                              -
                              
                                X
                                
                                  2
                                  ⁢
                                  j
                                
                              
                            
                            
                          
                          
                        
                        <
                        τ
                      
                    
                  
                
                
                  
                    0
                  
                  
                    otherwise
                  
                
              
            
          
        
      
    
    
      
        [
        
          Equation
          ⁢
          
            
          
          ⁢
          10
        
        ]
      
    
  




where ‘τ’ may denote a critical value. For example, when a distance between two 3D points X1i and X1j is greater than or equal to the critical value ‘τ’, a value of the discontinuity cost V1(mi, mj) may be ‘0’. ‘τ’ may have a constant value.
‘v’ may denote a function or constant for determining V1(mi, mj) based on the distance between ‘X1i’ and ‘X1j’. ‘v’ may denote a function or constant for determining V2(mi, mj) based on the distance between ‘X2i’ and ‘X2j’. ‘v’ may correspond to a function for generating an output value inversely proportional to an input value, that is, the distance between ‘X1i’ and ‘X1j’ or the distance between ‘X2i’ and ‘X2j’. That is, ‘v’ may correspond to a function for making V1(mi, mj) or V2(ni, nj) have have a great value, when the distance between ‘X1i’ and ‘X1j’ or the distance between ‘X2i’ and ‘X2j’ is short and a value of ‘mi’ is different from a value of ‘mj’.
FIG. 6 illustrates a role of a discontinuity cost according to an example embodiment.
The discontinuity cost ‘V’ may be based on a constraint of NoMs in two spatially neighboring pixels in one depth image being the same when 3D distances between the two pixels are similar to one another.
A pixel ‘x1a’ and a pixel ‘x1b’ may correspond to neighboring pixels in the first depth image. A pixel ‘x2a’ and a pixel ‘x2b’ may correspond to neighboring pixels in the second depth image.
‘x1a’ may correspond to ‘x2a’. Also, ‘x1b’ may correspond to ‘x2b’.
In FIG. 6, a trace 610 of a 3D point ‘X1a’ corresponding to ‘x1a’, a trace 620 of a 3D point ‘X1b’ corresponding to ‘x1b’, a trace 630 of a 3D point ‘X2a’ corresponding to ‘x2a’, and a trace 640 of a 3D point ‘X2b’ corresponding to ‘x2b’, are shown.
‘X1a’, ‘X1b’, ‘X2a’, and ‘X2b’ are each represented by a circle or a triangle when the NoM is 0, 1, and 2, in a direction from a point close to the first camera 110 or the second camera 120 to a point distant from the first camera 110 or the second camera 120.
According to FIG. 6, values of the NoMs of ‘X1a’, ‘X1b’, ‘X2a’, and ‘X2b’ are all ‘2’. Accordingly, recovered depth images of neighboring pixels in one depth image may have consistency.
The recovery of the depth value of the depth image using the MRF energy, described with reference to FIG. 6, may be performed separately for each depth image. Referring to FIG. 3, the first depth image having the recovered depth value may be inconsistent with the second depth image having the recovered depth value in operation 360.
To resolve the inconsistency, in operation 360, the processing unit 140 may update the recovered depth value of one depth image using the recovered depth value of the other depth image among the two depth images having the recovered depth values. That is, the processing unit 140 may update each of the depth values of the first depth image and the second depth image having the recovered depth values recovered in operation 350, using the other depth image having the recovered depth value.
The processing unit 140 may obtain consistent depth images by updating the first depth image having the recovered depth value and the second depth image having the recovered depth value.
When the first depth image and the second depth image are recovered, the processing unit 140 may update the recovered depth value of the first depth image based on Equation 11 to make the first depth image consistent with the second depth image.

F1(mi)=δ(∥RX1i(mi)+T−X2k(nk*)∥)  [Equation 11]

where ‘F1(mi)’ may denote a data cost for updating the depth value of the first depth image.
‘mi’ may denote an NoM of a pixel ‘x1i’ having an index ‘I’ in the first depth image. ‘nk*’ may denote an NoM of a pixel ‘x2k’ having an index ‘k’ in the second depth image having the recovered depth value. ‘ni*’ may denote an NoM of a pixel having an index ‘k’ in the second depth image, determined in operation 340. The pixel ‘x1i’ and the pixel ‘x2k’ may refer to corresponding pixels representing the same 3D point.
‘X2k(nk*)’ may denote a wide-range recovered 3D point corresponding to ‘X1i(mi)’.
The processing unit 140 may update the depth value of the pixel having the index ‘I’ in the first depth image by determining the NoM ‘mi’ of the pixel to minimize ‘F1(mi)’. ‘F1(mi)’ may denote a data cost for the pixel of the first depth image calculated based on the recovered depth value of the second depth image.
When the recovered depth value of the second depth image is correct, ‘F1(mi)’ of Equation 11 may replace ‘D1(mi)’. However, it may fail to guarantee that the recovered depth value of the second depth image is correct. In operation 362, the processing unit 140 may minimize the MRF energy of the first depth image having the recovered depth value iteratively based on the recovered depth value of the second depth image, to make the recovered depth value of the first depth image consistent with the recovered depth value of the second depth image. The processing unit 140 may update the recovered depth value of the first depth image by minimizing the MRF energy iteratively.
The processing unit 140 may minimize the MRF energy iteratively based on Equation 12.




  
    
      
        
          
            D
            1
            t
          
          ⁡
          
            (
            
              m
              i
            
            )
          
        
        =
        
          
            
              (
              
                
                  T
                  -
                  t
                
                T
              
              )
            
            ⁢
            
              
                D
                1
              
              ⁡
              
                (
                
                  m
                  i
                
                )
              
            
          
          +
          
            
              t
              T
            
            ⁢
            
              
                F
                1
              
              ⁡
              
                (
                
                  m
                  i
                
                )
              
            
          
        
      
    
    
      
        [
        
          Equation
          ⁢
          
            
          
          ⁢
          12
        
        ]
      
    
  




where ‘T’ may denote a maximum number of iterations. ‘T’ may correspond to an integer having a value of ‘0’ or more. ‘t’ may denote a current number of iterations. ‘t’ may correspond to an integer having a value in a range of ‘0’ to ‘T’. Equation 11 may represent blending of ‘D1(mi)’ and ‘F1(mi)’.
‘D1t(mi)’ may denote a data cost for an NoM ‘mi’ of a pixel ‘x1i’ having an index ‘I’ in the first depth image during a ‘t’th iteration. The processing unit 140 may update the depth value of ‘x1i’ by determining the NoM ‘mi’ of ‘x1i’ to minimize ‘D1t(mi)’.
When a value of ‘t’ is ‘0’, the processing unit 140 may use ‘D1(mi)’ described with reference to Equation 9 to recover the depth value of the first depth image. When a value of ‘t’ is ‘1’ or more, the processing unit 140 may use ‘F1(mi)’ described with reference to Equation 11 along with ‘D1(mi)’, to recover the depth value of the first depth image.
The updating of the depth value may be applied to the second depth image having the recovered depth value.
The processing unit 140 may update the recovered depth value of the second depth image based on Equation 13 to make the second depth image consistent with the first depth image.

F2(ni)=δ(∥RT(X2i(ni)−T)−X1k(mk*)μ)

where ‘F2(ni)’ denote a data cost for updating the depth value of the second depth image.
‘ni’ may denote an NoM ‘mi’ of a pixel ‘x2i’ having an index ‘I’ in the second depth image. ‘mk*’ may denote an NoM of a pixel ‘x1k’ having an index ‘k’ in the first depth image having the recovered depth value. ‘mk*’ may denote an NoM of a pixel having an index ‘k’ in the first depth image, determined in operation 340. The pixel ‘x2i’ and the pixel ‘x1k’ may refer to corresponding pixels representing the same 3D point.
‘X1k(mk*)’ may denote a wide-range recovered 3D point corresponding to ‘X2i(ni)’.
The processing unit 140 may update a depth value of a pixel having an index ‘t’ in the second depth image by determining an NoM ‘ni’ of the pixel to minimize ‘F2(ni)’. ‘F2(ni)’ may denote a data cost for the pixel of the second depth image calculated based on the recovered depth value of the first depth image.
In operation 364, the processing unit 140 may minimize the MRF energy of the second depth image having the recovered depth value iteratively based on the recovered depth value of the first depth image, to make the recovered depth value of the second depth image consistent with the recovered depth value of the first depth image.
The processing unit 140 may minimize the MRF energy iteratively based on Equation 14.




  
    
      
        
          
            D
            2
            t
          
          ⁡
          
            (
            
              n
              i
            
            )
          
        
        =
        
          
            
              (
              
                
                  T
                  -
                  t
                
                T
              
              )
            
            ⁢
            
              
                D
                2
              
              ⁡
              
                (
                
                  n
                  i
                
                )
              
            
          
          +
          
            
              t
              T
            
            ⁢
            
              
                F
                2
              
              ⁡
              
                (
                
                  n
                  i
                
                )
              
            
          
        
      
    
    
      
        [
        
          Equation
          ⁢
          
            
          
          ⁢
          14
        
        ]
      
    
  




‘D2t(ni)’ denote a data cost for an NoM ‘ni’ of a pixel ‘x2i’ having an index ‘I’ in the second depth image during the ‘t’th iteration. The processing unit 140 may update the depth value of ‘x2i’ by determining the NoM ‘mi’ of ‘x2i’ to minimize ‘D2t(ni)’.
When a value of ‘t’ is ‘0’, the processing unit 140 may use ‘D2(ni)’ described with reference to Equation 9 to recover the depth value of the second depth image. When a value of ‘t’ is ‘1’ or more, the processing unit 140 may use ‘F2(ni)’ described with reference to Equation 13 along with ‘D2(ni)’, to recover the depth value of the second depth image.
In operation 360, the processing unit 140 may update the recovered depth value of the first depth image and the recovered depth value of the second depth image by minimizing the MRF energy iteratively based on Equation 15, to make the first depth image and the second depth image consistent with one another.




  
    
      
        
          
            E
            1
            t
          
          =
          
            
              
                ∑
                i
              
              ⁢
              
                
                  D
                  1
                  t
                
                ⁡
                
                  (
                  
                    m
                    i
                  
                  )
                
              
            
            +
            
              λ
              ⁢
              
                
                  ∑
                  
                    
                      (
                      
                        i
                        ,
                        j
                      
                      )
                    
                    ∈
                    N
                  
                
                ⁢
                
                  
                    V
                    1
                  
                  ⁡
                  
                    (
                    
                      
                        m
                        i
                      
                      ,
                      
                        m
                        j
                      
                    
                    )
                  
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            E
            2
            t
          
          =
          
            
              
                ∑
                i
              
              ⁢
              
                
                  D
                  2
                  t
                
                ⁡
                
                  (
                  
                    n
                    i
                  
                  )
                
              
            
            +
            
              λ
              ⁢
              
                
                  ∑
                  
                    
                      (
                      
                        i
                        ,
                        j
                      
                      )
                    
                    ∈
                    N
                  
                
                ⁢
                
                  
                    V
                    2
                  
                  ⁡
                  
                    (
                    
                      
                        n
                        i
                      
                      ,
                      
                        n
                        j
                      
                    
                    )
                  
                
              
            
          
        
      
    
    
      
        [
        
          Equation
          ⁢
          
            
          
          ⁢
          15
        
        ]
      
    
  




where ‘E1t’ and ‘E2t’ may denote the MRF energy of the first depth image and the MRF energy of the second depth image during the ‘t’th iteration, respectively.
FIG. 7 illustrates examples of depth images having updated depth values according to an example embodiment.
A first updated depth image 710 may correspond to a depth image generated by updating the depth value of the first recovered depth image 510 using the depth value of the second recovered depth image 520 described with reference to FIG. 5.
A second updated depth image 720 may correspond to a depth image generated by updating the depth value of the second recovered depth image 520 using the depth value of the first recovered depth image 510 described with reference to FIG. 5.
By performing an update as described with reference to FIG. 7, the first updated depth image 710 and the second updated depth image 720 may have improved consistency, when compared to the consistency between the first recovered depth image 510 and the second recovered depth image 520.
The exemplary embodiments may recover depth values of depth images taken with a plurality of cameras at the same time, by using the depth images. Also, the exemplary embodiments may recover the depth values of the depth images in a case in which a moving object is present independently of a motion of the plurality of cameras. In this instance, the recovered depth values may be a depth value of wide-range depth which is equal to or greater than the maximum acquirable distance.
The units described herein may be implemented using hardware components, software components, or a combination thereof. For example, a processing device may be implemented using one or more general-purpose or special purpose computers, such as, for example, a processor, a controller and an arithmetic logic unit, a digital signal processor, a microcomputer, a field programmable array, a programmable logic unit, a microprocessor or any other device capable of responding to and executing instructions in a defined manner. The processing device may run an operating system (OS) and one or more software applications that run on the OS. The processing device also may access, store, manipulate, process, and create data in response to execution of the software. For purpose of simplicity, the description of a processing device is used as singular; however, one skilled in the art will appreciated that a processing device may include multiple processing elements and multiple types of processing elements. For example, a processing device may include multiple processors or a processor and a controller. In addition, different processing configurations are possible, such a parallel processors. The one or more processors may include a microprocessor, central processing unit (CPU), digital signal processor (DSP), or application-specific integrated circuit (ASIC), as well as portions or combinations of these and other processing devices.
The software may include a computer program, a piece of code, an instruction, or some combination thereof, for independently or collectively instructing or configuring the processing device to operate as desired. Software and data may be embodied permanently or temporarily in any type of machine, component, physical or virtual equipment, computer storage medium or device, or in a propagated signal wave capable of providing instructions or data to or being interpreted by the processing device. The software also may be distributed over network coupled computer systems so that the software is stored and executed in a distributed fashion. In particular, the software and data may be stored by one or more computer readable recording mediums.
The methods according to the above-described embodiments may be recorded in non-transitory computer-readable media including program instructions to implement various operations embodied by a computer. The media may also include, alone or in combination with the program instructions, data files, data structures, and the like. Examples of non-transitory computer-readable media include magnetic media such as hard discs, floppy discs, and magnetic tape; optical media such as CD ROM discs and DVDs; magneto-optical media such as optical discs; and hardware devices that are specially configured to store and perform program instructions, such as read-only memory (ROM), random access memory (RAM), flash memory, and the like. Examples of program instructions include both machine code, such as produced by a compiler, and files containing higher level code that may be executed by the computer using an interpreter. The described hardware devices may be configured to act as one or more software modules in order to perform the operations of the above-described embodiments, or vice versa.
Each block of the flowchart illustrations may represent a unit, module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks may occur out of the order. For example, two blocks shown in succession may in fact be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
Although example embodiments of the present invention have been shown and described, it would be appreciated by those skilled in the art that changes may be made to these embodiments without departing from the principles and spirit of the disclosure, the scope of which is defined by the claims and their equivalents.

## Claims

1. A method of processing a depth image, the method comprising:
receiving a first depth image and a second depth image, the first depth image indicating an estimated first distance between a first depth camera and an object, and the second depth image indicating an estimated second distance between a second depth camera and the object;
determining a number of mods (NoM) of corresponding pixels in the first depth image and the second depth image such that the determined NoM represents a number of periodic phase wrappings in the estimated first distance and the estimated second distance; and
recovering a depth value for at least one of the estimated first distance and the estimated second distance based on the determined NoM,
wherein the corresponding pixels represent a same three-dimensional (3D) point.

2. The method of claim 1, wherein the determining comprises:
determining a NoM of a pixel in the first depth image to minimize a Markov random field (MRF) energy of the first depth image; and
determining a NoM of a pixel in the second depth image to minimize a MRF energy of the second depth image.

3. The method of claim 2, wherein the MRF energy of the first depth image is determined based on a data cost for a pixel in the first depth image and a discontinuity cost for at least two neighboring pixels in the first depth image, and
the MRF energy of the second depth image is determined based on a data cost for a pixel in the second depth image and a discontinuity cost for at least two neighboring pixels in the second depth image, and
the 3D distance corresponding to a distance between a camera used to generate a depth image including a pixel and a 3D point corresponding to the pixel.

4. The method of claim 3, wherein a first pixel in the first depth image and a second pixel in the second depth image are corresponding pixels, and
the data cost is calculated by the determined NoM of the first pixel and the determined NoM of the second pixel which minimize a distance between a first 3D point recovered by applying an NoM to the first pixel and a second 3D point recovered by applying an NoM to the second pixel.

5. The method of claim 4, wherein a value of the data cost is changed to a threshold value by a robust potential function when the value of the calculated data cost is greater than the threshold value.

6. The method of claim 3, wherein the discontinuity cost is based on a constraint of NoMs in two spatially neighboring pixels in one depth image being the same when 3D distances between the two pixels are similar to one another.

7. The method of claim 1, further comprising:
updating the recovered depth value of the first depth image using the second depth image having the recovered depth value such that the recovered depth value of the first depth image is consistent with the recovered depth value of the second depth image.

8. The method of claim 7, wherein the updating comprises:
updating the recovered depth image of the first depth image by minimizing a Markov random field (MRF) energy of the first depth image having the recovered depth value iteratively based on the recovered depth value of the second depth image.

9. The method of claim 1, further comprising:
generating the first depth image; and
generating the second depth image,
the first depth image and the second depth image being generated by photographing a scene using at least the first depth camera and the second depth camera, respectively, the first depth camera and the second depth camera being arranged at at least one of different locations and different directions.

10. A non-transitory computer-readable recording medium comprising a program for implementing the method of claim 1.

11. An apparatus for processing a depth image, the apparatus comprising:
a receiver configured to receive a first depth image and a second depth image, the first depth image indicating an estimated first distance between a first depth camera and an object, and the second depth image indicating an estimated second distance between a second depth camera and the object; and
a processor configured to,
determine a number of mods (NoM) of corresponding pixels in the first depth image and the second depth image such that the determined NoM represents a number of periodic phase wrappings in the estimated first distance and the estimated second distance, and
recover a depth value for at least one of estimated first distance and the estimated second distance based on the determined NoM,

wherein the corresponding pixels represent a same three-dimensional (3D) point.

12. The apparatus of claim 11, wherein the processor is configured to determine a NoM of a pixel in the first depth image to minimize a Markov random field (MRF) energy of the first depth image, and to determine a NoM of a pixel in the second depth image to minimize a MRF energy of the second depth image.

13. The apparatus of claim 12, wherein the processor is configured to determine the MRF energy of the first depth image based on a data cost for a pixel in the first depth image and a discontinuity cost for at least two neighboring pixels in the first depth image, and to determine the MRF energy of the second depth image based on a data cost for a pixel in the second depth image and a discontinuity cost for at least two neighboring pixels in the second depth image, and
the 3D distance corresponds to a distance between a camera used to generate a depth image including a pixel and a 3D point corresponding to the pixel.

14. The apparatus of claim 13, wherein the processor is configured to calculate the data cost by calculating the determined NoM of the first pixel and the determined NoM of the second pixel which minimize a distance between a first 3D point recovered by applying an NoM to the first pixel and a second 3D point recovered by applying an NoM to the second pixel.

15. The apparatus of claim 14, wherein the processor is configured to change a value of the data cost to a threshold value by a robust potential function when the value of the calculated data cost is greater than the threshold value.

16. The apparatus of claim 13, wherein the discontinuity cost is based on a constraint of NoMs in two spatially neighboring pixels in one depth image being the same when 3D distances between the two pixels are similar to one another.

17. The apparatus of claim 12, wherein the processor is configured to update the recovered depth value of the first depth image using the second depth image having the recovered depth value such that the recovered depth value of the first depth image is consistent with the recovered depth value of the second depth image.

18. The apparatus of claim 17, wherein the processing unit is configured to update the recovered depth image of the first depth image by minimizing a Markov random field (MRF) energy of the first depth image having the recovered depth value iteratively based on the recovered depth value of the second depth image.

19. The apparatus of claim 11, wherein,
the first depth camera is configured to generate the first depth image by photographing a scene,
the second depth camera is configured to generate the second depth image by photographing the scene, and
the first depth camera and the second depth camera are configured to photograph the scene from at least one of different locations and different directions.

20. A method of processing a depth image, the method comprising:
receiving a first depth image and a second depth image, the first depth image indicating an estimated first distance between a first depth camera and an object, and the second depth image indicating an estimated second distance between a second depth camera and the object;
determining a number of mods (NoM) for a first pixel from the first depth image by minimizing a Markov random field (MRF) energy of the first depth image such that the determined NoM for the first pixel represents a number of periodic phase wrappings in the estimated first distance;
determining a NoM for a second pixel from the second depth image by minimizing a MRF energy of the second depth image such that the determined NoM for the second pixel represents a number of periodic phase wrappings in the estimated second distance;
recovering a depth value for the first pixel from the first depth image based on the determined NoM for the first pixel;
recovering a depth value for the second pixel from the second depth image based on the determined NoM for the second pixel; and
updating the recovered depth value for the first pixel based on the recovered depth value of the first depth image,
wherein the first and second pixels represent a same three-dimensional (3D) point.

21. The method of claim 20, wherein the minimizing a MRF energy of the first depth image comprises calculating a data cost by calculating the determined NoM of the first pixel which minimizes a distance between a first 3D point recovered by applying an NoM to the first pixel and a second 3D point recovered by applying an NoM to the second pixel.

22. The method of claim 20, wherein the updating the recovered depth value for the first pixel includes minimizing the MRF energy of the first depth image iteratively.