scieee AI-readable full text Open interactive document viewer

Human body pose study based on depth imaging

Van Sabben Alsina, Daniel

Abstract

Applying Image processing to people has been during years a worked topic in research due to its wide range of applications. Specifically, human body analysis presents a special interest because it enables interactive applications which are an active current topic. In this project we present a detector that discriminates body poses using depth images also coupled with a body skeleton estimator. The main objective for this project is to evaluate new possibilities for body detections starting from existent contributions. There are in this work the use of descriptors and training algorithms to reach the stated tasks. The conclusions extracted pretend to offer an evaluation of the tested methods to verify if they are suitable for the human body detection and therefore they can be extended in future works.

Full text

PROJECTE FINAL DE CARRERA HUMAN BODY POSE STUDY BASED ON DEPTH IMAGING Enginyeria de Telecomunicació Autor: Daniel van Sabben Alsina Director: Javier Ruiz Hidalgo Juny 2015 Human body pose study based on depth imaging 1 General Index General Index .................................................................................................. 1 Acknowledgments .......................................................................................... 3 Resum del Projecte ........................................................................................ 4 Resumen del Proyecto .................................................................................. 5 Abstract .............................................................................................................. 6 1. Introduction ............................................................................................. 7 1.1 Motivation .......................................................................................... 7 1.2 Objectives .......................................................................................... 8 1.3 Structure of the memory .............................................................. 9 2. State of the art ..................................................................................... 11 2.1 Color based contributions .......................................................... 11 2.2 Depth based contributions ........................................................ 12 2.3 Human body analysis ................................................................... 14 3. Study of features ................................................................................. 16 3.1 Context .............................................................................................. 16 3.2 Introduction .................................................................................... 16 3.3 Features ............................................................................................ 18 3.3.1 Curvature.......................................................................................... 18 3.3.2 Oriented Radial Distribution ..................................................... 19 3.3.3 Histogram of Oriented Normal Vectors ................................ 20 4. Body pose data set .............................................................................. 22 4.1 Introduction .................................................................................... 22 4.2 Planification .................................................................................... 22 4.3 Groundtruth and body articulated model ............................ 23 4.4 Dataset description ...................................................................... 24 5. Methodology .......................................................................................... 26 5.1 Global Scheme ................................................................................ 26 Human body pose study based on depth imaging 2 5.2 Point cloud from depth image .................................................. 28 5.3 Preprocessing ................................................................................. 29 5.4 Anchor selection ............................................................................ 30 5.5 Feature configuration .................................................................. 30 5.6 Training Algorithm ........................................................................ 31 5.6.1 Collaborative Voting ..................................................................... 32 5.6.2 Adaptation and extension .......................................................... 34 5.7 Software implementation………………………………………………38 6. Test and results .................................................................................... 39 6.1 Setup .................................................................................................. 39 6.2 Evaluation measures .................................................................... 40 6.3 Tests ................................................................................................... 41 6.3.1 Feature histogram bins ............................................................... 41 6.3.2 Position-feature weighting ........................................................ 42 6.3.3 Number of detection anchors ................................................... 43 6.4 Results breakdown ....................................................................... 44 6.4.1 Pose gestures evaluation ........................................................... 45 6.4.2 Sequence evaluation .................................................................... 46 6.4.3 Subject evaluation ........................................................................ 47 6.4.4 Body skeleton distance error .................................................... 48 7. Conclusions ............................................................................................ 50 7.1 Project conclusions ...................................................................... 50 7.2 Future work ..................................................................................... 50 References ....................................................................................................... 52 Appendices ...................................................................................................... 54 Human body pose study based on depth imaging 3 Acknowledgments I would like to thank the following people that helped me during this thesis development. Javier Ruiz, for guiding the whole thesis always in a positive way and contributing with his experienced technical point of view. Albert Gil, for providing an implicated and friendly technical assist. The UPC students and Image Processing Group members that participated on the recordings. And of course, my family who have always supported me. Human body pose study based on depth imaging 4 Resum del Projecte El processament d’imatge aplicat a les persones ha estat durant anys un tema recorregut en la investigació ja que el ventall d’aplicacions és ampli. Concretament, l’anàlisi del cos humà presenta un interès especial ja que permet accedir a aplicacions amb interactivitat el qual és un tema molt actual. En aquest projecte presentem un detector que discrimina gestos corporals a partir d’imatges de profunditat conjuntament amb un estimador de l’esquelet del cos. L’objectiu principal és avaluar noves possibilitats per a la detecció del cos partint de contribucions existents. Són presents la utilització de descriptors així com algoritmes d’entrenament per tal d’assolir la tasca esmentada. Les conclusions extretes pretenen oferir una avaluació de les tècniques provades per veure si són adients al problema de detecció del cos humà i poden ser esteses en treballs futurs. Human body pose study based on depth imaging 5 Resumen del Proyecto El procesado de imagen aplicado a las personas ha sido durante años un tema recorrido en investigación ya que presenta un amplio abanico de posibles aplicaciones. Concretamente, el análisis del cuerpo humano es de interés especial ya que permite acceder a aplicaciones con interactividad, un tema muy actual. En este proyecto presentamos un detector que discrimina gestos corporales a partir de imágenes de profundidad conjuntamente con un estimador del esqueleto del cuerpo. El objetivo principal es evaluar nuevas posibilidades para la detección del cuerpo partiendo de contribuciones existentes. Son presentes la utilización de descriptores así como algoritmos de entrenamiento para conseguir dicho propósito. Las conclusiones extraídas pretenden ofrecer una evaluación de las técnicas usadas para comprobar si son adecuadas para el problema de la detección del cuerpo humano y si pueden ser extendidas en trabajos futuros. Human body pose study based on depth imaging 6 Abstract Applying Image processing to people has been during years a worked topic in research due to its wide range of applications. Specifically, human body analysis presents a special interest because it enables interactive applications which are an active current topic. In this project we present a detector that discriminates body poses using depth images also coupled with a body skeleton estimator. The main objective for this project is to evaluate new possibilities for body detections starting from existent contributions. There are in this work the use of descriptors and training algorithms to reach the stated tasks. The conclusions extracted pretend to offer an evaluation of the tested methods to verify if they are suitable for the human body detection and therefore they can be extended in future works. Human body pose study based on depth imaging 7 1. Introduction 1.1 Motivation Detection is a common task with unlimited applications, ranging from identifying faces in a camera to discriminating whale whistles. Due its valuable utility from a technological point of view for a long time technicians and researchers have been working together to create and improve new solutions for different detection statements. More specifically, there has been a special interest for human features like: voice, gestures, face, etc. The detection of human features allows devices to respond in consequence of the user actions enabling the human-machine interaction which is a current need in some of today’s technologies. Over the past decade new fields and technology have arose to a point that they started being applied on detection problems. This is the case of affordable depth sensors for image based detectors. Leaving aside classical common color images, depth images carry spatial information that may suit better space related detections, geometrical measurements, etc. Another topic of interest, is the popularized Machine-Learning field which studies computational models that adapt to training data. Therefore, those are learning systems that can perform better on specific tasks. With that said, Machine-Learning is a useful tool in many scientific disciplines. In the case of detection statements Machine-Learning helps by improving concrete parts of the overall detection. Even though here only are commented two topics there are plenty of contributions and emerging technologies that can be added to human feature detectors. This enables the possibility to create complex detectors mixing new technology and new research topics leading to an unlimited number of possibilities for a detector’s design. Human body pose study based on depth imaging 14 training process. A key point of this work is the generation of synthetic 3D body models for the training, this provides a huge controlled dataset to feed the training task. With this extended dataset and a refined training using optimized decision trees they achieve a robust detector and prove that a more training-oriented solution is also suitable. A. Baak et al. [7] provide another solution for real-time pose tracking. First, they recorded multiple sequences with marked poses. On one hand, the dataset samples are used when tracking to infer on the current pose by looking for the best hypothesis that matches the current pose (based on a feature vector similarity). On the other hand, a generative method predicts the body pose. The final pose decision is determined by means of a voting process fusing both hypothesis components. Last but not least, the same problem is studied by D. Grest et al. [8]. They use rigid meshes parts as the body model representation. Estimating the spatial parameters of this parts represents the whole body pose. To achieve this, first they express analytically the rigid body motion relative to the body parts. To find the specific part spatial parameters they apply the Jacobian for the motion equations and simplify it in order to look for a relation between point’s position and the rigid part parameters. Newton Iteration method is applied to overcome noise when fitting the point set to the analytical body part. Finally, to map the observed points (extracted from the depth image) into the rigid body model an Iterative Closest Point is applied. 2.3 Human body analysis A crucial reference that inspired this project is X.Suau PhD [9]. In this work several concepts and methods were explored and tested to achieve specific tasks like detection of body end-effectors, head tracking, fingertips localization and identification, among others. As a baseline for our project we decided to reuse and possibly modify some of the stated concepts in a different context. The two concepts involved are:  Oriented Radial Distribution: a new proposed feature for 3D point clouds. It is designed to characterize depth data by highlighting the end-effectors of the point cloud. A detailed explanation is given in chapter 3 Study of features.  Collaborative Voting: a training algorithm inspired by decision forests. The main idea is to detect an object part by Human body pose study based on depth imaging 15 accumulating the inference of other trained object parts. The object parts contributing to the detection is interpreted as a voting process. This topic is covered in chapter 5 Methodology. Human body pose study based on depth imaging 16 3. Study of features 3.1 Context Before introducing the complete proposed solution scheme in chapter 5 we dedicate this chapter to give a previous insight on data descriptors, also known as features, which play an important role on the overall algorithm and are object of study. In the following sections this topic is covered from a theoretical point of view. It is in chapter 5 where we describe the practical implementation of the presented features. 3.2 Introduction One of the first steps in a detection process is to analyze the input data in order to find useful information that can lead to the desired detection. In fact, the analysis step can be understood as a transformation of the input data into a simplified data space which is more valuable for detection. To illustrate this concept, consider the task of identifying musical notes from a sound recording. The input data is a set of digitalized values corresponding to the sound samples. In this context a common analysis is to measure frequencies within a segment of samples. At this point, instead of sparse sampled values we have obtained frequencies which are better related to the note pitch and could be a potential candidate for discriminating low-high note tunes and therefore identifying correctly the musical note. This example does not show a complex detection scenario but remarks that processing data and measuring certain magnitude contributes positively providing more valuable information for the posterior detection. Back to the project’s context, it has been explained before in the previous chapter that in this work data inputs are point clouds obtained by scanning people posing with depth imaging technology. An initial data sample is a set of 3D coordinates. These initial points are disconnected in the sense that they aren’t provided with any relation between them (for instance, the same applies to pixels in a 2D image). Consequently, as a starting point we only have independent spatial information from each 3D point. Considering that this project attempts to identify a full body pose, working directly with stand-alone 3D points may result in a loose option Human body pose study based on depth imaging 17 due it’s unrelation with the rest of the point cloud structure. For this reason, there is the need to apply a measure that combines several points in order to extract higher level information from the point cloud. Those measures that involve a neighborhood of points to compute are commonly known as features or descriptors. As their name recalls they are designed to highlight specific traits on the data. It is a main topic on image processing research and that is why there is already a large variety of published features. When it comes to depth imaging, applying 2D image features in this new data type has different, sometimes unwanted, results. Thus encouraging to focus on spatial based features which are designed taking in mind the depth magnitude. In addition, the features that apply to a 3D point cloud are also known as 3D features. For this project we have selected 3 features to be object of study. Processing point clouds with these features provides measures that represent better the shape of the cloud in comparison of isolated point entities. In a later stage, when a training algorithm is applied for detecting (detection discussed at chapter 5) the outputs of this features will be part of the training samples for the detector. This implies a direct effect on the detector’s overall performance. Moreover, evaluating the detector’s results depending on which feature is running will determine how suitable is that feature for body data problems this consisting in a feature comparison study. More formally, features are functions with a single point 𝒑 from the input cloud coupled with feature-specific parameters 𝒙𝟏,…,𝒙𝒏 as its domain. And their outputs are either a scalar or a fixed dimension vector 𝒚𝟏,…𝒚𝒎 (Eq. 3-1). In addition, these studied features in order to compute they require a set of neighboring points 𝑵𝑵𝒑,𝒓 bound to the evaluated point 𝒑 (Eq. 3-2). We define this subset as the points from the point cloud 𝑷 that are contained inside a sphere from certain radius 𝒓 centered at the evaluated point. 𝑓( 𝑁𝑁𝑝,𝑟, 𝑥1,…,𝑥𝑛) = 𝑦1,…𝑦𝑚 (3-1) 𝑁𝑁𝑝,𝑟 ={ 𝑥 ∈𝑃| ‖𝑥−𝑝‖<𝑟 } (3-2) Human body pose study based on depth imaging 18 Next sections describe the chosen 3D features. 3.3 Features 3.3.1 Curvature Curvature is a ratio proceeding from the results of applying a Principal Component Analysis (PCA) [10] to the evaluated data. Before describing Curvature a brief on PCA is given to further understand its behavior. Figure 3.1: dispersion point cloud and its principal components. Given a set of points, PCA first step is to retrieve the covariance matrix of the data 𝒄𝒐𝒗(𝑿,𝑿). Being this matrix diagonalizable, then it computes its eigenvector-eigenvalue pairs 𝛎𝒊,𝛌𝒊 (Eq. 3-3). These pairs are acknowledged as the principal components of the input data. In other words, this eigenvectors form a basis which fits data according to its dispersion. Furthermore, each associated eigenvalue represents the dispersion measure of its vector direction. This means, the highest eigenvalue’s direction is the principal axis in which the input data is arranged. Sorting the eigenvalues we obtain a hierarchy of axis by order of importance (calling importance as: capability to represent the input data). cov(X,X)∙ν𝑖= cov(X,X)∙ λ𝑖 (3-3) Human body pose study based on depth imaging 19 C= λ0 λ0+λ1+λ2 (3-4) With PCA applied to a set of points, its Curvature 𝑪 is defined as the quotient between the lowest eigenvalue 𝛌𝟎 and the sum of all eigenvalues from PCA 𝛌𝐢 (Eq. 3-4). Notice that working with 3 dimensional points this measure indicates how much the minor component differs from the higher two. More into the topic, suppose two extreme cases. When Curvature equals zero it’s because the lower component is non-existent, zero value, then all points can be represented with only 2 axis. Meaning the evaluated points are contained in a plane. In the opposite case, when curvature has high value it’s sign that all components have similar weight but it can not be referenced to an specific shape or point distribution. From a high level perspective, Curvature is prone to non-planar structures since it’s related to the sparsity nature of the points. 3.3.2 Oriented Radial Distribution The Oriented Radial Distribution (ORD) by X. Suau et al. [11] was designed to stress extremities from 3D bodies. It intends to discriminate 3D regions where points, considered part of a surface, present an inhomogeneous pattern. ORD algorithm is computed as follows. First, the neighborhood of the evaluating point is projected into its tangent plane. Note that this tangent plane is an estimation retrieved from a plane fitting by error minimization, PCA or other plane estimation methods. Once the projection is done the resulting 2D dispersion of projected points can be bounded by a disk with the same radius 𝒓 than the radius chose to find these neighbors. This disk is divided in equally sized sectors (the number of sectors is an ORD parameter) and every 2D point from the projection is assigned to its respective sector. If a sector has less than a specified number of points that sector is eluded in further calculations. Only the 𝑲 with sufficient points are considered for the calculation. Human body pose study based on depth imaging 20 Θ= 1 1 √2∙𝑟∙𝐾∑(𝛿𝑖−1 √2𝑟) 𝐾 𝑖=0 (3-5) With that said, for each sector with enough points ORD computes its containing points average distance 𝜹 𝒊 to the disk center and measures the difference to the centroid distance of that sector. Finally, ORD value (Eq. 3-5) is the average of the described multiplied by a normalization coefficient in order to give an output with dynamic range of 1. Figure 3.2: example of projected points into a 2D disk to compute ORD. Red cross: segment centroid. Green cross: segment point average. Blue dots: projected point samples. Consequently, in planar regions ORD has low value as points are uniformly distributed on every disk’s sectors. Points that are close to a salient region or extrema of the 3D body present a higher deviation respect sector’s centroids leading to a high ORD output. Also, take into account that discarding low sampled disk sectors provides an extra filtering functionality to reject noise. 3.3.3 Histogram of Oriented Normal Vectors A common parameter to define surfaces is the normal vector linked to the surface position. S. Tang et al. [12] propose a new feature and its application to detect object entities from depth images. Human body pose study based on depth imaging 21 This feature called Histogram of Oriented Normal Vectors (abbreviated as HONV) replaces the evaluating pixel’s normal (𝑵𝒙,𝑵𝒚,𝑵𝒛) for the Z axis and afterwards for every neighbor pixel considered, it calculates the spherical angles zenith 𝜽 (Eq. 3-6) and azimuth 𝝋 (Eq. 3-7) respect the current Z axis. As a result, a 2D histogram is built filling it with the neighborhood’s zenith and azimuth components. Figure 3.3: From left to right. Normal estimation for each point, spherical angles associated to normals and 2D histogram from spherical angle pairs. To clarify how normal vectors are related to pixels, the normals they used are a coarse estimation based on the image gradient which has depth variation as magnitude. In our environment of a point cloud in 3D space these normals are computed by applying PCA analysis around a narrow neighborhood of that point and choosing the least component as its normal, it is a common strategy for obtaining normals from 3D points. 𝜃=𝑎𝑟𝑐𝑜𝑠( 𝑁𝑧 √𝑁𝑥2+𝑁𝑦2+𝑁𝑧2 ) (3-6) φ=arctan ( 𝑁𝑦 𝑁𝑥 ) (3-7) Human body pose study based on depth imaging 22 4. Body pose data set 4.1 Introduction When looking for a human body dataset to test our work we realize that most of them are for a 2D image processing framework. In a reduced amount, there also exist datasets recorded with depth sensors. However, these datasets were made for specific purposes and none of them is suitable for this project whose main goal is to detect a discrete number of poses involving the whole body. For this reason, we decided to create a custom dataset as an extra contribution to this project. 4.2 Planification First of all, we have to determine the content of the recordings. As the focus of this project is to evaluate new methods to detect body different poses, we decided that actors are going to perform a certain number of standstill poses holding them for few recording frames. These different poses can be understood as a gesture expressed with the body so from now on we also call this poses as body-gestures or simply gestures. At this point, we have to define how recordings are executed. For this purpose, we use a Microsoft Kinect which is a popular commercial depth sensor. With Kinect always fixed in the same position and orientation, captures are made separately for each subject (actor) performing a concatenation of body-gestures. A series of concatenated body-gestures defines a sequence. With that said, our dataset is planned as a collection of captures where in each one an actor is performing a sequence of bodygestures. The detailed recording definition is explained in the end of this chapter. The resulting recordings are unrolled into a set of depth images each one corresponding to each frame. In addition, mention that the cast for this dataset are students and members of the GPI department UPC that volunteered to this project. Human body pose study based on depth imaging 23 4.3 Groundtruth and body articulated model A common representation of the human body pose is an articulated model involving joints that connect every rigid part. Due to its simplicity and having high coherence with pose description it is often used in human body estimation problems. Figure 4.1: NITE articulated body model representation with labels on each joint. In our context, we use a set of joint positions 𝒂𝒊 related to body articulations as the body pose physical groundtruth. To retrieve articulation positions for each frame we applied during capture a body skeleton tracker from the OpenNI/NITE library. We consider this tracker sufficient accurate to become the dataset physical groundtruth. Related to gestures , an identification number is given to each posegesture. In order to establish a groundtruth 𝑮𝑻 we modified the recording program to manually register gestures in real-time with the keyboard. Consequently, for each frame a scalar number identificator 𝒈 is bound as the pose-gesture groundtruth. Additionally, associated to the capture an events list is saved indicating the frame intervals in which every gesture is performed. This annotations are used later in the detector to skip transitions between gestures. Human body pose study based on depth imaging 30 Secondly, a simple filtering is applied to the point cloud. Due to sensor noise and other capturing factors some unwanted isolated points appear. We remove this points by thresholding the neighborhood of that point (the neighborhood is computed as explained in chapter 3), if the neighborhood count is lower than a threshold for a specified radius the point is discarded. Notice that the parameters for this filtering are sufficiently relaxed in order to not distort the point cloud shape. We applied a 10 cm neighbor radius and a threshold of 40 neighbors. 5.4 Anchor selection The posterior training algorithm requires a limited set of points. This selected points are called anchors and are later processed into a collection of training templates. Hence, the anchor picking process strikes directly to the training algorithm performance. When choosing anchors we want points that are relevant. In other words, points that after being processed they provide a discriminative pattern that contributes to better identify the current body pose. In our goal to detect a full body configuration we have not imposed constrains on the body. This means that this solution is planned for any generic pose. As a drawback, when selecting anchors we do not have any spatial traits that we can track since body could be in any configuration. Moreover, after selecting the anchors different features are computed on them which means that a set of anchors that performs well for a given feature may perform poorly on others. Following this reasoning, the chosen method to select anchors is a simple random sampling from the cloud which consists in uniformly generating a set of random indices (with values limited to the point cloud size) and then select the points corresponding to these indices as anchors. Although it does not provide a discriminative picking of the anchors it preserves the generality and uniformity of the sampling (all parts of the point cloud are sampled equally). 5.5 Feature configuration In chapter 3 we presented 3 features and how they are computed for 3D point clouds. In our scheme one of these features is selected and applied to the anchors. Notice that Curvature and ORD have a scalar output while HONV has a 2D histogram as output. To make all features Human body pose study based on depth imaging 31 interchangeable we need to force their outputs into the same format. We decided that this output format will be a 1D feature histogram. In the case of HONV the adaptation is straightforward, the 2D histogram is reshaped into a 1D histogram by concatenating each row of values. On the other hand, Curvature and ORD only present a single value per point which implies that further computations are needed. A fix to this lack of data is to extend the feature computation to all neighborhood of the evaluated point and group the resulting values to build a 1D histogram with the same number of bins than the HONV histogram. Also, all features histograms are normalized to preserve the same scale of magnitude. With the output adapted to a single format what is left is to setup feature parameters. We tuned feature parameters by visualizing colormaped feature point clouds in a 3D visualizer and we chose the parameters according to which representation provided more contrast on different body parts. The resulting parameters were a neighbor radius of 30cm to compute features and a 8 cm radius to estimate point normals (HONV). Considering that the average human height is about 170cm a 30 cm radius to represent shaped parts of the body is a coherent choice. When it comes to ORD, more parameters need to be fixed. After repeating test and visualization we concluded that 8 disk sectors and 5 minimum points per sector threshold were a suitable choice. The remaining parameter is the number of bins of the resulting histograms, we left this parameter unassigned as it will be a variable to test in this projects results chapter. In addition, while interpreting the resulting 1D histograms we realized that the Curvature feature had nearly all values compressed in its first third of bins. To enhance its representativeness we applied a powerlaw range transformation to expand the Curvature values (Eq. 5-3). 𝐶′=𝐶0.3 (5-3) 5.6 Training Algorithm The detector core is a training algorithm that executes the final classification. We implemented the Collaborative Voting algorithm from X. Suau [9] varying some parts and extending the method for a pure 3D environment. Collaborative Voting (CV) was proposed to detect Hand gestures and fingertip localizations from depth images. In this project we want to reuse this idea to instead detect Body poses and infer to body joint positions Human body pose study based on depth imaging 32 from the articulated model. First, a summarized explanation of Collaborative Voting is given in its original Hand detection environment. In second place, we explain how this algorithm is adapted in this project and which modifications and extensions have been made. 5.6.1 Collaborative Voting CV applies to multipart object detections. The Voting concept consists on inferring an object part location by an accumulation process where each contribution can be seen as a vote similar to the idea of Hough accumulators. The word Collaborative is behind the idea that every object part cast votes to the other object parts locations giving this sense of collaboration. In its original context, the problem was to detect fingertip localizations and hand gesture from depth image frames. For this purpose, they had a dataset of depth images with the testing hand bounded, annotated fingertip positions and hand gesture id for each frame. Figure 5.5: Fingertip template components: anchor position, ORD patch, finger votes and hand gesture id. The training process consist in generating a set of training templates from each frame. In this particular case first they apply the ORD feature on a bounded hand patch image and select the 5 maximum (over 0.7) and 5 minimum (below 0.3) ORD value pixels as anchors. Training Human body pose study based on depth imaging 33 templates are extracted from this anchors. The training template is composed by the following information:  Anchor 2D position 𝒔 relative to the center of the hand image patch.  A smaller image patch 𝛌 of size 𝒍𝒙𝒍 around the anchor with the surrounding ORD values.  Votes to fingertips 𝒗𝒊. These are normalized 2D vectors from anchor position to fingertip annotated position.  Labels for votes, to relate votes with each finger.  Hand gesture id 𝛏. Once all templates are gathered from frames, the training is done. When detecting, the same process to retrieve anchors is applied. In the same way that in training we can fill a training template per anchor but without votes, labels and gesture information. Then, with a cost function 𝑪𝒊,𝒌 between 2 templates i,k (Eq. 5-4) which is defined as the mean of the anchor normalized position distance and the ORD patches mean squared distance. the 𝑲 previously trained templates with minimum cost from the current anchor are obtained. To ease this task , the templates collected during training are organized in a k-d tree structure . The selected trained templates are equivalent to the K nearest neighbors (respect the cost function) from the current anchor. After that, votes from picked templates are cast into votemaps. 𝐶𝑖,𝑘 =1 2(𝐿2𝑑𝑖𝑠𝑡(λ𝑖,λ𝑘)+ |𝑠𝑖−𝑠𝑘|) (5-4) Votemaps are a 2D matrix with same dimensions than the hand image patch. Every finger has its votemap and its purpose is to accumulate all votes for that fingertip. The voting process consist in taking the trained template vote (position of the fingertip respect the anchor as origin) , add it to the current evaluated anchor position and increment that location value on the votemap. Consequently, after votes are cast the votemap presents higher value areas where the majority of training templates estimated the fingertip position. Finally, a Gaussian filter with 1/10 patch SIZE is applied to each votemap and the position containing the votemap’s maximum is chosen as the fingertip estimated position. In the case of hand gestures, a 1D histogram is used instead of a votemap and its bins are every possible gesture. The voting process is similar to the fingertips, each selected training template contributes to the gesture detection by looking at the gesture label and incrementing the Human body pose study based on depth imaging 34 corresponding histogram bin. In the same way, the estimated hand gesture is the one with maximum value in the histogram. 5.6.2 Adaptation and extension In our project context, we reuse Collaborative Voting to infer the joint positions of the articulated model and detect the overall pose gesture. In the hand context they worked with depth images and image sub patches, since we work with a 3D point cloud we have to specify how CV is adapted. As we explained in this chapter the anchor selection process is a random sampling (instead of the ORD extremes used in the hand problem). In the same manner, training templates are created from anchors during training. The templates have the same structure than in the original CV except positions and votes are now 3D coordinates instead of pixel-wise positions. Also, the image patch with ORD values that characterized the anchor has been substituted by the 1D feature histogram defined previously. Therefore, training templates have the following elements: Human body pose study based on depth imaging 35 Figure 5.6: Body anchor template components: 3D anchor positon, neighboring points, votes to body joints, feature 1D histogram and body pose id.  Anchor point 3D position 𝒔.  1D feature histogram 𝜸(computed from ORD, Curvature or HONV).  Labeled votes to body joints 𝒗𝒊. Vector difference between the anchor point and the annotated joint from the dataset.  Pose gesture id 𝛏. During detection, first all gathered training templates are organized in a k-d tree structure J. L. Bentley[13]. This data structure is optimal to perform nearest neighbor searches which are a demanded task during detection. Following the original CV process, in this case the cost function 𝑪′𝒊,𝒌 associated to this k-d tree (Eq. 5-5) relies on the anchors 3D position distance and the 1D feature histograms mean squared distance. Notice that anchors positions are in physical metrics (centimeters) if we build an additive cost function coupled with 1D feature histograms squared distances the higher order magnitude of anchor positions will mask the 1D histogram discriminability. To prevent this, a global normalization of the anchor 3D position is done by averaging all anchor Human body pose study based on depth imaging 36 positions from the 𝑵 training templates and divide each anchor position by the resulting average modulus. Finally, instead of directly averaging 1D histogram distance with anchor position distance as the final cost function we introduce an adjustable weighting parameter between this 2 measures calling it position-feature weight 𝒘 with range [0,1]. 𝐶′𝑖,𝑘 =(1−𝑤)𝐿2𝑑𝑖𝑠𝑡(γ𝑖,γ𝑘)+ 𝑤( 1 1 𝑁∑𝑠𝑗𝑗 |𝑠𝑖−𝑠𝑘|) (5-5) With the cost function already described, the detection task starts by picking random anchors to evaluate. Looking at the k-d tree we select the K nearest neighbors of each chosen anchor and lastly make each of them vote to the articulated body model and the body gesture. Body gestures are detected exactly with the same method. A 1D histogram is set up whose bins correspond to each body gesture id. Detection training templates increment (vote) to their respective body gesture. After processing, the maximum in the histogram becomes the estimated body gesture. On the other hand, inferring the body articulated model can not be accomplished with 2D votemaps described in the original CV. For this reason, we redefined votemaps as a 3D grid of voxels for each body joint. Basically we discretized the point cloud space. The side size of the voxel (map resolution) has been fixed to 1 𝑚𝑚 and the limits of the 3D grid are determined by the axis-aligned bounding box of the current frame point cloud. In the same way, the voting process consist in incrementing voxel’s cells 𝜶𝒙,𝒚,𝒛 and at the end the maximum accumulated voxel represents the estimated body joint position associated to that votemap. About vote casting, votes are 3D displacement vectors from the training template anchor position to the body joint. Voting directly to a unique voxel in such extensive grid results in a votemap with isolated incremented voxels which does not lead to a clear joint estimation. Human body pose study based on depth imaging 37 Figure 5.7: Graphical representation of Gaussian sphere votes related to the right-hand joint. In the original CV this issue was resolved by blurring the 2D votemap with a Gaussian filter to spread the vote influence in a certain zone. Looking for an equivalent solution, instead of accumulating to single voxels we decided to cast what we call a Gaussian sphere centered at the vote position. More specifically, a Gaussian sphere vote means that we increment all voxels around the vote position following a Gaussian decay distribution 𝑰(𝜶𝒙,𝒚,𝒛,𝒗𝒑) (Eq. 5-6) based on the distance between the voxel’s center position and the vote position 𝒗𝒑. We set the Gaussian variance parameter to 12,5 𝑐𝑚2 𝐼(𝛼𝑥,𝑦,𝑧,𝑣𝑝)=𝑒−1 12,5‖(𝑥,𝑦,𝑧)−𝑣𝑝‖2 (5-6) After accumulating all votes, we look for the voxel with the maximum value and its position is the estimation for the body joint position associated to that votemap grid. Keep in mind that this estimation has an intrinsic discretization error up to 0,5√3 𝑚𝑚 (half of the voxel’s diagonal) due the voxelization step. When all votemaps have been evaluated we can construct the complete body skeleton by placing all body joints positions and representing their links. This final figure consist in the whole body pose estimation. Human body pose study based on depth imaging 38 5.7 Software implementation The whole solution described in the previous sections of this chapter has been completely implemented in the C++ programming language using ImagePlus, a video-image processing platform developed by the UPC Image Processing Group. Also, the following programming libraries are involved:  C++ Standard Library (STD): core programming tools and input/output functionalities.  Point Cloud Library (PCL): point cloud management and operations.  OpenNI: depth sensor software capabilities. In the ImagePlus environment executables are named tools. The tools source code developed during this project can be found in the additional documentation presented along with this report which consists in a single compressed file “code.zip”. Alternatively, the same code can be found in the Image Processing Group servers contained in this directory: “/imatge/dvansabben/workspace/imageplus/tools”. Human body pose study based on depth imaging 39 6. Test and results 6.1 Setup At this point we already described the complete detector’s implementation for body pose identification. Also, we defined the depth sensor recordings and how they are organized in subjects, sequences and pose gestures. Taking into account that our algorithm requires a training pass before detection there is the need to discuss which recordings are used for each step. In this work, detections are performed for every subject separately. A leave-one-out cross validation strategy is used. In other words, we perform a training pass using all subjects but excluding the one we are currently testing for detection. This implies a training step with 11 subjects and a detection with the remaining chose subject. To retrieve a detector’s overall performance these per-subject evaluations are combined to provide a global specification of the detector’s behavior. Next sections are the results obtained from applying the detector. In first sections, we test 3 parameters related to the features and training. Looking at the overall results we are able to determine the influence of these parameters. The bottom sections are a detailed breakdown of the results considering the best configuration of the detector. Finally, we have to add that there are various parameters that have been fixed and remain constant. Their values were chosen during development tests picking best observed candidates. Fixed parameters list:  Concerning training: o Depth frames per-gesture = 20 o Random training anchors per-frame = 50  Concerning features: o Neighbors radius (feature calculation) = 30 cm o Neighbor radius (normal estimation) = 8 cm  Concerning detection: o Gaussian deviation for articulation estimation = 25 cm Human body pose study based on depth imaging 46 If we interpret the detection as binary classifications for each pose gesture then we are able to compute per-gesture recall, precision and F score. Figure 5.5: Precision, Recall and F score values for each pose gesture Pose gestures 7 and 8 have lower F scores respect the others as a consequence of having low recall. The recall loss is the result of misclassifying these gestures more frequently. 6.4.2 Sequence evaluation Until here results were retrieved with all sequences evaluated together. In this section, sequences A-B and C-D are split running separated detections leading to 2 classifications with 5 pose gestures in substitution of 1 classification with 10 pose gestures. Human body pose study based on depth imaging 47 Figure 5.6: Overall F measure evaluating different sequences It is observed that executing sequences separately improves precision approximately 6% in both cases. One hypothesis is that having less gestures to discriminate reduces the number of candidates when detecting, thus lowering confusions between gestures. On the other hand, notice that there is nearly no difference in performance between sequences. This means, in the algorithm terms the proposed sequences do not present a semantic difference in their gestures. 6.4.3 Subject evaluation Concerning the subjects, we can also measure the variability of the detection between subjects. Instead of giving the overall F measure we provide the score related to each subject and then compute the overall variability with all 12 subjects. 85% 87% 89% 91% 93% 95% A-B-C-D A-B C-D F measure Sequences Sequence precision Human body pose study based on depth imaging 48 Figure 5.7: Overall F measure per subject evaluation Subject analysis has a lot of factors associated to the person being recorded which is not the object of study. Instead, we calculate the persubject F measure variance to determine if the algorithm is stable to different people. The resulting variance is 7% which is considered stable. 6.4.4 Body skeleton distance error Apart from the pose gesture classifier, the algorithm also has the body skeleton estimator applied every frame. In the proposed articulated model we have 14 joints or articulations to be estimated and we dispose the ground truth positions of them. With this scheme the evaluating measure is going to be the Euclidian distance between the estimation and ground truth for every articulation. As a final result, we average all distances and provide a global distance error for the estimated skeleton. Human body pose study based on depth imaging 49 Figure 5.8: Body skeleton with graphical representation of distance errors associated to each articulation Looking at Figure 5.8 the circles around the articulations are a graphical representation of the averaged error of that joint. The exact error is listed in the following table. Joint Error Joint Error Head 5,7 cm Right Hand 17,1 cm Neck 4,9 cm Left Hip 5,7 cm Left Shoulder 4,8 cm Left Knee 4,4 cm Left Elbow 12,1 cm Left Foot 5,4 cm Left Hand 20,2 cm Right Hip 6,6 cm Right Shoulder 5,2 cm Right Knee 5,8 cm Right Elbow 10,9 cm Right Foot 7,8 cm Table 5.2: Average distance error associated to articulations From the Table 5.2, stands out that elbows and hands present a major error respect other articulations Looking over the recorded gestures in the sequence it is remarkable that the arms and hands present higher error because they are body parts that change the most between poses, while body trunk and legs remain quiet in most gestures. The final averaged distance error of the body skeleton detector is 8,3 cm. Human body pose study based on depth imaging 50 7. Conclusions 7.1 Project conclusions In this project we achieved to design and implement a new approach for detecting human body poses. With its best configuration, the presented solution reaches a 88,4% F measure in the proposed dataset which we consider a successful result. Beside the pose detector, a human skeleton estimator is also implemented. The average deviation error of the estimated skeleton joints is 8,3 cm which we consider acceptable but not as accurate as other related works. Concerning the studied features, when detecting exclusively with feature information ORD is the only eligible feature that can perform well with 64,4% F score. When coupling spatial information with features HONV has the best accuracy increase which makes it also eligible however ORD still is the best choice (with 88,4% F measure) . In both cases Curvature results in a loose option for this problem. About the solution design, since we wanted to try different features our solution has been kept generic implying that the functional blocks are decoupled from each other. This results in a good framework for prototyping. The counterpart is that a generic design is not problem specific and therefore we did not use many problem specific constrains as for example human body spatial limitations which could have been beneficial to further improve the detector’s performance. Another objective of this project was to record a new body pose dataset based on depth imagery which has been accomplished. We were able to record 12 subjects performing 10 pose gestures split in 2 sequences of 5 gestures each one. During recordings we also extracted groundtruth annotations with the pose id and the skeleton for each frame. After working with this dataset, we realized that the proposed pose gestures were very discriminative. 7.2 Future work Before concluding this project we propose several ideas and improvements that can follow from this work. Human body pose study based on depth imaging 51  Implementation optimizations to speed up the detector. Basically, make an accurate profiling to detect major code bottlenecks and overcome them. Some possible specific improvements are: feature computation acceleration using the GPU, review code structures, alternatives to k-d tree, etc.  Try different features. Choose other 3D features to test and extend the feature comparison for body pose detection. Possible candidates are: Point Feature Histogram, Normal Aligned Radial Feature, Viewpoint Feature Histogram, etc. Another option is to design a new feature taking into account human body traits.  Use another dataset with more challenging pose gestures. When planning our dataset we focused on clarity and high discriminative poses. However, could be interesting to test this solution with poses that have some body parts occluded or that are noisy.  Substitute the Collaborative Voting set up with a different machinelearning algorithm. Rethink the detection process and adapt it to other machine-learning methods as Support Vector Machines or Artificial Neural Networks.  Improve the detector adding spatial constrains of the human body. Considering human body physical limitations like: legs can not rotate in all directions, forearms location are directly restricted by its respective arm position. Taking into account this constrains we should be able to reduce the search space of the detection discarding unreachable positions for some body parts. Human body pose study based on depth imaging 52 References [1] EICHNER M, MARIN-JIMENEZ M, ZISSERMAN A, FERRARI V. 2D Articulated Human Pose Estimation and Retrieval in (Almost) Unconstrained Still Images. 2012, 99.2 190-214. [2] NAVARATNAM R, THAYANANTHAN A, TORR P, CIPOLLA R. Hierarchical part-based human body pose estimation. 2005. [3] DANTONE M, GALL J, LEISTNER C, VAN GOOL L. Human Pose Estimation using using Body Parts Dependent Joint Regressos. (CPVR) 2013 IEEE Conference on p.3041-3048. [4] KHOSHELHAM K. Accuracy analysis of Kinect depth data. 2011, ISPRS workshop laser scanning. [5] GANAPATHI V, PLAGEMANN C, KOLLER D, THRUN S. Realtime human pose tracking from range data. 2012, Springer Berlin Heidelberg. [6] SHOTTON J, GIRSHICK R, FITZGIBBON A, SHARP T, COOK M, FINOCCHIO M, MOORE R. Efficient human pose estimation from single depth images. 2013, IEEE Transactions on 35.12 2821- 2840. [7] BAAK A, MÜLLER M, BHARAJ G, SEIDEL H, THEOBALT C. A data-driven approach for real-time full body pose reconstruction from a depth camera. 2013, Consumer Depth Cameras for Computer Vision. Springer London. p. 71-98. [8] GREST D, WOETZEL J, KOCH R. Nonlinear Body Pose Estimation from Depth Images. 2005, Pattern Recognition. Springer Berlin Heidelberg. [9] SUAU X. Human Body Analysis using Depth Data. 2013, PhD. from Universitat Politécnica de Catalunya. Human body pose study based on depth imaging 53 [10] Wikipedia. Principal Component Analysis (http://en.wikipedia.org/wiki/Principal_component_analysis) [11] SUAU X, RUIZ-HIDALGO J, CASAS J R. Oriented radial distribution on depth data: application to the detection of endeffectors. 2012, ICASSP, IEEE International Conference on p.789-792. [12] TANG S, WANG X, LV X, HAN T X, KELLER J, HE Z, SKUBIC M, LAO S. Histogram of oriented normal vectors for object recognition with a depth sensor. 2012, Computer Vision- ACCV. 2013, Springer Berlin Heidelberg 525-538. [13] BENTLEY J L. Multidimensional binary search trees used for associative searching. 1975, Communications of the ACM 18.9. [14] Wikipedia. Evaluation of binary classifiers (http://en.wikipedia.org/wiki/Evaluation_of_binary_classifiers) Human body pose study based on depth imaging 54 Appendices A Gesture confusion qualitative description In chapter 6.4.1 major confusions between pose gestures are listed. In this section we give a qualitative description based on our high level interpretation of the body pose dataset gestures. Figure A.1: Dataset body poses 8 (left) and 9 (right) - Confusion of poses 8-9: the two poses are practically identical, only they differ in the left arm on one being extended and the other connected to the body trunk. Figure A.2: Dataset body poses 6 (left) and 7 (right) Human body pose study based on depth imaging 55 - Confusion of poses 6-7: the lower body is exactly the same in both poses. The arms have different configurations but despite that they still share that they are flexed and are symmetric respect the torso. Figure A.3: Dataset body poses 3 (left) and 7 (right) - Confusion of poses 3-7: the discriminative body parts are the forearms which in pose 3 are aligned with the arms and in pose 4 are flexed with the hands above the head. Also, in pose 7 legs are slightly flexed. Figure A.4: Dataset body poses 4 (left) and 10 (right)