# Patent

## Title
Dynamic gesture recognition from stereo sequences

## Abstract

According to an embodiment, an apparatus and method are disclosed for dynamic gesture recognition from stereo sequences. In an embodiment, a stereo sequence of images of a subject is obtained and a depth disparity map is generated from the stereo sequence. The system is initiated automatically based upon a statistical model of the upper body of the subject. The upper body of the subject is modeled as three planes, representing the torso and arms of the subject, and three Gaussian components, representing the head and hands of the subject. The system tracks the upper body of the subject using the statistical upper body model and extracts three-dimensional features of the gestures performed. The system recognizes the gestures using recognition units, which, under a particular embodiment, utilizes hidden Markov models for the three-dimensional gestures.

## Background
RELATED APPLICATIONS
This application is related to and claims priority from U.S. provisional application 60/371,178, filed Apr. 9, 2002, entitled “Dynamic Gesture Recognition from Stereo Sequences”; and PCT application RU01/00296, international filing date Jul. 18, 2001, entitled “Dynamic Gesture Recognition from Stereo Sequences”.


FIELD OF THE INVENTION
This invention relates to system interfaces in general, and more specifically to dynamic gesture recognition from stereo sequences.
BACKGROUND OF THE INVENTION
The field of gesture recognition for computer systems has been developing in recent years. In general, a gesture recognition system will recognize physical gestures made by an individual and respond according to an interpretation of the gestures. Gesture recognition may be used in a computer interface, for interpreting sign language, in industrial control, in entertainment applications, or for numerous other purposes. The challenge in gesture recognition systems is to provide a simple, easy to use system that is also highly accurate in interpretation of gestures.
In conventional gesture recognition systems, the process may proceed as shown in FIG. 1. A video sequence is captured, process block 100, from a video source, such as a conventional video camera. The process of background removal, process block 110, attempts to eliminate the portion of an image from the video sequence that contains the background, which is any portion of the image that doesn't include the subject performing the gestures that are being interpreted. If the video frame is the first frame of the video sequence, process block 120, the process continues to the manual initialization stage, process block 130. In manual initialization, process block 120, the position and orientation of the visible parts (generally the head, hands, arms, and torso) of the subject are determined. Conventional systems generally utilize manual initialization processes in which, for example, the process may initialize by requiring the subject to begin by holding his or her arms and hands in a predetermined position. In other systems the system may initialize on the subject by the process of the subject placing colored gloves on his or her hands or colored markers on the subjects' hands and head.
If the video frame is not the first frame in the sequence, process block 120, the conventional system then proceeds with the process of tracking the upper body of the subject, process block 140. Upon initializing the system or tracking the upper body of the subject to its new position, the process of feature extraction, process block 150, is the process of determining the features that best describe hand gestures and best discriminate among various gestures. Often the features used in dynamic hand gesture recognition are derived from the position of the hands in the image plane or from the relative position of the hands to the head of the subject. In the conventional system, the input is an image in two-dimensional form and the upper body may be characterized as six Gaussian “blobs”, which comprise the head, trunk, two arms and two hands of the subject. The conventional system then continues with operation of the recognition units 160, which are intended to identify the gesture made by the subject. The recognition units may include hidden Markov models (HMM).
A conventional gesture recognition system is limited in a number of ways. The use of two-dimensional images may provide insufficient depth of field information to properly detect upper body positions, which may lead to misinterpretation of gestures. The need to initialize a gesture recognition system with specified gestures or the use of special devices creates additional difficulty in using a system and may discourage users from attempting to access a system that incorporates gesture recognition.



BRIEF DESCRIPTION OF THE DRAWINGS
The appended claims set forth the features of the invention with particularity. The invention, together with its advantages, may be best understood from the following detailed descriptions taken in conjunction with the accompanying drawings, of which:
FIG. 1 is a flow diagram illustrating a conventional gesture recognition system;
FIG. 2 is a flow diagram illustrating an embodiment of a dynamic gesture recognition system;
FIG. 3 is a flow diagram illustrating the hidden Markov model used in a particular embodiment;
FIG. 4 is an illustration of an arrangement of a dynamic gesture recognition system.
FIG. 5 is a flow diagram illustrating the segmentation of the image during initialization;
FIG. 6 illustrates an image of a subject and a background;
FIG. 7 illustrates an image of a subject with the background removed;
FIG. 8 illustrates the process of torso segmentation;
FIG. 9 illustrates the process of head segmentation;
FIG. 10 illustrates the process of arms segmentation; and
FIG. 11 illustrates the process of hands segmentation.



DETAILED DESCRIPTION
A method and apparatus are described for dynamic gesture recognition from stereo sequences.
In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. In other instances, well-known structures and devices are shown in block diagram form.
The present invention includes various processes, which will be described below. The processes of the present invention may be performed by hardware components or may be embodied in machine-executable instructions, which may be used to cause a general-purpose or special-purpose processor or logic circuits programmed with the instructions to perform the processes. Alternatively, the processes may be performed by a combination of hardware and software.
FIG. 2 contains a flow diagram illustrating an embodiment of a dynamic gesture recognition system. In this embodiment, images are obtained through the capture of stereo video sequences, process block 200. The stereo video sequences may be captured using a stereo camera or using multiple cameras. From the stereo images, the system then includes the creation of a depth disparity map, process block 210, from which the depth of field of the images may be determined. The system then removes the background 220, which, according to one embodiment, may be accomplished through removal of any portions of an image that are too far from the imaging device to be part of the subject.
If the video frame is the first frame in the sequence, process block 230, the embodiment provides for automatic initialization, process block 240, which allows for the initialization of the system based upon matching the upper body of the subject to a statistical model of the upper body of an individual. If the video frame is not the first frame in the sequence, process block 230, the embodiment provides for the tracking of the subject's upper body using the upper body model, process block 250. If the tracking of the subject is not sufficient, process block 260, the process returns to automatic initialization, process block 240, to re-initialize the system. The embodiment thus describes a decision criterion for the failure of the tracking system.
Upon initializing the system or tracking the upper body of the subject to its new position, three-dimensional feature extraction, process block 270 is utilized, rather than extraction of features in two dimensions as in conventional systems. This is followed by recognition units for the three-dimensional features, process block 280, to identify the dynamic gesture. In a particular embodiment, recognition units 280 utilize hidden Markov models. However, unlike conventional systems, the hidden Markov models describe the trajectories of the hands in three dimensions. In one embodiment, a gesture made by a subject is recognized and interpreted by comparing the dynamic gesture to a database of known three-dimensional gestures, process block 290.
Hidden Markov models are well-known processing systems and thus will not be explained in detail. A hidden Markov model is a finite set of states, with each of the states having a probability distribution. Transitions between the states in the model are governed by a set of probabilities that are referred to as transition probabilities. While in a particular state of the model, an observation can be made, but the actual state is not observable. For this reason, the states are referred to as hidden. In a particular embodiment, a continuous five states, left-to-right hidden Markov model is utilized. In this embodiment, no skip states are allowed and each state is modeled by a mixture of three Gaussian density functions. The model is illustrated in FIG. 3, with the five states of the model being states 300, 310, 320, 330, and 340.
An equipment arrangement for a particular embodiment is shown in FIG. 4. In this embodiment, the subject 400 is seated in front of a computer or terminal 410. Placed on the top of the terminal is an imaging device 420. Imaging device 420 is shown in FIG. 4 as a stereo camera, but multiple cameras could be used in other embodiments.
In an embodiment, a statistical framework for upper body segmentation is used. An embodiment includes tracking of the upper body from stereo images, and uses the trajectories of the hands of the subject as observations for HMM-based three-dimensional gesture recognition. Dense disparity maps are used in the system, generated from the stereo images. The system provides accurate gesture recognition when encountering varying illumination conditions, partial occlusions, and self-occlusions. Unlike conventional gesture recognitions systems that require a user guided initialization, the approach to upper body segmentation under an embodiment make use of a minimal set of assumptions regarding the relative position of the subject to the image capturing device for initialization. Following the initialization, the model parameters are tracked over consecutive frames and the new values of the parameters are updated, or re-initialized, using an expectation maximization algorithm. The three-dimensional positions of the hands of the subject are used as observation vectors for the gesture recognition system.
According to an embodiment, the video sequence is a novel stereo image of the subject. According to one embodiment, a depth disparity map is generated from the stereo image. According to another embodiment, the stereo image is obtained from a stereo camera that generates the needed depth information without the need for additional depth disparity map generation. The use of such a stereo camera allows the operation of the system without the need for the large number of computations that are required to generate a depth disparity map.
Additional details regarding of the gesture recognition system are provided as follows:
Image Model and Upper Body Model—The statistical model for the upper body consists of a set of three planar components, describing the torso and the arms of the subject, and a set of three Gaussian blob components, representing the head and hands of the subject. For the purposes of this description, the parameters of each planar component (the mth planar component) are referred to as πm and the parameters of each of the Gaussian components (the nth Gaussian component) are referred to as βn. The set of planar and Gaussian components that make up the states of the upper body of the subject then are:

Ω={πm, βn}with m=1,2,3 and n=1,2,3  [1]

In an image of the subject, an observation vector Oi,j is the pixel in the ith row and the jth column in the image, and consists of the three dimensional position of the pixel as obtained from the disparity maps




  
    O
    
      i
      ,
      j
    
    d
  
  =
  
    
      {
      
        x
        ,
        y
        ,
        z
      
      }
    
    
      i
      ,
      j
    
  




and of the color of the pixel in the image space Oi,jc. Oi,j is obtained by concatenating color Oi,jc and depth disparity Oi,jd.

If it is assumed that all of the observations vectors are independent, then the probability of a particular observation sequence O=[Oi,j|all i,j] given the image model is:




  
    
      
        
          P
          ⁡
          
            (
            
              
                O
                _
              
              |
              I
            
            )
          
        
        =
        
          
            ∏
            
              i
              ,
              j
            
          
          ⁢
          
            
          
          ⁢
          
            {
            
              
                P
                ⁡
                
                  (
                  
                    
                      O
                      
                        i
                        ,
                        j
                      
                    
                    |
                    Ω
                  
                  )
                
              
              +
              
                P
                ⁡
                
                  (
                  
                    
                      O
                      
                        i
                        ,
                        j
                      
                    
                    |
                    backgnd
                  
                  )
                
              
            
            }
          
        
      
    
    
      
        [
        2
        ]
      
    
  




where P(Oi,j|Ω) is the probability of the observation vector given the upper body model and P(Oi,j|backgnd) is the probability of the observation vector given the background that is behind the subject. In one embodiment, the probability of the observation vector given the background is obtained from the Gaussian distribution at each pixel in the image obtained from a sequence of clean background scenes, without a subject. In another embodiment, the computational complexity of the system is reduced by modeling only the observation vectors that are not assigned to the background. In a three-dimensional system in which the depth of field may be determined, any image that is not close enough to the camera to be a part of the subject is then part of the background. As the subject is in the foreground, the probability of a sequence of foreground observations OF given the upper body model is then defined as:





  
    
      
        
          P
          ⁡
          
            (
            
              
                
                  O
                  _
                
                F
              
              |
              Ω
            
            )
          
        
        =
        
          
            ∏
            
              i
              ,
              
                j
                ∈
                F
              
            
          
          ⁢
          
            
          
          ⁢
          
            {
            
              
                
                  ∑
                  
                    m
                    =
                    1
                  
                  3
                
                ⁢
                
                  
                
                ⁢
                
                  
                    
                      P
                      
                        0
                        ,
                        
                          π
                          m
                        
                      
                    
                    ⁡
                    
                      (
                      
                        O
                        
                          i
                          ,
                          j
                        
                      
                      )
                    
                  
                  ⁢
                  
                    P
                    ⁡
                    
                      (
                      
                        
                          O
                          
                            i
                            ,
                            j
                          
                        
                        |
                        
                          π
                          m
                        
                      
                      )
                    
                  
                
              
              +
              
                
                  ∑
                  
                    n
                    =
                    1
                  
                  3
                
                ⁢
                
                  
                
                ⁢
                
                  
                    
                      P
                      
                        0
                        ,
                        
                          β
                          n
                        
                      
                    
                    ⁡
                    
                      (
                      
                        O
                        
                          i
                          ,
                          j
                        
                      
                      )
                    
                  
                  ⁢
                  
                    P
                    ⁡
                    
                      (
                      
                        
                          O
                          
                            i
                            ,
                            j
                          
                        
                        |
                        
                          β
                          n
                        
                      
                      )
                    
                  
                
              
              +
              
                u
                
                  i
                  ,
                  j
                
              
            
            }
          
        
      
    
    
      
        [
        3
        ]
      
    
  




where ui,j is a uniform distribution that models the image noise and P0,πm and P0,βn are the a priori probabilities of the planar and Gaussian states of the upper body model. In an embodiment, the initial values of the a priori probabilities are chosen uniformly for all of the upper body components.

After the initialization of the upper body model, the values of the a priori probabilities are estimated from the corresponding parameters of the model states. Probabilities P(Oi,j|πm) and P(Oi,j|βn) are the probabilities of the observation vectors Oi,j given the planar πm and Gaussian βn components. Given these probabilities, then the probability density function (pdf) for a Gaussian component of an image is:




  
    
      
        
          P
          ⁡
          
            (
            
              
                O
                
                  i
                  ,
                  j
                
              
              |
              β
            
            )
          
        
        =
        
          
            1
            
              
                
                  (
                  
                    2
                    ⁢
                    π
                  
                  )
                
                
                  D
                  /
                  2
                
              
              |
              C
              ⁢
              
                |
                
                  1
                  /
                  2
                
              
            
          
          ⁢
          
            exp
            ⁡
            
              [
              
                
                  -
                  
                    1
                    2
                  
                
                ⁢
                
                  
                    (
                    
                      
                        O
                        
                          i
                          ,
                          j
                        
                      
                      -
                      
                        μ
                        _
                      
                    
                    )
                  
                  T
                
                ⁢
                
                  
                    C
                    
                      -
                      1
                    
                  
                  ⁡
                  
                    (
                    
                      
                        O
                        
                          i
                          ,
                          j
                        
                      
                      -
                      
                        μ
                        _
                      
                    
                    )
                  
                
              
              ]
            
          
        
      
    
    
      
        [
        4
        ]
      
    
  




where μ is the mean vector and C is the covariance of the Gaussian probability density function. For the purposes of an embodiment of the gesture recognition system, the parameters of the Gaussian components are designated as β=(μ,C). Because the color distribution and the three-dimensional position can be considered to be independent random variables, the probability of the observation vectors Oi,j given the planar components (arms and torso) can be decomposed as

P(Oi,j|π)=P(Oi,jd|π)P(Oijc|π)  [5]

In equation [5], P(Oijc|π) can be a Gaussian probability density function or can be a mixture of Gaussian probability density functions describing the color distribution of the pixels assigned to the plane. According to one embodiment, for simplification, a uniform distribution over the entire range of hue values (for example 0, . . . , 255 for 256 colors) is used. The probability of the observation vectors Oi,jd given the planar component π can be defined by the following planar probability density function:




  
    
      
        
          P
          ⁡
          
            (
            
              
                O
                
                  i
                  ,
                  j
                
                d
              
              |
              π
            
            )
          
        
        =
        
          
            1
            
              
                2
                ⁢
                π
                ⁢
                
                  
                
                ⁢
                
                  σ
                  z
                  2
                
              
            
          
          ⁢
          
            exp
            ⁡
            
              (
              
                -
                
                  
                    
                      (
                      
                        
                          z
                          ij
                        
                        -
                        
                          (
                          
                            
                              ax
                              ij
                            
                            +
                            
                              by
                              ij
                            
                            +
                            c
                          
                          )
                        
                      
                      )
                    
                    2
                  
                  
                    2
                    ⁢
                    
                      σ
                      2
                    
                  
                
              
              )
            
          
        
      
    
    
      
        [
        6
        ]
      
    
  




From equation [6], it then can be discerned that the planar probability density function describes a Gaussian distribution with mean μ=axij+byij+c and with variance σz2. For the purposes of this description, the parameters of the planar components are defined as πm=(a, b, c, σz2) for m=1, 2, 3.
Upper Body Segmentation—Model Initialization—The optimal set of parameters for the upper body model are obtained through an estimation maximization (EM) algorithm by maximizing P(O|Ω) with respect to the model parameters. This corresponds to the estimation maximization algorithm applied to the upper body model. Since the estimation maximization is in essence a local optimization algorithm, its convergence to the global solution depends heavily on the initial estimate of the model parameters. To ensure the correct convergence of the estimation maximization algorithm, the segmentation algorithm proceeds in two processes. In the first process, the system initializes the parameters of each class and determines the visibility of each component in the image. In the second process, all of the model parameters are simultaneously re-estimated, thereby producing a tighter fit to the data.
The initialization process is in essence a sequence of two-class classification problems that are repeated for each component of the model. In each of these problems, the data is assigned to either one component of the upper body or to a “residual” class of the remaining unassigned data. The data assigned to the residual class in the first classification problem becomes the input to the second classification process, where it either is re-assigned to the next body component or becomes a part of the new residual class. This process is repeated until all of the data is classified or until all of the upper body components are initialized. The remaining residual class is modeled by a uniform distribution. Note that that the embodiment described herein utilizes a particular order of segmentation, but those in the field will recognize that other segmentation orders are possible and embodiments are not limited to the description provided herein.
A block diagram of an initialization process is shown in FIG. 5. In the foreground-background segmentation process, process block 500, the background of an image of a subject is eliminated. In one embodiment, all pixels in the image that have a depth indicating a distance that is greater than a specified distance from the camera or other imaging device are assigned to the background and are eliminated. The remaining pixels are assigned to the foreground. In the torso segmentation process, process block 510, the plane of the torso is identified in foreground, with the remaining pixels going into the residual class. The head segmentation process, process block 520, identifies the head Gaussian blob, with the remaining pixels going into the new residual class. In the arms segmentation process, process block 530, the planes of the left and right arms are identified in a similar manner to the torso plane, with the remaining pixels going into the new residual class. Using the remaining pixels in the residual class, the left and right hand Gaussian blobs are identified in the hands segmentation process, process block 540.
Embodiments of the initialization segmentation processes are described in more depth as follows:
Background-Foreground Segmentation—The first process of the model initialization is the background segmentation. All of the pixels in the image that are farther away from the camera than a predetermined threshold, or for which there is not valid depth information, are assigned to the background. The remaining pixels are assigned to the upper body. If a stationary background is assumed, then the use of colors may improve the segmentation results. However, a stationary background is often a difficult condition to maintain, and making the wrong assumption on the background statistics can dramatically decrease the accuracy of the segmentation results. For this reason, in a particular embodiment the depth information alone is used for background-foreground segmentation.
FIG. 6 is an illustration of an image of a subject that has been captured by the camera or other imaging device. Note that the images presented herein are necessarily limited to two dimensions, but images captured in an embodiment include depth information, thereby creating three-dimensional image data. The image 600 is comprised of a foreground 610, which is the subject, and a background 620. A result of foreground-background segmentation is shown in FIG. 7. If the segmentation has proceeded accurately, the image 700 now includes only the foreground 710 including the pixels showing the subject, while the pixels of the background 720 have been eliminated. For simplicity in illustration, FIGS. 7 through 11 show all pixels in the background eliminated, but in practice certain pixels in the background may be included in the foreground and certain pixels in the foreground may be included in the background. Similarly, pixels representing certain of the body segments of the subject may be allocated to other body segments.
Torso Segmentation—Any pixels assigned to the foreground are either generated by the torso plane or by the residual class of uniform distribution. Assuming that all observation vectors are independent random variables, the probability of observation vectors Oi,j given the foreground image model ΩF is given by:




  
    
      
        
          P
          ⁡
          
            (
            
              
                O
                _
              
              F
            
            )
          
        
        =
        
          
            ∏
            
              i
              ,
              
                j
                ∈
                F
              
            
          
          ⁢
          
            
          
          ⁢
          
            {
            
              
                
                  ∑
                  
                    
                      all
                      ⁢
                      
                        
                      
                      ⁢
                      i
                    
                    ,
                    
                      j
                      ∈
                      F
                    
                  
                
                ⁢
                
                  
                
                ⁢
                
                  
                    P
                    ⁡
                    
                      (
                      
                        
                          O
                          
                            i
                            ,
                            j
                          
                          d
                        
                        |
                        π
                      
                      )
                    
                  
                  ⁢
                  
                    P
                    ⁡
                    
                      (
                      
                        
                          O
                          
                            i
                            ,
                            j
                          
                          c
                        
                        |
                        π
                      
                      )
                    
                  
                
              
              +
              
                u
                
                  i
                  ,
                  j
                
              
            
            }
          
        
      
    
    
      
        [
        7
        ]
      
    
  




where ui,j is a uniform distribution that describes all of the residual class. The goal of the EM algorithm is to find the plane parameters such that π will maximize P(O). Since Oi,jc is a uniform distribution, it can be disregarded from the derivation of the EM algorithm. Let {tilde over (π)} be the plane parameters after re-estimation. The new plane parameters are obtained after setting the derivatives of E{P(O)log P(O)} to zero with respect to the parameters of the planar state π. As a consequence, the re-estimated plane parameters are obtained by solving the following M-step (maximization) equations:





  
    
      
        
          a
          ~
        
        =
        
          
            
              
                C
                yy
              
              ⁢
              
                C
                xz
              
            
            -
            
              
                C
                yz
              
              ⁢
              
                C
                xy
              
            
          
          
            
              
                C
                yy
              
              ⁢
              
                C
                xx
              
            
            -
            
              C
              xy
              2
            
          
        
      
    
    
      
        [
        8
        ]
      
    
  
  
    
      
        
          b
          ~
        
        =
        
          
            
              C
              yz
            
            -
            
              
                a
                ~
              
              ⁢
              
                C
                xy
              
            
          
          
            C
            yy
          
        
      
    
    
      
        [
        9
        ]
      
    
  




{tilde over (c)}=μz−ãμx−{tilde over (b)}μy   [10]





  
    
      
        
          
            σ
            ~
          
          2
        
        =
        
          
            
              ∑
              
                
                  all
                  ⁢
                  
                    
                  
                  ⁢
                  i
                
                ,
                j
              
            
            ⁢
            
              
                (
                
                  z
                  -
                  ax
                  -
                  by
                  -
                  c
                
                )
              
              ⁢
              
                
                  γ
                  
                    i
                    ,
                    j
                  
                
                ⁡
                
                  (
                  π
                  )
                
              
            
          
          
            
              ∑
              
                
                  all
                  ⁢
                  
                    
                  
                  ⁢
                  i
                
                ,
                j
              
            
            ⁢
            
              
                γ
                
                  i
                  ,
                  j
                
              
              ⁡
              
                (
                π
                )
              
            
          
        
      
    
    
      
        [
        11
        ]
      
    
  




With the covariance matrix C being:





  
    
      
        C
        =
        
          (
          
            
              
                
                  C
                  xx
                
              
              
                
                  C
                  xy
                
              
              
                
                  C
                  xz
                
              
            
            
              
                
                  C
                  yx
                
              
              
                
                  C
                  yy
                
              
              
                
                  C
                  yz
                
              
            
            
              
                
                  C
                  zx
                
              
              
                
                  C
                  zy
                
              
              
                
                  C
                  zz
                
              
            
          
          )
        
      
    
    
      
        [
        12
        ]
      
    
  




From this, the a posteriori probability γi,j(π), the mean vector μ=[μx, μy, μz], and the covariance vector C are obtained in the E-step (estimation) equations:





  
    
      
        
          
            γ
            
              i
              ,
              j
            
          
          ⁡
          
            (
            π
            )
          
        
        =
        
          
            P
            ⁡
            
              (
              
                
                  O
                  
                    i
                    ,
                    j
                  
                  d
                
                |
                π
              
              )
            
          
          
            
              P
              ⁢
              
                (
                
                  
                    O
                    
                      i
                      ,
                      j
                    
                    d
                  
                  |
                  π
                
                )
              
            
            +
            
              u
              
                i
                ,
                j
              
            
          
        
      
    
    
      
        [
        13
        ]
      
    
  
  
    
      
        
          μ
          _
        
        =
        
          
            ∑
            
              
                all
                ⁢
                
                  
                
                ⁢
                i
              
              ,
              j
            
          
          ⁢
          
            
              
                
                  γ
                  
                    i
                    ,
                    j
                  
                
                ⁡
                
                  (
                  π
                  )
                
              
              ⁢
              
                O
                
                  i
                  ,
                  j
                
                d
              
            
            
              
                ∑
                
                  
                    all
                    ⁢
                    
                      
                    
                    ⁢
                    i
                  
                  ,
                  j
                
              
              ⁢
              
                
                  γ
                  
                    i
                    ,
                    j
                  
                
                ⁡
                
                  (
                  π
                  )
                
              
            
          
        
      
    
    
      
        [
        14
        ]
      
    
  
  
    
      
        C
        =
        
          
            ∑
            
              
                all
                ⁢
                
                  
                
                ⁢
                i
              
              ,
              j
            
          
          ⁢
          
            
              
                
                  γ
                  
                    i
                    ,
                    j
                  
                
                ⁡
                
                  (
                  π
                  )
                
              
              ⁢
              
                (
                
                  
                    O
                    
                      i
                      ,
                      j
                    
                    d
                  
                  -
                  
                    μ
                    _
                  
                
                )
              
              ⁢
              
                
                  (
                  
                    
                      O
                      
                        i
                        ,
                        j
                      
                      d
                    
                    -
                    
                      μ
                      _
                    
                  
                  )
                
                T
              
            
            
              
                ∑
                
                  
                    all
                    ⁢
                    
                      
                    
                    ⁢
                    i
                  
                  ,
                  j
                
              
              ⁢
              
                
                  γ
                  
                    i
                    ,
                    j
                  
                
                ⁡
                
                  (
                  π
                  )
                
              
            
          
        
      
    
    
      
        [
        15
        ]
      
    
  




The EM algorithm is repeated until convergence is reached, which is when P(OF) at consecutive iteration falls below a convergence threshold. Given the re-estimated plane parameters, all pixels for which P(Oi,j|π)>ui,j are assigned to the torso plane. One essential condition for the convergence of the EM algorithm to the correct set of parameters is that the torso represents the largest region of the upper body. Under a large variety of situations, excluding strong occlusions of the torso by the arms, it can be assumed that during the initialization stage that this condition is met.
FIG. 8 illustrates the torso segmentation under an embodiment. The image 800 includes the plane of the torso 810 and the residual class of pixels 820. The residual class would include the remaining pixels showing the subject, those being the head, arms, and hands of the subject.
Head Segmentation—The initial position of the head is determined by searching the area above the torso. However, it is possible that the head was included within the torso plane and the area above the torso contains a small number of noisy points. In this case, the system looks for the head in the upper region of the torso. Exploiting the depth information further, the apparent size of the head in image plane can be obtained from the distance and orientation of the torso plane from the camera. The probability of the observation sequence OH in the initial head region H is given by:




  
    
      
        
          P
          ⁡
          
            (
            
              O
              H
            
            )
          
        
        =
        
          
            ∏
            
              
                all
                ⁢
                
                  
                
                ⁢
                i
              
              ,
              
                j
                ⁢
                
                  
                
                ⁢
                ε
                ⁢
                
                  
                
                ⁢
                H
              
            
          
          ⁢
          
            {
            
              
                P
                ⁡
                
                  (
                  
                    
                      O
                      
                        i
                        ,
                        j
                      
                    
                    ❘
                    β
                  
                  )
                
              
              +
              
                u
                
                  i
                  ,
                  j
                
              
            
            }
          
        
      
    
    
      
        [
        16
        ]
      
    
  




In equation [16], ui,j is a uniform density function corresponding to the residual class of the head region. The parameters of the head Gaussian blob are re-estimated using the EM algorithm for Gaussian density functions:





  
    
      
        
          
            μ
            ~
          
          _
        
        =
        
          
            ∑
            
              
                all
                ⁢
                
                  
                
                ⁢
                i
              
              ,
              j
            
          
          ⁢
          
            
              
                
                  γ
                  
                    i
                    ,
                    j
                  
                
                ⁡
                
                  (
                  β
                  )
                
              
              ⁢
              
                O
                
                  i
                  ,
                  j
                
              
            
            
              
                ∑
                
                  
                    all
                    ⁢
                    
                      
                    
                    ⁢
                    i
                  
                  ,
                  j
                
              
              ⁢
              
                
                  γ
                  
                    i
                    ,
                    j
                  
                
                ⁡
                
                  (
                  β
                  )
                
              
            
          
        
      
    
    
      
        [
        17
        ]
      
    
  
  
    
      
        
          c
          ~
        
        =
        
          
            ∑
            
              i
              ,
              j
            
          
          ⁢
          
            
              
                
                  γ
                  
                    i
                    ,
                    j
                  
                
                ⁡
                
                  (
                  β
                  )
                
              
              ⁢
              
                (
                
                  
                    O
                    
                      i
                      ,
                      j
                    
                  
                  -
                  
                    μ
                    _
                  
                
                )
              
              ⁢
              
                
                  (
                  
                    
                      O
                      
                        i
                        ,
                        j
                      
                    
                    -
                    
                      μ
                      _
                    
                  
                  )
                
                T
              
            
            
              
                
                  ∑
                  
                    
                      all
                      ⁢
                      
                        
                      
                      ⁢
                      i
                    
                    ,
                    j
                  
                
                ⁢
                
                  
                    γ
                    
                      i
                      ,
                      j
                    
                  
                  ⁡
                  
                    (
                    β
                    )
                  
                
              
              ⁢
              
                

              
              ⁢
              
                where
                :
              
            
          
        
      
    
    
      
        [
        18
        ]
      
    
  
  
    
      
        
          
            γ
            
              i
              ,
              j
            
          
          ⁡
          
            (
            β
            )
          
        
        =
        
          
            P
            (
            
              
                
                  O
                  
                    i
                    ,
                    j
                  
                
                ⁢
                
                  
                  β
                
              
              )
            
          
          
            
              P
              ⁡
              
                (
                
                  
                    O
                    
                      i
                      ,
                      j
                    
                  
                  ❘
                  β
                
                )
              
            
            +
            
              u
              
                i
                ,
                j
              
            
          
        
      
    
    
      
        [
        19
        ]
      
    
  




The pixels for each P(Oi,j|β)>ui,j are assigned to the head region, and the remaining pixels are again assigned to the residual class. The process is illustrated in FIG. 9. The image 900 now includes the torso 910 of the subject, which has previously been identified, and the head 920 of the subject. The new residual class 930 includes the remaining pixels in the foreground, which would include the arms and hands of the subject.
Arms Segmentation—The arms are modeled by planar density functions. The planar density model does not restrict the natural degrees of freedom in the arm motion and provides a good description of the data available for the arms in stereo images. The parameters of the planes corresponding to the left and right arms are obtained using the same equations used for the torso plane. The regions of search for the left and right arms consist of the pixels on the left and right side of the torso center that were not previously assigned to the torso or the head.
FIG. 10 illustrates the arm segmentation process. After identifying the left arm and the right arm of the subject, the image 1000 includes the torso 1010 and head 1020 of the subject, as previously identified, as well as the right arm 1030 and left arm 1040 of the subject. The residual class 1050 includes the remaining pixels in the foreground, which includes the left and right hands of the subject.
Hands Segmentation—The hands are modeled using Gaussian density functions. Similar to the modeling of the head of the subject, the observations for the hand models consist of the three-dimensional position and the hue value of the pixels. Several conventional approaches to gesture recognition use the a priori information about the skin color to detect the hands and or the face in an image. However, these approaches often fail in environments characterized by strong variations in illumination. Instead, an embodiment initializes the position of the hands by finding the regions of the arm planes that have the color similar to the hue value obtained from the head segmentation. The parameters of the hand Gaussian blobs are then determined using the same EM algorithm for the Gaussian density functions used to estimate the parameters of the head blob.
FIG. 11 illustrates the hands segmentation. After the segmentation process, image 1100 includes torso 1110, head 1120, right arm 1130, and left arm 1140 of the subject, as previously identified, as well as the right hand 1150 and left hand 1160 of the subject. For simplicity, FIGS. 10 and 11 indicate that the residual class prior to hands segmentation includes only the hands of the subject, but in practice other pixels that should have been previously assigned to the background or to other body segments of the subject may also be included.
Tracking the Upper Body Model—The initial parameters obtained individually for the torso, head, arms, and hands are refined by estimating them simultaneously. The optimal set of parameters for the upper body model are obtained through the EM algorithm by setting the derivatives of E{P(O|Ω)log P(O|Ω)} with respect to the model parameters Ω to zero. The a priori probabilities P0,πm(Oi,j) and P0,βn(Oi,j) of the observation vectors are calculated for the estimated model parameters from the previous frame. These parameters are estimated through a Kalman predictor. In the M process of the EM algorithm, the a posteriori probabilities of the model parameters given the observed data are computed to be as follows:




  
    
      
        
          
            γ
            
              i
              ,
              j
            
          
          ⁡
          
            (
            
              β
              k
            
            )
          
        
        =
        
          
            
              
                P
                
                  0
                  ,
                  
                    β
                    k
                  
                
              
              ⁡
              
                (
                
                  O
                  
                    i
                    ,
                    j
                  
                
                )
              
            
            ⁢
            
              P
              ⁡
              
                (
                
                  
                    O
                    
                      i
                      ,
                      j
                    
                  
                  ❘
                  
                    β
                    k
                  
                
                )
              
            
          
          
            
              ∑
              
                m
                =
                1
              
              3
            
            ⁢
            
              
                
              
              ⁢
              
                
                  P
                  
                    0
                    ,
                    
                      β
                      m
                    
                  
                
                ⁡
                
                  (
                  
                    O
                    
                      i
                      ,
                      j
                    
                  
                  )
                
              
              ⁢
              
                P
                (
                
                  
                    
                      
                        O
                        
                          i
                          ,
                          j
                        
                      
                      ⁢
                      
                        
                        
                          β
                          m
                        
                      
                    
                    )
                  
                  +
                  
                    
                      ∑
                      
                        n
                        =
                        1
                      
                      3
                    
                    ⁢
                    
                      
                    
                    ⁢
                    
                      
                        
                          P
                          
                            0
                            ,
                            
                              π
                              n
                            
                          
                        
                        ⁡
                        
                          (
                          
                            O
                            
                              i
                              ,
                              j
                            
                          
                          )
                        
                      
                      ⁢
                      
                        P
                        (
                        
                          
                            O
                            
                              i
                              ,
                              j
                            
                          
                          
                          
                            π
                            m
                          
                        
                        )
                      
                    
                  
                  +
                  
                    u
                    
                      i
                      ,
                      j
                    
                  
                
              
            
          
        
      
    
    
      
        [
        20
        ]
      
    
  
  
    
      
        
          
            γ
            
              i
              ,
              j
            
          
          (
           
          ⁢
          
            π
            k
          
          )
        
        =
        
          
            
              
                P
                
                  0
                  ,
                  
                    π
                    k
                  
                
              
              ⁡
              
                (
                
                  O
                  
                    i
                    ,
                    j
                  
                
                )
              
            
            ⁢
            
              P
              ⁡
              
                (
                
                  
                    O
                    
                      i
                      ,
                      j
                    
                  
                  ❘
                  
                    π
                    k
                  
                
                )
              
            
          
          
            
              ∑
              
                m
                =
                1
              
              3
            
            ⁢
            
              
                
              
              ⁢
              
                
                  P
                  
                    0
                    ,
                    
                      β
                      m
                    
                  
                
                ⁡
                
                  (
                  
                    O
                    
                      i
                      ,
                      j
                    
                  
                  )
                
              
              ⁢
              
                P
                (
                
                  
                    
                      
                        O
                        
                          i
                          ,
                          j
                        
                      
                      ⁢
                      
                        
                        
                          β
                          m
                        
                      
                    
                    )
                  
                  +
                  
                    
                      ∑
                      
                        n
                        =
                        1
                      
                      3
                    
                    ⁢
                    
                      
                    
                    ⁢
                    
                      
                        
                          P
                          
                            0
                            ,
                            
                              π
                              n
                            
                          
                        
                        ⁡
                        
                          (
                          
                            O
                            
                              i
                              ,
                              j
                            
                          
                          )
                        
                      
                      ⁢
                      
                        P
                        (
                        
                          
                            O
                            
                              i
                              ,
                              j
                            
                          
                          
                          
                            π
                            m
                          
                        
                        )
                      
                    
                  
                  +
                  
                    u
                    
                      i
                      ,
                      j
                    
                  
                
              
            
          
        
      
    
    
      
        [
        21
        ]
      
    
  




In the E (estimation) process, the new set of the plane parameters are re-estimated according to the equations [8] through [11] and the Gaussian blob parameters are re-estimated using equations [17] and [18]. The pixels for which




  
    
      
        
          P
          ⁡
          
            (
            
              
                O
                
                  i
                  ,
                  j
                
              
              ❘
              
                π
                k
              
            
            )
          
        
        >
        
          max
          ⁡
          
            [
            
              
                
                  max
                  
                    
                      all
                      ⁢
                      
                        
                      
                      ⁢
                      m
                    
                    ≠
                    k
                  
                
                ⁢
                
                  P
                  ⁡
                  
                    (
                    
                      
                        O
                        
                          i
                          ,
                          j
                        
                      
                      ❘
                      
                        π
                        m
                      
                    
                    )
                  
                
              
              ,
              
                
                  max
                  
                    all
                    ⁢
                    
                      
                    
                    ⁢
                    n
                  
                
                ⁢
                
                  P
                  ⁡
                  
                    (
                    
                      
                        O
                        
                          i
                          ,
                          j
                        
                      
                      ❘
                      
                        β
                        n
                      
                    
                    )
                  
                
              
              ,
              
                u
                
                  i
                  ,
                  j
                
              
            
            ]
          
        
      
    
    
      
        [
        22
        ]
      
    
  




are assigned to plane πk. Similarly, the pixels for which





  
    
      
        
          P
          ⁡
          
            (
            
              
                O
                
                  i
                  ,
                  j
                
              
              ❘
              
                β
                k
              
            
            )
          
        
        >
        
          max
          ⁡
          
            [
            
              
                
                  max
                  
                    
                      all
                      ⁢
                      
                        
                      
                      ⁢
                      m
                    
                    ≠
                    k
                  
                
                ⁢
                
                  P
                  ⁡
                  
                    (
                    
                      
                        O
                        
                          i
                          ,
                          j
                        
                      
                      ❘
                      
                        β
                        m
                      
                    
                    )
                  
                
              
              ,
              
                
                  max
                  
                    all
                    ⁢
                    
                      
                    
                    ⁢
                    n
                  
                
                ⁢
                
                  P
                  ⁡
                  
                    (
                    
                      
                        O
                        
                          i
                          ,
                          j
                        
                      
                      ❘
                      
                        π
                        n
                      
                    
                    )
                  
                
              
              ,
              
                u
                
                  i
                  ,
                  j
                
              
            
            ]
          
        
      
    
    
      
        [
        23
        ]
      
    
  




are assigned to Gaussian blob βk.

Gesture Recognition—Hidden Markov models (HMM) are a popular tool for the classification of dynamic gestures because of the flexibility of such models in the modeling of signals while preserving the essential structure of the hand gestures. In an embodiment herein, an HMM-base recognition system for gesture recognition that uses as observation vectors the trajectory of the hands of the subject in three-dimensional space. Although the hand trajectories in the image plane are conventional features for gesture recognition, the trajectories in a two-dimensional image plane cannot unambiguously describe the motion of the hands in a plane perpendicular to the image plane. The use of disparity maps enables the trajectory of the hands in three-dimensional space to be obtained, and these trajectories are used as observation vectors in an embodiment. Further, the use of disparity maps in combination with color information result in the robust segmentation of the upper body that is largely independent of illumination conditions or changes in the background scene.
The use of dense disparity maps for gesture recognition is helpful because stereo is considerably more robust than color alone to variations in illumination conditions, and because depth disparity maps reduce the inherent depth ambiguity present in two-dimensional images and therefore enables more accurate segmentation of images under partial occlusions and self-occlusions.
The use of depth disparity maps adds some complications to the gesture recognition process. Stereo algorithms are often difficult and laborious to develop and are computationally expensive. Correspondence-based stereo algorithms may produce noisy disparity maps. However, consumer stereo cameras have become more available and the performance of personal computers has increased such that stereo computation can be done at reasonable frame rates. An example of a camera that is used in an embodiment is the Digiclops Stereo Vision System of Point Grey Research, Inc. of Vancouver, British Columbia. Since the performance of a dynamic gesture recognition system greatly depends on the quality of the observation vector sequences, the use of stereo images in a system requires extra care. The use of depth maps instead of color information to describe the upper body model is one very important element in building a system that is provides robust performance in varying illumination conditions, shadow effects, non-stationary background scenes, and occlusions and self-occlusions of the upper body.
In the foregoing specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.

## Claims

1. A method comprising:
capturing a sequence of stereo images, the stereo images including at least a portion of a subject performing a dynamic gesture;
obtaining depth disparities relating to the stereo images;
automatically initializing parameters of a statistical model of the subject based upon matching an image of the subject to the statistical model;
tracking the subject using the statistical model of the subject;
extracting three-dimensional features from the stereo images; and
interpreting the dynamic gesture performed by the subject.

2. The method of claim 1, further comprising segmenting an image of the subject into subparts.

3. The method of claim 2, wherein the subparts represent at least the torso, head, arms, and hands of the subject.

4. The method of claim 1, wherein the statistical model of the subject models the arms and torso of the subject as planes.

5. The method of claim 1, wherein the statistical model of the subject models the head and hands of the subject as Gaussian components.

6. The method of claim 1, further comprising removing the background from the stereo images.

7. The method of claim 6, wherein removing the background from the stereo images comprises eliminating any portion of the stereo images that is more than a given distance away from a location.

8. The method of claim 1, wherein the stereo images are captured using a stereo camera.

9. The method of claim 1, wherein obtaining depth disparities comprises generating a depth disparity map.

10. The method of claim 1, wherein interpreting the dynamic gesture comprises comparing the dynamic gesture to a three-dimensional model of a gesture.

11. The method of claim 10, wherein comparing the dynamic gesture to a three-dimensional model of a gesture includes the use of hidden Markov models of three-dimensional gestures.

12. A gesture recognition system comprising:
an imaging device to capture a sequence of three-dimensional images of a least a portion of a subject and a background, the subject performing a dynamic gesture;
a processor to perform operations comprising:
processing a set of depth disparities relating to the stereo images;
automatically initializing parameters of a statistical model of the subject based upon matching an image of the subject to the statistical model;
tracking the subject using the statistical model of the subject;
extracting three-dimensional features from the subject; and
interpreting the dynamic gesture performed by the subject.

13. The gesture recognition system of claim 12, wherein the imaging device is a stereo video camera.

14. The gesture recognition system of claim 12, wherein the processor further performs operations comprising removing the background from the sequence of stereo images.

15. The gesture recognition system of claim 14, wherein removing the background from the sequence of stereo images comprises eliminating any portion of the images that is farther away from the imaging device than a given distance.

16. The gesture recognition system of claim 12, wherein the processor further performs operations comprising segmenting an image of the subject into subparts.

17. The gesture recognition system of claim 16, wherein the subparts represent at least the torso, head, arms, and hands of the subject.

18. The gesture recognition system of claim 12, wherein the statistical model of the subject models the arms and torso of the subject as planes.

19. The gesture recognition system of claim 12, wherein the statistical model of the subject models the head and hands of the subject as Gaussian components.

20. The gesture recognition system of claim 12, wherein interpreting the dynamic gesture performed by the subject comprises comparing the dynamic gesture to a three-dimensional model of a gesture.

21. The gesture recognition system of claim 20, wherein comparing the dynamic gesture to a three-dimensional model of a gesture includes the use of hidden Markov models of three-dimensional gestures.

22. A machine-readable medium having stored thereon data representing sequences of instruction that, when executed by a machine, cause the machine to perform operations comprising:
capturing a sequence of stereo images, the stereo images including at least a portion of a subject performing a dynamic gesture;
obtaining depth disparities relating to the stereo images;
automatically initializing parameters of a statistical model of the subject based upon matching an image of the subject to the statistical model;
tracking the subject using the statistical model of the subject;
extracting three-dimensional features from the stereo images; and
interpreting the dynamic gesture performed by the subject.

23. The medium of claim 22, further comprising sequences of instruction that, when executed by a machine, cause the machine to perform operations comprising segmenting an image of the subject into subparts.

24. The medium of claim 23, wherein the subparts represent at least the torso, head, arms, and hands of the subject.

25. The medium of claim 22, wherein the statistical model of the subject models the arms and torso of the subject as planes.

26. The medium of claim 22, wherein the statistical model of the subject models the head and hands of the subject as Gaussian components.

27. The medium of claim 22, further comprising sequences of instruction that, when executed by a machine, cause the machine to perform operations comprising removing the background from the stereo images.

28. The medium of claim 27, wherein removing the background from the stereo images comprises eliminating any portion of the stereo images that is more than a given distance away from a location.

29. The medium of claim 22, wherein the stereo images are captured using a stereo camera.

30. The medium of claim 22, wherein obtaining depth disparities comprises generating a depth disparity map.

31. The medium of claim 22, wherein interpreting the dynamic gesture comprises comparing the dynamic gesture to a three-dimensional model of a gesture.

32. The medium of claim 31, wherein comparing the dynamic gesture to a three-dimensional model of a gesture includes the use of hidden Markov models of three-dimensional gestures.